uistoryboard

How to use UIScrollView in Storyboard

我与影子孤独终老i 提交于 2019-11-26 04:57:36
问题 I have a scroll view with content that is 1000px tall and would like to be able to lay it out for easy design on the storyboard. I know it can be done programmatically but I really want to be able to see it visually. Every time I put a scroll view on a view controller it won\'t scroll. Is it possible to get it to work like I want or do I have to do it in the code? 回答1: I'm answering my own question because I just spent 2 hours to find the solution and StackOverflow allows this QA style. Start

When to use Storyboard and when to use XIBs

瘦欲@ 提交于 2019-11-26 04:01:55
问题 Are there any guidelines on when to use storyboards in an iOS project and when to use XIBs? what are the pros and cons of each and what situations do they each suit? Near as I can tell it\'s not that clean to use storyboard segues when you have view controllers being pushed by dynamic UI elements (Like map pins). 回答1: I have used XIBs extensively and completed two projects using Storyboards. My learnings are: Storyboards are nice for apps with a small to medium number of screens and

How to Implement Custom Table View Section Headers and Footers with Storyboard

痴心易碎 提交于 2019-11-26 03:46:51
问题 Without using a storyboard we could simply drag a UIView onto the canvas, lay it out and then set it in the tableView:viewForHeaderInSection or tableView:viewForFooterInSection delegate methods. How do we accomplish this with a StoryBoard where we cannot drag a UIView onto the canvas 回答1: I know this question was for iOS 5, but for the benefit of future readers, note that effective iOS 6 we can now use dequeueReusableHeaderFooterViewWithIdentifier instead of dequeueReusableCellWithIdentifier

What are Unwind segues for and how do you use them?

徘徊边缘 提交于 2019-11-26 03:12:25
问题 iOS 6 and Xcode 4.5 has a new feature referred to as \"Unwind Segue\": Unwind segues can allow transitioning to existing instances of scenes in a storyboard In addition to this brief entry in Xcode 4.5\'s release notes, UIViewController now seem to have a couple of new methods: - (BOOL)canPerformUnwindSegueAction:(SEL)action fromViewController:(UIViewController *)fromViewController withSender:(id)sender - (UIViewController *)viewControllerForUnwindSegueAction:(SEL)action fromViewController:

Xcode, where to assign the segue identifier

空扰寡人 提交于 2019-11-26 02:58:07
问题 Pardon me for beginner\'s question. I know I can switch to another screen (ViewController) like this self.performSegueWithIdentifier (\"SecondViewController\", sender: self) but I can\'t seem to find where to assign my 2nd screen the id, I just find Storyboard ID, is that it? I\'ve already tried, only received a crash with the following error: Receiver () has no segue with identifier \'SecondViewController\' Any idea? thanks 回答1: Segue Identifier is not the same as storyboard ID , storyboard

Best practices for Storyboard login screen, handling clearing of data upon logout

让人想犯罪 __ 提交于 2019-11-26 02:22:19
I'm building an iOS app using a Storyboard. The root view controller is a Tab Bar Controller. I'm creating the login/logout process, and it's mostly working fine, but I've got a few issues. I need to know the BEST way to set all this up. I want to accomplish the following: Show a login screen the first time the app is launched. When they login, go to the first tab of the Tab Bar Controller. Any time they launch the app after that, check if they are logged in, and skip straight to the first tab of the root Tab Bar Controller. When they manually click a logout button, show the login screen, and

Best practices for Storyboard login screen, handling clearing of data upon logout

不打扰是莪最后的温柔 提交于 2019-11-26 01:09:44
问题 I\'m building an iOS app using a Storyboard. The root view controller is a Tab Bar Controller. I\'m creating the login/logout process, and it\'s mostly working fine, but I\'ve got a few issues. I need to know the BEST way to set all this up. I want to accomplish the following: Show a login screen the first time the app is launched. When they login, go to the first tab of the Tab Bar Controller. Any time they launch the app after that, check if they are logged in, and skip straight to the

Passing Data between View Controllers in Swift

北慕城南 提交于 2019-11-26 00:38:42
问题 I am trying to convert an app from Objective-C to Swift but I can\'t find how to pass data between views using Swift. My Objective-C code is UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@\"Main\" bundle:nil]; AnsViewController *ansViewController; ansViewController = [storyBoard instantiateViewControllerWithIdentifier:@\"ansView\"]; ansViewController.num = theNum; [self presentViewController:ansViewController animated:YES completion:nil]; What that is doing is it basically takes

Xcode 6 Bug: Unknown class in Interface Builder file

空扰寡人 提交于 2019-11-26 00:17:37
问题 I upgraded to Xcode 6 beta 4 and now my App continuously crashes with the message Unknown class X in Interface Builder file. It crashes because supposedly Xcode can\'t find my custom classes that I have linked in my Storyboard but it shows that they are linked correctly in the Xcode interface. I\'m positive everything is linked correctly. My only other option may be to delete the entire storyboard file and start from scratch because it might be corrupted somehow. Edit: I would also like to

Programmatically set the initial view controller using Storyboards

谁都会走 提交于 2019-11-25 23:35:58
问题 How do I programmatically set the InitialViewController for a Storyboard? I want to open my storyboard to a different view depending on some condition which may vary from launch to launch. 回答1: How to without a dummy initial view controller Ensure all initial view controllers have a Storyboard ID. In the storyboard, uncheck the "Is initial View Controller" attribute from the first view controller. If you run your app at this point you'll read: Failed to instantiate the default view controller