uistoryboard

storyboard instantiateViewControllerWithIdentifier not setting IBOutlets

安稳与你 提交于 2019-11-28 07:11:55
I am using storyboard instantiateViewControllerWithIdentifier: and I'm noticing that all the IBOutlets I have wired up are still nil. However, the IBActions I have wired up work. The view and controller are linked (i.e controller.view is not nil), and if I show the view it displays what I am expecting. What am I missing? Here's my setup: I've got a View Controller defined in my storyboard. I have given it an identifier which is the same identifier I use when invoking instantiateViewControllerWithIdentifier: I've set up the view's owner by clicking on the View Controller (just under First

Drill down hierarchical data with UITableView

筅森魡賤 提交于 2019-11-28 07:02:50
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 tableviewcontrollers linked together in my storyboard because I am not sure if I will have a hierarchy of 3, 4,

Storyboards and custom container view controllers

偶尔善良 提交于 2019-11-28 06:56:03
I'm creating a custom container view as per the apple spec . I would like to use the storyboard to connect three static child UIViewControllers. Is there an easy way in the storyboard to connect via a Relationship as seen for the UINavigationController in the storyboard? Based on my research, it seems like this isn't possible. It IS possible to link a container view controller to a child. In fact, it's trivially easy to do so. You bring up the Object library, type "Container" into the search field, and look for the object "Container view". It looks like this: Drag a container view into your

Pop the current view using Segues/Storyboard on iOS 5

送分小仙女□ 提交于 2019-11-28 05:58:38
I am creating an app using iOS 5 SDK. I managed to push views using the Storyboard's Segues, but I cannot find the proper way to pop the current view and go back to the previous one. I am not using any navigationController (the app doesn't have any top or bottom bars). I don't think using modal or push segue the other way would be the solution as it instantiates a new controller. Do I have to use a custom Segue with the opposite animation and deletion of the view at the end ? Or is there a better way ? You could try calling [self dismissViewControllerAnimated:YES completion:nil]; from the

Corner radius not showing on button in storyboard with @IBDesigable/@IBInspectable

不羁岁月 提交于 2019-11-28 05:04:22
问题 I have this custom class for a button. import UIKit @IBDesignable class CustomButton: UIButton { @IBInspectable var cornerRadiusValue: CGFloat = 10.0 { didSet { setUpView() } } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.layer.cornerRadius = 10.0 } override func awakeFromNib() { setUpView() } override func prepareForInterfaceBuilder() { super.prepareForInterfaceBuilder() setUpView() } func setUpView() { self.layer.cornerRadius = 10.0 } } But the corner radius is

iOS Storyboard localizable strings do not work on UILabel subclasses

人盡茶涼 提交于 2019-11-28 04:11:50
问题 I'm using the new iOS functionnality to translate the storyboards (http://developer.apple.com/library/ios/#referencelibrary/GettingStarted/RoadMapiOS/chapters/InternationalizeYourApp/InternationalizeYourApp/InternationalizeYourApp.html) The problem with this solution, it does not work with my UILabel subclasses. Here are the codes for my UILabel subclasses : .h: #import <UIKit/UIKit.h> @interface LabelThinText : UILabel - (void)awakeFromNib; -(id)initWithFrame:(CGRect)frame; @end .m :

how to replace/customize back button image in storyboard navigationcontroller

别来无恙 提交于 2019-11-28 04:11:19
问题 I want to replace the text in the back button with a custom image. How can I do that in swift code? I don't want to replace the entire backbarbutton since I'd like to keep the default action behaviour of going back to the last view. I would also like to do a switch statement based on where the back destination(based on storyboardId) is so that I can show different images based on the view. this replaces the image but it wipes out the default back button behavior, and I need to discrimante on

iOS: present view controller programmatically

一曲冷凌霜 提交于 2019-11-28 03:57:15
I'm using the presentViewController:animated:completion: method to go to another view controller. This is my code: AddTaskViewController *add = [[AddTaskViewController alloc] init]; [self presentViewController:add animated:YES completion:nil]; This code goes to the other UIViewController but the other controller is empty. I've always been using storyboards but now I need this to be done in code. If you're using a storyboard, you probably shouldn't be using alloc and init to create a new view controller. Instead, look at your storyboard and find the segue that you want to perform; it should

xCode 6 beta 7: storyboard adds extra space on right and left sides

末鹿安然 提交于 2019-11-28 03:55:17
When i add subview to root ViewController's view, and with auto layout setup leadingSpace,trailingSpace,topSpace and bottomSpace to zero, there are appear some extra spaces on left and right sides (so if i print subview's frame it's origin will be 16 and size less on 32 than should be). So actually we get that leading and trailing spaces are not zeros... As you can see on picture leading space - zero, but origin.x = 16 Earlier i wasn't working hard with auto layout, so my question is: Is it a bug of new xCode or a feature? P.S. All frames and constraints updated. iOS 8 adds the concept of

How to set the UITableView Section title programmatically (iPhone/iPad)?

有些话、适合烂在心里 提交于 2019-11-28 03:10:40
I've created a UITableView in Interface Builder using storyboards . The UITableView is setup with static cells and a number of different sections. The issue I'm having is that I'm trying to setup my app in several different languages. To do this I need to be able to change the UITableView section titles somehow. Please can someone help me out? Ideally I'd like to approach the issue using IBOutlets however I suspect this isn't even possible in this case. Any advice and suggestions would be really appreciated. Thanks in advance. Once you have connected your UITableView delegate and datasource to