segue

Push View Controllers from Modal View in Storyboard

无人久伴 提交于 2020-01-02 07:00:33
问题 I am using storyboard and have a screen which is presented modally, which I then need to push other view controllers from so that I can select items for the modal view (similar to adding an entry on the iPhone Calendar app). So I am going from: Navigation Controller > VC > Modal View Controller > ??? Here I want to push a VC so that I can select an item to return to the modal view. How can I make this possible as I'm currently getting an error "Push segues can only be used when the source

UIViewController throwing unrecognized selector exception on prepareForSegue

老子叫甜甜 提交于 2020-01-02 02:46:26
问题 I'm trying to follow along the Stanford CS193p iOS programing lectures. One of the demo programs, called "Happiness" creates two UIViewControllers, a "PsychViewController" and a "HappinessViewController." It segues from the PsychViewController to the HappinessViewController using a target action method. The following code keeps throwing this exception: "-[UIViewController setHappiness:]: unrecognized selector sent to instance" Here's the offending code: -(void)prepareForSegue:

Custom Segue Class for Unwind Segue

邮差的信 提交于 2020-01-01 13:58:06
问题 A Standard / Forward Segue can be clicked on in the Storyboard builder and the style can be changed to Custom. At this point a Segue Class can be specified. However, this is not possible for an Unwind Segue. Unwind Segues only have Identifier and Action to specify. It reasons that their type is "Unwind Segue" but is there a way to create a custom Segue class for these Unwind Segues? 回答1: I found that in order to implement a custom unwind segue I had to subclass the UINavigationController and

Custom Segue Class for Unwind Segue

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-01 13:57:36
问题 A Standard / Forward Segue can be clicked on in the Storyboard builder and the style can be changed to Custom. At this point a Segue Class can be specified. However, this is not possible for an Unwind Segue. Unwind Segues only have Identifier and Action to specify. It reasons that their type is "Unwind Segue" but is there a way to create a custom Segue class for these Unwind Segues? 回答1: I found that in order to implement a custom unwind segue I had to subclass the UINavigationController and

Swift: Switch between NSViewController inside Container View / NSView

天涯浪子 提交于 2020-01-01 09:37:23
问题 I want to achieve a really simple task—changing the ViewController of a Container View by pressing a button: In my example the ViewController1 is embedded into the Container View using Interface Builder. By pressing the Button ViewController2 I want to change the view to the second ViewController. I’m confused because the Container View itself seems to be a NSView if I create an Outlet and as far as I know a NSView can’t contain a VC. Really appreciate your help! 回答1: Just note that in order

UICollection View - Segue - did select specific cell , LOG

流过昼夜 提交于 2020-01-01 05:44:23
问题 I am starting to use a UICOllectionview to load a custom made photo album, the album loads just fine, and the data is coming from my server (SQL-JSON-NSARRAY-NSDictionary) and been populated in the cell's just fine, However now I would like it when the user selects that cell to load a new UIVIewController with that image in full size (so they can view/print/share etc) However I am getting stuck in the 'prepare for segue' method, as I cannot pull any information from that specific cell as a

instantiateViewControllerWithIdentifier and pass data

三世轮回 提交于 2020-01-01 05:15:36
问题 I am using Storyboard in my app and I want to pass data from one view to another view. Instead of using segues I am using instantiateViewControllerWithIdentifier . In this case I am instantiate from my first TableViewController to a NavigationController which has a second TableViewController attached because I need the navigation in the second TableViewController . Now I want to pass data from my first TableviewController , depending which row was clicked, to my second TableviewController .

Disabling segue animation

余生颓废 提交于 2020-01-01 04:17:16
问题 I want to Show (e.g. push) segues in my storyboard, to connect my viewcontrollers and my navigation controller. Then the navigation bars on the viewcontrollers will show correctly. For example: With show detail or present modaly, the navigation bar will disappear But I don't want segue animation. Xcode is giving the warning like : "Disabling segue animation is not available prior to iOS 9.0" And I wants deployment target of iOS 7.0 or 8.0 How can I solve this? Thanks in advance. 回答1: You can

Swift: Force show Navigation Bar in Modal

一曲冷凌霜 提交于 2020-01-01 02:01:50
问题 I have the following Storyboard Segue in my Swift project: The animation is correct, but there is no navigation bar in the destination view controller. I want to force the destination view controller to have a navigation bar. I tried in the destination view controller: override func viewWillAppear(animated: Bool) { super.viewWillAppear(true) navigationController?.navigationBar.hidden = false } Or: override func viewWillAppear(animated: Bool) { self.navigationController?.setNavigationBarHidden

How to pass data in conditional unwind segue?

我只是一个虾纸丫 提交于 2019-12-31 07:34:27
问题 I try to build an rss reader. On the "adding feed" page, if I tap the "add" button, I hope to check if the feed is successfully added. If it is added, then trigger the unwind segue, and back to the main page. If it is not added, stay in the current page. I know I can build an IBAction on the "add" button, and check if the feed is added. However there are two requirements I need to meet in order to add a feed. First, after I parse the url, I need to know if the parse results can generate a