uistoryboardsegue

Conditional Segue from UITableView to DetailView based on object state

蹲街弑〆低调 提交于 2019-12-06 01:42:42
I've set up the Xcode storyboard of my drill down table to branch out to two detail views. I want it to segue to either one based on the status of the Budget object that I tapped in the table view. If the budget object has not been initialized, I want to to segue to the initializing view. If it has been initialized, I want it to segue to the detail view. So far, this is what I have... - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { /* When a row is selected, the segue creates the detail view controller as the destination. Set the detail view controller's detail item to

How to add storyboard reference in another storyboard

心已入冬 提交于 2019-12-05 18:24:57
问题 I have 2 storyboard - mainStoryBoard1 and mainStoryBoard2 . I need to perform a segue from ViewController of mainStoryBoard1 to ViewController of mainStoryBoard2. Anyone has idea how to do this? 回答1: Interface Builder in Xcode 7 has "Storyboard Reference" object in the "Object library": Just drag that onto your storyboard. You can then select that storyboard reference and specify the storyboard to which it refers in the attributes inspector: Then you can now add segue to this reference and

Difference between unwind segue and delegation

橙三吉。 提交于 2019-12-05 13:18:19
I wonder if anybody can explain the difference between using a unwind segue and using delegation in the example I have below: I have a FriendsTableViewController populated by an array of friends and another AddFriendTableViewController with a function to add a friend to the FriendsTableViewController . This is how I send the data from my AddFriendViewController with a unwind segue : #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Check

Warning: Attempt to present * on * which is already presenting (null)

╄→尐↘猪︶ㄣ 提交于 2019-12-05 08:22:32
问题 This is my first application for iOS. So I have a UIVIewController with a UITableView where I have integrated a UISearchBar and a UISearchController in order to filter TableCells to display override func viewDidLoad() { menuBar.delegate = self table.dataSource = self table.delegate = self let nib = UINib(nibName: "ItemCellTableViewCell", bundle: nil) table.registerNib(nib, forCellReuseIdentifier: "Cell") let searchButton = UIBarButtonItem(barButtonSystemItem: .Search, target: self, action:

prepareForSegue collectionView indexPath using swift

本小妞迷上赌 提交于 2019-12-05 06:31:21
问题 I don't find any good example to do what I want using swift so I allow myself to ask the question. Im using a collectionView to display PFObjects and I want to send the displayed cell data to a second controller using prepareForSegue. At this point, Im struggling to make this part of the code works: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if(segue.identifier == "goto_answerquestion"){ var indexpath : NSIndexPath = self.collectionView

segue: destination view controller weirdness

有些话、适合烂在心里 提交于 2019-12-05 06:05:18
In my app, I use a storyboard and segues, and I often pass data to the destination view controller before doing the segue, as follows: - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.destinationViewController respondsToSelector:@selector(setMyData:)]) { [segue.destinationViewController performSelector:@selector(setMyData:) withObject:myData]; } } It works everywhere except in one place. The selector gets called, the data gets set, but when the segue completes and the destination controller appears, it doesn't have the data I just set. After printing the view

Xcode custom segue animation

纵然是瞬间 提交于 2019-12-05 05:00:53
问题 I have a problem with the transition animation between two storyboard controllers. I have a singleView project with two view controllers in the storyboard. Now I wand to make a custom transition animation: my current view controller should disappear to the left the new view controller should come from the right I have already a UIStoryboardSegue class. But what should I write in the -(void)perform{} method?? Thanks a lot, Jonas. 回答1: For that simple segue you can try something like this: -

Reference to the segue source view controller

跟風遠走 提交于 2019-12-05 04:04:45
Within my viewDidLoad I would like some custom code based upon the previous controller. How can I access the segue source controller or the previous segue identifier in the destination controller's viewDidLoad to handle this? There is no way to get a reference to the segue that created you. You could create a property (sourceVC in my example) in the destination controller, and assign self to this property in the prepareForSegue method (in the source view controller): [(DestinationVCClass *)segue.destinationViewController sourceVC] = self; You can just use [self presentingViewController] and

Popover segue to static cell UITableView causes compile error

风流意气都作罢 提交于 2019-12-05 02:47:05
I currently have an application with two view controllers. The first is a view controller with an embedded table view that has dynamic cells. The second is a table view controller with static cells. If I add a segue from selecting one of the dynamic table's cells to the static table view controller (using the Push or Modal style setting), I can see that the segue works as expected. However, when I change the style to Popover I get the following compile error: Couldn't compile connection: <IBCocoaTouchOutletConnection:0x4004c75a0 <IBProxyObject: 0x400647960> => anchorView => <IBUITableViewCell:

IOS : firing multiple segues from a prototype cell in storyboards

╄→гoц情女王★ 提交于 2019-12-04 23:37:18
问题 Is there a way to connect a prototype cell to different scenes and on the didSelectRowAtIndexPath method call the [self performSegueWithIdentifier:@"NAMEOFTHESEGUE" sender:self] ? I can't seem to drag multiple segues from the prototype cell to different scenes... I know it is possible with static cells because you can draw a segue from each cell to the scene but what if i'm using prototype cells? I'm currently trying to implement this using the SWRevealViewController (https://github.com/John