uistoryboard

Call storyboard scene programmatically (without needing segue)?

狂风中的少年 提交于 2019-11-27 17:17:46
I have a modal storyboard scene that I want to be accessible to all my other scenes. Creating a modal segue to it from every scene on my storyboard creates a big mess of strings going everywhere. Is there a way that I leave off the segues and call the scene programmatically instead? Basically I want to do something like this: MyNewViewController *myNewVC = [[MyNewViewController alloc] init]; [self presentModalViewController:myNewVC animated:YES]; except instead of creating and pushing a view controller class, I want to do a modal transition to an "isolated" (not connected with a segue)

awakeFromNib, outlets and storyboards: is the documentation wrong?

萝らか妹 提交于 2019-11-27 17:14:30
问题 According to the NSObject UIKit Additions Reference, outlet variables should be set by the time awakeFromNib is called (emphasis all mine): The nib-loading infrastructure sends an awakeFromNib message to each object recreated from a nib archive, but only after all the objects in the archive have been loaded and initialized. When an object receives an awakeFromNib message, it is guaranteed to have all its outlet and action connections already established. ... Important: Because the order in

In iOS13 the status bar background colour is different from the navigation bar in large text mode

南笙酒味 提交于 2019-11-27 15:19:55
Pre-conditions to reproduce the problem: Xcode 11 beta + iOS 13 (latest version until Jun. 12 2019) The navigation bar is in Large text mode Specify the colour of navigation bar. The status bar will remain in white in a real device, above the green navigation bar. Solutions I tried: Revert it back to iOS12 will solve it, but we will encounter iOS13 eventually... disabling the large text mode will solve it... hide the status bar will fix it, but it will cause status text overlapping with navigation bar item. Any ideas? appreciate any help. No hacks or funkiness required here. The key is

Passing object with prepareForSegue Swift

好久不见. 提交于 2019-11-27 14:37:00
问题 I am trying to pass an object to another scene with prepareForSegue() override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using [segue destinationViewController]. var nextScene = segue.destinationViewController as! VehicleDetailsTableViewController // Pass the selected object to the new view controller. if let indexPath = self.tableView.indexPathForSelectedRow() { let selectedVehicle = vehicles[indexPath.row] nextScene.currentVehicle =

Xcode 6: can't connect any IBOutlet to ViewController

主宰稳场 提交于 2019-11-27 14:00:03
After upgrading to Xcode 6, I opened an old project (that contains a subproject, so it has many targets) and I noticed that no link from my Storyboard ViewContoller to the relative Objects works. For example I have a ViewController with a TableView inside and now I cant do can't do anyhing with it because the connection is missing, I can't even redefine a new IBOutlet in the VC because the arrow in the storyboard from the VC won't connect to anything. To be more clear: The class is defined in the Custom Class section, so I can't find the problem What should I do? Btw I'm using obj-c not swift,

Instantiate View Controller from Storyboard vs. Creating New Instance

£可爱£侵袭症+ 提交于 2019-11-27 13:52:32
What is the functional difference between instantiating a View Controller from the storyboard and creating a new instance of it? For example: #import "SomeViewController.h" ... SomeViewController *someViewController = [SomeViewController new]; versus #import "SomeViewController.h" ... UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil]; SomeViewController *someViewController = [storyboard instantiateViewControllerWithIdentifier:@"SomeViewController"]; In either case, is someViewController effectively the same thing? The main difference is in how the subviews of

Does storyboard eliminate the need for .nib

拟墨画扇 提交于 2019-11-27 13:36:32
With the introduction of storyboard, I wouldn't select to create a .xib/.nib when I create a subclass of UIViewController, because I can just drag out a viewcontroller in interface builder and assign it to the new class. So, with storyboard, when would i need to use the .xib/.nib file? Thank you. Akki I guess, storyboard contains the .xib/.nib files for all your views. It present relationships between them and helps you to avoid confusion if you have a LOT of views. Also it saves your time and nerves when writing code. Storyboards don't completely remove the need for NIB files. One common

Reload storyboard to change locale

情到浓时终转凉″ 提交于 2019-11-27 13:18:01
问题 I am using a single, localized Storyboard for my application. The app has to have an option to change language on the fly. So far I figured out how to change the language which is used during the app launch: [[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"de", @"en", @"fr", nil] forKey:@"AppleLanguages"]; [[NSUserDefaults standardUserDefaults] synchronize]; //to make the change immediate And managed to reload my entire application by removing all subviews of the

UISearchDisplayController causes crash after viewDidUnload

拈花ヽ惹草 提交于 2019-11-27 13:02:45
问题 I have a project using StoryBoards and UISearchDisplayController used in the context of a UINavigationController , that appears in the root viewcontroller. When I push a new view controller onto the stack and I cause a simulated memory warning (or actually get a low memory warning). The previous view controller successfully unloads its view. However, when I pop the second view controller off of the stack I get an EXC_BAD_ACCESS . I turned on NSZombies and discovered this:

Storyboard - setting delegates

时光怂恿深爱的人放手 提交于 2019-11-27 11:47:44
问题 Before storyboards I was able to set delegates and datasources just by dragging an outlet to a class. With storyboards, I cannot drag the outlet to another view controller; there is no destination that will respond to it. If I click on a view controller object, I am able to see the class owner at the bottom, but as soon as I select the other view controller containing the outlet, the old selection is gone, so I cannot connect the two. Is this Apple's way of saying we should only connect them