uistoryboard

Drill down hierarchical data with UITableView

半腔热情 提交于 2019-12-17 18:27:17
问题 I want to build an app to navigate a data hierarchy. The structure of this hierarchy is something like the one I'm showing in the following image. A branch of the structure could have more levels than the others. I would like to drill-down this structure with TableViews like this: A > AA > AAB > AABA or A > AB > ABA What I would like to know is if I can have only one TableViewController in my storyboard and reuse it to display each new level of data? I don't want to have a bunch of

Passing variables between view controllers

混江龙づ霸主 提交于 2019-12-17 10:59:32
问题 I am using this function to switch between views in Xcode 4.3. [self performSegueWithIdentifier:@"NextView" sender:self]; I would like to pass some parameters between pages. How can I do that? 回答1: After performSegueWithIdentifier:sender: your view controler will call - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender assuming your new view controller has some propertys to set: if ([[segue identifier] isEqualToString:@"NextView"]) { MyViewController *myVC = [segue

How to localize an iOS storyboard

泪湿孤枕 提交于 2019-12-17 10:12:03
问题 I've an iPhone storyboard with some views. For instance, a navigation item title is named News , which should be translated for other languages. When I add a new localization to my storyboard, it created a duplicate of my current storyboard for the new language. Here I can change the title for the navigation item, but for me it does not seem very useful. What if my storyboard contains 100 views and I need to support 10 languages? If I need to change something in my original storyboard, I have

Storyboard segues causing memory leaks

狂风中的少年 提交于 2019-12-17 09:42:46
问题 I have two UIViewControllers with buttons triggering segue (modal) to each other. I wanted to discover if that's causing any memory leaks while jumping back and forth and I see that Living Object && allocated memory is going up, what eventually would leave to app crash. I don't have any single line of code - working with pure UIViewControllers. What I might be doing wrong? Could have I set something wrong in project settings? Am I reading profiler's statictics badly? Do I need to make any

How to Dismiss a Storyboard Popover

有些话、适合烂在心里 提交于 2019-12-17 08:10:37
问题 I've created a popover from a UIBarButtonItem using Xcode Storyboards (so there's no code) like this: Presenting the popover works just fine. However, I can't get the popover to disappear when I tap the UIBarButtonItem that made it appear. When the button is pressed (first time) the popover appears. When the button is pressed again (second time) the same popover appears on top of it, so now I have two popovers (or more if I continuer pressing the button). According to the iOS Human Interface

How to switch to different Storyboard for iPhone 5?

安稳与你 提交于 2019-12-17 06:24:42
问题 Just as an app utilizes different storyboards for iPad and iPhone, I would like my app to use a different storyboard for the iPhone 5. Since there is no option in the Info.plist to select default storyboard for iPhone 5, how would I programmatically call the storyboard? I do not want to use AutoLayout for this app unless it is absolutely the last resort. I understand how to detect if a user is using an iPhone 5 or other device with the same screen size. I just need to know how to set the

Reuse a uiview xib in storyboard

孤街浪徒 提交于 2019-12-17 06:22:39
问题 I typically like to create and design my uiviews in interface builder. Sometimes I need to create a single view in a xib that can be reused in multiple view controllers in a storyboard. 回答1: Reuse and render a xib in a storyboard. Tested with Swift 2.2 & Xcode 7.3.1 1 ---- Create a new UIView named 'DesignableXibView' File > New > File > Source > Cocoa Touch Class > UIView 2 ---- Create a matching xib file named 'DesignableXibView' File > New > File > User Interface > View 3 ---- Set the file

Reuse a uiview xib in storyboard

依然范特西╮ 提交于 2019-12-17 06:21:38
问题 I typically like to create and design my uiviews in interface builder. Sometimes I need to create a single view in a xib that can be reused in multiple view controllers in a storyboard. 回答1: Reuse and render a xib in a storyboard. Tested with Swift 2.2 & Xcode 7.3.1 1 ---- Create a new UIView named 'DesignableXibView' File > New > File > Source > Cocoa Touch Class > UIView 2 ---- Create a matching xib file named 'DesignableXibView' File > New > File > User Interface > View 3 ---- Set the file

Perform Segue on ViewDidLoad

旧城冷巷雨未停 提交于 2019-12-17 03:02:59
问题 In iOS 5 I have a Storyboard with a modal view controller, that I would like to display if its the user's first time in the app, after that I would like to skip this view controller. I set an NSDefault key to handle this but when I check to see if this is set and then use performSegueWithIdentifier to initiate the segue, nothing happens. If i put this segue behind a button it works fine... 回答1: I answered a similar question where the developer wanted to show a login screen at the start. I put

How to implement tab bar controller with navigation controller in right way

雨燕双飞 提交于 2019-12-17 02:42:50
问题 I am using Storyboard and Xcode 6. I have next controllers and scenes in my Storyboard: UINavigationController that has HomeViewController as a root. HomeViewController has a button that Show (e.g. Push) UITabBarController . UITabBarController has 4 UIViewControllers . But my problem that after I Show UITabBarController there are no Navigation Bars in 4 UIViewControllers . But I supposed that if I Show (e.g. Push) UITabBarController then it should has embedded navigation controller that is