• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Choosing view controller for segue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Choosing view controller for segue


  • Subject: Re: Choosing view controller for segue
  • From: Alex Zavatone <email@hidden>
  • Date: Thu, 15 Jun 2017 15:55:12 -0500

If you have a naming convention for your segues’ identifiers, them make sure
the segue name matches a string that can be derived from your user setting.

Then issue the performSegue with that name.

In your case, if you have the instance of the view controller that you will be
displaying, and you want to change a setting in it before it is displayed, call
a proper update method that is made to change that setting.  I think you can
also call it within viewWillAppear and get what you are looking for.

Does that make sense?

Am I missing something or does this sound like it’s on the right track?

Cheers,
Alex Zavatone


> On Jun 15, 2017, at 2:45 PM, Steve Mills <email@hidden> wrote:
>
> What's the best way to programmatically choose which view controller will be
> used to segue to? The storyboard was initially set up to segue to a
> particular view controller, but now I want to choose a different target
> depending on a user setting.
>
> I ask because there appears to be no simple way to switch a
> UIPageViewController from showing 1 page at once to 2 pages at once aside
> from loading a different one from the storyboard, or by allocating a
> different one programmatically. Seems like a huge oversight on Apple's part.
> So when I segue to this view, I need to choose the 1-page or 2-page version,
> depending on the user setting.
>
> There's no mention of using a different view controller in
> prepareForSegue:sender:'s docs.
>
> Sent from iCloud's ridiculous UI, so, sorry about the formatting
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Choosing view controller for segue (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: Choosing view controller for segue
  • Next by Date: Re: Choosing view controller for segue
  • Previous by thread: Re: Choosing view controller for segue
  • Next by thread: APFS
  • Index(es):
    • Date
    • Thread