watch os 2 - WatchOS: Inserting pages in page-based navigation -
i'm using -[wkinterfacecontroller presentcontrollerwithnames:contexts:] modally present dynamically-created set of pages. there may occasions want insert page in set of pages while visible. possible, or set of pages fixed once visible?
i have devised method achieve this, it's messy. better solution considerable improvement.
- each
wkinterfacecontrollerin group of pages hasuuidproperty assigned using context , stored duringawakewithcontext: - the
wkinterfacecontrollerpresents group of pages retains arrays ofwkinterfacecontrollernames , contexts before presenting them - when 1 of pages needs insert/delete pages set, posts notification presenting
wkinterfacecontroller - the presenting
wkinterfacecontrollermakes changes required in retained arrays ofwkinterfacecontrollernames , contexts - the presenting
wkinterfacecontrollerdismisses current group of pages , re-presents them using updated name/context arrays - the presenting
wkinterfacecontrollerposts notification observed of pages, includinguuidnew page notification object. notification triggers pages check ownuuidagainst 1 sent in notification object. if notification matches, interface controller callsbecomecurrentpage
i haven't tested this, it's method can think of might work. ugly though, see current page disappear, first page appear, , new page animate view. not great user experience perspective, can't think of other way since apple doesn't give methods insert pages.
Comments
Post a Comment