Re: "Computed segue" in iOS?
Re: "Computed segue" in iOS?
- Subject: Re: "Computed segue" in iOS?
- From: Mike Abdullah <email@hidden>
- Date: Mon, 07 Sep 2015 22:49:29 +0100
> On 7 Sep 2015, at 20:33, Carl Hoefs <email@hidden> wrote:
>
>
>> On Sep 6, 2015, at 10:27 AM, Mike Abdullah <email@hidden> wrote:
>>
>> Ideally, you use different cells for the different data elements, and wire them up to the appropriate segue, letting the system take care of most of it for you.
>
> This is for situations when one is not using a prototype cell in the UITableView?
You would create multiple prototype cells, each one with a different segue.
>>
>> If you need something more complex, it’s time to trigger the segues programatically. You can wire up multiple segues from your source View Controller to other VCs.
>
> I wish I knew how! IB allows me to wire up only a single segue from my source VC (with the UITableView) to another VC.
>>
>> Probably simples from there is to implement the UITableViewDelegate method which tells you a cell was selected and trigger the segue from it.
>
> I understand this to require an additional (modal) storyboard segue + identifier to be defined in IB.
I’m not sure what you mean by “modal” here.
>
>> But an alternative can be to wire up a single segue from the cell itself, and override -shouldPerformSegueWithIdentifier: to return NO and trigger a different segue instead.
>
> This would work if I could wire up multiple segues from a single VC, each with an identifier. Then I could call -performSegueWithIdentifier: directly. But I'm not seeing how to define the additional segue + identifier in IB.
Wiring up multiple segues should be pretty straightforward. For example in Xcode 6:
1. Open up your storyboard in the editor
2. Click something within the scene you want to segue _from_ in order to begin editing it
3. You should see in the sort of titlebar thing attached to the scene, on the left-hand end, an object which represents the view controller. Control-drag from that object to your destination VC to create the segue
_______________________________________________
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