xcode-storyboard

Change Container View Content with Tabs in iOS

点点圈 提交于 2019-12-02 15:58:40
I'm trying to make a form that spans three tabs. You can see in the screenshot below where the tabs will be. When the user taps a tab, the Container View should update and show a particular view controller I have. Tab 1 = View Controller 1 Tab 2 = View Controller 2 Tab 3 = View Controller 3 The view controller shown above has the class PPAddEntryViewController.m. I created an outlet for the Container view within this class and now have a Container View property: @property (weak, nonatomic) IBOutlet UIView *container; I also have my IBActions for my tabs ready: - (IBAction)tab1:(id)sender { //.

Link a button in a XIB to a viewcontroller in a Storboard

拟墨画扇 提交于 2019-12-02 15:21:17
问题 I have a XIB viewcontroller with a button in it. I also have a storboard viewcontroller. I would like to know if there is a way to link a button from the xib view controller to the storyboard viewcontroller. 回答1: Short answer: No, not using interface builder. You can do it in code though. Once you have the two view controllers instantiated just set the relevant property on your storyboard view controller. 来源: https://stackoverflow.com/questions/22738179/link-a-button-in-a-xib-to-a

Link a button in a XIB to a viewcontroller in a Storboard

流过昼夜 提交于 2019-12-02 10:49:24
I have a XIB viewcontroller with a button in it. I also have a storboard viewcontroller. I would like to know if there is a way to link a button from the xib view controller to the storyboard viewcontroller. Short answer: No, not using interface builder. You can do it in code though. Once you have the two view controllers instantiated just set the relevant property on your storyboard view controller. 来源: https://stackoverflow.com/questions/22738179/link-a-button-in-a-xib-to-a-viewcontroller-in-a-storboard

Cannot change Main.storyboard's name on iOS 13 [Xcode 11 GM seed 2]

假如想象 提交于 2019-12-02 06:07:55
问题 On iOS 13 simulator with Xcode 11 GM seed 2, the app crashes after Main.storyboard 's name changed (Info.plist changed also). Setting option Main Interface to empty cause the same problem. The iOS 13 system always try to find the Main.storyboard , and failed with crashing message: *** reason: 'Could not find a storyboard named 'Main' in bundle Everything is fine on iOS 12 and earlier versions. It looks like a bug in iOS 13. Does anyone meet same problem? And any solutions? 回答1: Swift 5 with

Prevent Interface Builder from auto creating Constraints?

我们两清 提交于 2019-12-01 16:21:11
I created a demo project here . I have a view where I created a ScrollView in a .xib file. In interface builder I did not set any constraints. In my viewDidLoad method I set constraints with SnapKit : scrollView.snp_makeConstraints { (make) -> Void in make.edges.equalTo(self.view) } When I run the code I get the following console output: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted

Use Storyboard References While Retaining Icons & Text for Tab Bar Controller

徘徊边缘 提交于 2019-12-01 15:26:05
I started refactoring one of my projects to make the code easier to manage and the Tab Bar Controller lost its icons for which tab represents what. Without this I'm a bit lost which tab is what for re-ordering purposes. How do I get the icons to show up again for a tab bar controller when I'm using storyboard references? Refer to my attached image. Notice how the first 3 tabs are 'blank' but the other tabs that I have not refactored yet show with the icons and titles. For those unfamiliar with storyboard references I was following the tutorial here: http://code.tutsplus.com/tutorials/ios-9

Trying to reload view controller to update the current theme

北战南征 提交于 2019-12-01 09:26:22
问题 What I am looking for I am trying to reload all the views in my view controller, to change between themes (similar to what Twitter or Apple Maps does). How I have setup my different themes I have themed views setup like so: @IBDesignable extension UIView { @IBInspectable var lightBackgroundColor: UIColor? { set { switch GEUserSettings.theme { case .light: backgroundColor = newValue case .dark: break } } get { return self.lightBackgroundColor } } @IBInspectable var darkBackgroundColor: UIColor

Xcode - Storyboard views size and position modified when opening

馋奶兔 提交于 2019-12-01 03:02:20
I noticed something very annoying with Xcode: I have some storyboards for which certain views size & position are systematically updated when I open them. This is annoying especially when working with a team. Here how I produce this behavior: I pull the app from a git repository Open an affected storyboard doing no modification at all git diff already tells me differences like $ git diff ... - <rect key="frame" x="576.99999828648401" y="11" width="170" height="20"/> + <rect key="frame" x="577" y="11" width="170" height="20"/> ... - <rect key="frame" x="518.99999921768904" y="7" width="228"

Can you add IBDesignable properties to UIView using categories/extensions?

跟風遠走 提交于 2019-12-01 02:25:30
For those that don't know what I'm talking about, Xcode 6.0 added new features, IBDesignable and IBInspectable. When you tag your custom views with IBInspectable properties, those properties show up in the Attributes Inspector in IB. Likewise, when you tag a custom UIView subclass with IBDesignable, Xcode compiles your views and invokes the code to render your view objects right in the Xcode window so you can see what they look like. The technique for adding IBDesignable and IBInspectable attributes to custom views is pretty much identical in Swift and Objective-C. IBInspectable properties

Xcode - Storyboard views size and position modified when opening

谁说胖子不能爱 提交于 2019-11-30 23:47:52
问题 I noticed something very annoying with Xcode: I have some storyboards for which certain views size & position are systematically updated when I open them. This is annoying especially when working with a team. Here how I produce this behavior: I pull the app from a git repository Open an affected storyboard doing no modification at all git diff already tells me differences like $ git diff ... - <rect key="frame" x="576.99999828648401" y="11" width="170" height="20"/> + <rect key="frame" x="577