uistoryboard

How unwindForSegue:towardsViewController: works?

余生颓废 提交于 2019-12-03 09:58:57
问题 In my simple app, I have created some controllers with basic segues between them: Yellow controller -> BlueController -> GreenController -> OrangeController . Every of them has its own custom class. From OrangeController I created unwindSegue to my YellowController . It is ok. Within every class I put: override func unwindForSegue(unwindSegue: UIStoryboardSegue, towardsViewController subsequentVC: UIViewController) { print(unwindSegue) print(subsequentVC) } But it was not called at all. Why?

XCode 4.2 Version Inspector Hides Storyboard

♀尐吖头ヾ 提交于 2019-12-03 09:50:37
I'm not sure if anyone else is having the problem...but when I click the Version Editor button in XCode...my Storyboard switches to XML view and I can't figure out how to get the Visual editor back. Can anyone help? I'm really hoping this is just a result of late night coding sleepiness...thanks in advance Right click on the storyboard file -> Open As -> iOS Storyboard An easier way to do that is to go to the File menu and close the file. I had to close all open storyboards then select them again. I had this issue (now the year is 2014) and the fix was clicking the icon on the top right for

dynamic UITableView in static UITableViewCell

断了今生、忘了曾经 提交于 2019-12-03 09:16:16
Following setup causes trouble: In my storyboard I have a standard table view controller, containing a table view with three static cells as content. One of the cells contains another table view with dynamic content and a prototype cell in it. Both table views' delegate and datasource are set to the same table view controller. In the delegate and datasource methods I determine which tableview has called the method and handle the response appropriately. However, if the dynamic table view contains more than one element I get a NSRangeException with [__NSArrayI objectAtIndex:]: index 1 beyond

Best practice for modifying storyboard auto layout constraints in code?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 09:12:26
I've always done my UIs in code but have decided that I should use storyboards and auto layout for a current project. Everything had been going well until I built a complex scene with about 50 views with lots of hierarchy and some grid of views. The problem is that my auto layout is getting muddled on some devices and orientations. I'm finding it challenging to use IB to try fixing the dozens (hundreds?) of constraints or to track down the problems and resolve them. The situation is such that I'm not getting errors or warnings, just some unpleasant layouts at times. And IB can be a pain with

Xcode 10, where are the UI elements?

假如想象 提交于 2019-12-03 08:56:08
问题 Have been out of Swift coding for almost a year, I'm back. Download Xcode 10 beta. Have I lost my mind? I've tried every trick I know, none of the UI elements show up in storyboard. Zero. The sidebar is empty. Xcode 10: Xcode 9, no problem there they are, all my UI buttons, etc. thanks, this is kind of surreal. :-) 回答1: Library content has moved from the bottom of the Inspector area to an overlay window, which can be moved and resized like Spotlight search. It dismisses once items are dragged

iOS: Make segue wait for login success

☆樱花仙子☆ 提交于 2019-12-03 07:26:32
问题 I am designing an iOS app using XCode 4.2's storyboard feature. The app has a login screen that takes a username and password and has a button to log in. Pushing the login button triggers a push seque to another view controller. However, I want the seque to wait until the login comes back successful before proceeding to the next view controller. I know about prepareForSegue:sender: but heres my issue: the login call is asynchronous. I therefore cannot perform the login there. Is there someway

How to move back to the root view controller in storyboard?

天涯浪子 提交于 2019-12-03 07:20:37
What I want to do seems pretty simple, but I can't find any answers on the web. I have the login screen as the root view controller and then tab bar controller and in every tab I have a navigation controller. I have used storyboard and the hierarchy is described below, Root VC | --- tabbar controller | ---Navigation Controller | --- VC1 Requirement is to navigate back to the root view controller from VC1. How can we achieve this? I got the resolution to the issues using the "Unwind Segues". Step 1) The bare minimum you need is to subclass the view controller for your destination view (aka, a

TableView with multiple prototype cells

帅比萌擦擦* 提交于 2019-12-03 05:55:28
问题 I had a simple question regarding a table view with 3 different kinds of prototype cells. The first two occur just once while the third occurs 4 times. Now what I'm confused about is how to specify in my cellforRowatindexpath which cell prototype to use for which row. So, I want something like for row 0, use prototype 1, for row 1, use prototype 2, for rows 3,4,5 and 6 use prototype 3. What's the best way to do this? Do i give each prototype an identifier and then use

How to hide the initial window on start with OS X storyboards

浪子不回头ぞ 提交于 2019-12-03 05:52:00
I am creating an OS X status bar application, so I want the application to start hidden . I have created a "storyboard" application, and the initial window always shows up, even if "Visible at launch" is unchecked (was unchecked by default). Note: if I disable " Is initial controller " then the app correctly starts without any window, but my (now orphan) window seems to never be added to the storyboard: var mainWindow = NSStoryboard(name: "Main", bundle: nil)?.instantiateControllerWithIdentifier("mainWindow") The "mainWindow" controller is not found (even though I correctly set "Storyboard ID"

Swift: Force show Navigation Bar in Modal

可紊 提交于 2019-12-03 05:42:07
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(false, animated: true) } But it refuses to show any navigation bar. How can I perform a vertical segue