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.

  1. each wkinterfacecontroller in group of pages has uuid property assigned using context , stored during awakewithcontext:
  2. the wkinterfacecontroller presents group of pages retains arrays of wkinterfacecontroller names , contexts before presenting them
  3. when 1 of pages needs insert/delete pages set, posts notification presenting wkinterfacecontroller
  4. the presenting wkinterfacecontroller makes changes required in retained arrays of wkinterfacecontroller names , contexts
  5. the presenting wkinterfacecontroller dismisses current group of pages , re-presents them using updated name/context arrays
  6. the presenting wkinterfacecontroller posts notification observed of pages, including uuid new page notification object. notification triggers pages check own uuid against 1 sent in notification object. if notification matches, interface controller calls becomecurrentpage

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

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -