Apple Watch notes-in-app navigation mode

Source: Internet
Author: User

Recently, the Apple prostitute listing, fruit also released Xcode 6.2 official version, WatchKit can also be used normally. The fruit is in time to provide the development documentation for Apple Watch, and I'm also trying to wildest learn to develop watch apps.

Today the main want to talk about is the Watch app page navigation mode, this piece of content and the normal development of iOS, it is worth exploring.

Page type

According to the official documentation, the Watch app is available in only two page formats: page Based and hierarchical. these two forms of navigation cannot coexist directly, but coexistence can be achieved by Modalpage (modal pages), as shown below .

Page Based pages are similar to the pagination layout in iOS general development, and can be left-and-right to toggle pages, belonging to sibling navigation, and is suitable for situations where each page data is not associated with another page, as follows:

The hierarchical page is basically consistent with push navigation in regular iOS development, enabling hierarchical navigation for more complex data models or apps with multi-layered data, with the following effects:

The Modal page can be implemented with page based pages and hierarchical pages, which are essentially the same as the modal navigation in regular iOS development, with the following effects:

So what's the problem, and how do they make it?

    1. Implemented in the designer

The implementation of the designer is very simple, consistent with regular iOS development, using the control+ mouse drag-and-drop form, the effect is as follows:

2. Code Control implementation

Of course, the use of code can also implement push and model navigation, push navigation using the Main method is Pushcontrollerwithname:context:, Modal navigation using the presentControllerWithNames:contexts: and presentControllerWithName:context: .

As follows:

- (ibaction) modaltopage {    // modal navigation    [self presentcontrollerwithname:@ " Detailic " Context:nil];    } - (ibaction) pushtopage {    //push navigation    [self pushcontrollerwithname:@ "  detailic"Context:nil"  ;}

Summarize:

There are fewer navigational forms in Apple watch, and we need to plan our app's page navigation structure without adding UI elements when the code is running, and try not to allow the principle of running long-running tasks to be more demanding. We need to think about it.

Finally, attach the official document address: https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/ Configuringyourxcodeproject.html#//apple_ref/doc/uid/tp40014969-ch2-sw1

Apple Watch notes-in-app navigation mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.