uistoryboard

How to create a UIViewController layout in storyboard and then use it in code?

一笑奈何 提交于 2019-11-28 23:37:00
I have a Storyboard in my iOS 5 application. In there I have created a number of screens and it works perfectly. However there's one view controller that I create in code, not as a result of UI action but at the end of processing data. I would like to show this view controller then, as a modalViewController, but also have it designed in the storyboard editor. Is it possible? Using the nibs I did it like this: ResultsController *rc = [[ResultsController alloc] initWithNibName:@"ResultsController" bundle:nil]; [self.navigationController presentModalViewController:rc animated:YES]; [rc release];

Change the listing order of the view controllers in Xcode storyboard

给你一囗甜甜゛ 提交于 2019-11-28 21:01:30
I'm just starting my first application using storyboards. I'm using Xcode 4.5 and iOS 6 SDK. I want to know how to change the order in which the controllers are listed in the Document Outline (panel to the left of the storyboard). In the Document Outline, drag the orange view controller icon. As you do this you will see the blue horizontal insertion point appear between the grey boxes. Let go and the whole grey group box for the view controller will relocate. In Xcode 10 you just open storyboard XML and move specific "scene" to proper place under "scenes" tag. And that's it. The order will

Reload storyboard to change locale

坚强是说给别人听的谎言 提交于 2019-11-28 20:55:08
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 key window, reloading the initial view controller from the storyboard and making it the new root view

UISearchDisplayController causes crash after viewDidUnload

瘦欲@ 提交于 2019-11-28 20:38:30
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: [UISearchDisplayController retain]: message sent to deallocated instance 0xb13aa30 I am not (at least in my code) sending

How to correct Tab Bar height issue on iPhone X

感情迁移 提交于 2019-11-28 19:12:06
I'm having an issue with my app when testing for iPhone X. I'm not sure how to adjust this issue, as well as not make it an issue for non iPhone X sizes. This only seems to be an issue on the iPhone X simulator. Dipak Kacha "File inspector" from right of Xcode storyboard, enable Safe Area guide layout to support your app in iPhone This post describes really good. On iOS 12.1 I've solved this issue by overriding safeAreaInsets in the UITabBar subclass: class TabBar: UITabBar { private var cachedSafeAreaInsets = UIEdgeInsets.zero override var safeAreaInsets: UIEdgeInsets { let insets = super

Storyboard - setting delegates

拟墨画扇 提交于 2019-11-28 18:45:51
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 programmatically? Correct. Set the delegate or other data in your prepareForSegue:sender: method. Here

iOS 7 UIDatePicker height inconsistency?

拟墨画扇 提交于 2019-11-28 17:26:47
I'm running into something weird when using UIDatePicker elements with Storyboards in iOS 7. In the Storyboard, the date picker has a fixed height of 162. In reality, however, the element takes up more space than that. So this turns into this: so I have to move everything below it down, guessing and eyeballing how much space the date picker will actually use. Is this a bug? Am I doing something wrong? To be clear, the date picker is totally transparent - can't figure out a way around that. The white background at the top is the main UIView, and the gray background is the background of the

What is the best practice when using UIStoryboards?

百般思念 提交于 2019-11-28 17:06:01
Having used storyboards for a while now I have found them extremely useful however, they do have some limitations or at least unnatural ways of doing things. While it seems like a single storyboard should be used for your app, when you get to even a moderately sized application this presents several problems. Working within teams is made more difficult as conflicts in Storyboards can be problematic to resolve (any tips with this would also be welcome) The storyboard itself can become quite cluttered and unmanageable. So my question is what are the best practices of use? I have considered using

Xcode storyboard: Internal error. Please file a bug

♀尐吖头ヾ 提交于 2019-11-28 16:47:32
While editing in the storyboard, specifically assigning a view controller to a specific class, I suddenly encountered this error when I wanted to run the project. Main.storyboard: Internal error. Please file a bug at bugreport.apple.com and attach "/var/folders/79/_jh611t15qsfcx165_jv_20h0000gn/T/IB-agent-diagnostics_2015-10-28_00-33-12_730000". And now I can't run my project anymore. I couldn't find any information regarding to this anywhere else. Did anyone encounter this before? I faced the same issue. And it was solved by cleaning up the build files. cmd + shift + k AND cmd + option +

A launch storyboard or xib must be provided unless the app requires full screen

微笑、不失礼 提交于 2019-11-28 16:28:36
I don't use a storyboard/xib for launch screen and get these errors in Xcode7+. - All interface orientations must be supported unless the app requires full screen. - A launch storyboard or xib must be provided unless the app requires full screen. Tomas Camin Starting from iOS9 and Xcode 7 you are required to provide a LaunchScreen.storyboard for your launch screen in order to support the new multitasking feature on iPad. To opt out of being eligible to participate in Slide Over and Split View, add the UIRequiresFullScreen key to your Xcode project’s Info.plist file and apply the Boolean value