uistoryboardsegue

Passing data from CollectionView to DetailVC in Swift 4

柔情痞子 提交于 2019-12-13 10:45:15
问题 My CollectionView should pass a class model to DetailViewController , but when I tap on a cell I get the nil error. Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value The CollectionViewController is embedded programmatically on a TabBarController . Collection View func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return soundArray.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt

How to perform modalSegue?

时光总嘲笑我的痴心妄想 提交于 2019-12-13 06:29:13
问题 I'm building an iOS app. I have integrated facebook login in my app and implemented modal segue means when user logged in successfully it goes on next view. I'm facing a problem that is after logged in i'm not able to go on next view.one thing more i'm not able to do that when user already logged in on my app through facebook and come back after closing the app it should be on Next ViewController not on login screen again. Storyboard flow is: Login screen --> Modal Segue --> Navigation

If keyboard is not dismissed, segueing when using a search bar changes destination view controller layout

时间秒杀一切 提交于 2019-12-13 06:13:13
问题 I have a UITableView where I display a list of chat rooms. I'm also using a search bar to find an specific chat room. When a user taps into a cell, it segues to the chat room conversation, displaying the messages and a text box to send messages. However, if I seach a chat room using the search bar, when I tap in any cell the segue is done but the layout of the chat room is wrong. The conversation view (custom UITableView ) fills the whole screen and the text box (located at the bottom, just

Unwind segue not being triggered

白昼怎懂夜的黑 提交于 2019-12-13 04:29:40
问题 I have a storyboard that has a starting view controller that presents other modal view controllers. Say view controller A is the startingViewController, and view controller B is the modally presented view controller. How can I trigger the unwind segue from B back to A, from ViewController A ( not just from a button located on ViewController B)? The button works to perform the unwind segue , but when I try to perform it programmatically using [self performSegueWithIdentifier:@"ReturnToStart"

Perform unwind segue programmatically

爷,独闯天下 提交于 2019-12-13 02:11:34
问题 Currently I have the following storyboard: UITableViewController -> Segue -> UINavigationController -> Relationship -> UITableViewController In the last UITableViewController I added a back button with the code below: navigationItem.setLeftBarButtonItem(UIBarButtonItem(title: "Back", style: UIBarButtonItemStyle.Plain, target: self, action: "unwind"), animated: true) let attributes = [NSFontAttributeName: UIFont.fontAwesomeOfSize(30), NSForegroundColorAttributeName: Constants.InterfaceColors

During custom segue transition, view's navigation bar items are misplaced

丶灬走出姿态 提交于 2019-12-12 10:02:52
问题 I've got a custom segue that uses the UIViewAnimationOptionTransitionFlipFromLeft to transition between views. When the new view comes on screen, there is a brief but discernible 'blink' caused by the Navigation Bar elements jumping from a left-aligned state to their appropriate positions. Following is a screenshot captured near the very end of the transition: You can see that the title and two bar button items are left aligned; completely out of place from where they will eventually rest.

Within a (BOOL)webView: How to open a URL clicked in UIWebView that opens a Modal UIWebView

[亡魂溺海] 提交于 2019-12-12 09:55:03
问题 Thanks for viewing my question. Let me describe the app first. I have a tab bar based app for iOS5.1 that is using storyboard and ARC. There are four tabs with a view controller in each one that shows a webview with local HTML files (each view is a different set of html files to display). Currently when a user touches a http or https link, it'll open in Safari. However, I now want it to open within app via a modal view. I currently have the interface created and ready to show, but I can't

SplitViewController with a Login View Controller as the root

末鹿安然 提交于 2019-12-12 09:25:40
问题 So I've been researching on how to make a login view controller as the initial view controller instead of the splitview. Some of the answers I've seen would recommend a modal view to be loaded? I'm not sure how that is set up. eg. How to add a login view before a UISplitViewController iPad and How to implement SplitViewController on second level.? So do I add those on the loginviewcontroller class? Or where? Any advice is welcome. Thanks!! 回答1: I've done this by creating two storyboards: one

prepareForSegue not called in embedded segue

旧城冷巷雨未停 提交于 2019-12-12 07:26:57
问题 I have a table view controller embedded in a container in a view controller. In both the view and table view controllers prepareForSegue method I put NSLog(@"name of the controller") I see a log for the view controller but not the table view controller. Shouldn't I also see the nslog for my table view's prepareForSegue? 回答1: In Your Log Frame View Controller prepareForSegue will be called directly after initWithCoder: to prepare your TableViewController. I cannot see your connection between

Segue to different controllers from one view controller

可紊 提交于 2019-12-12 05:53:14
问题 I have a table view with a few different prototype cells. I want to have one prototype cell segued to one controller and the rest should not be clickable i.e. no seg. Right now, I have one button linked to a controller successfully but when I tap on the tableview prototype cell which is segued to a different controller (in the storyboard) nothing happens. I don't get any error either. What is the best way to go around this? Can I make two different segues in the storyboard? Or do I need to