uistoryboard

Tab bar without TabBarController - add View Controller for Tab bar item in storyboard

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 21:56:38
问题 I have added a Tab bar (not a TabViewController) to a View Controller and then added some Tab bar items to that Tab bar. Now I want to attach other View Controllers to those tab bar items in Storyboard. When I do Ctrl + Drag to View Controller from tab bar item I do not get any options. Please suggest a way to do this. 回答1: I had the same problem, but i couldn't find a way to assign to a viewController its own viewControllers as in the TabViewController case. I solved it using containers. One

IOS Segue - Terminating app due to uncaught exception 'NSGeneric Exception'

為{幸葍}努か 提交于 2019-12-07 15:50:31
Storyboard screenshot In the Xcode 4.6 Storyboard i've 2 ViewControlers, one which holds the buttons and the other a labelView, passing a string "Home Tapped" on the tap of the home button Heres the ViewController.m code #import "ViewController.h" #import "ViewController2.h" @interface ViewController () @end @implementation ViewController -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if([segue.identifier isEqualToString:@"Home"]) { NSString *message = @"Tapped on home"; ViewController2 *vc = [segue destinationViewController]; vc.labelString = message; } }

How to connect two different Tab bar icons to same view controller with storyboard?

大憨熊 提交于 2019-12-07 15:26:26
问题 I have a tab bar controller in an iPad app with 6 items. Two of the icons will when you tap at them lead to the same view controller. This view controller has a list of items it will show, it will change slightly depending on which of the tab bar icons you tapped. How do i set this up with storyboards? Its possible to drag the relationship twice to the same view controller, but then it just shows two of the same icons on the tab bar. I want the two choices to have different icons and name.

How can I set the size of a UIView init with storyboard?

∥☆過路亽.° 提交于 2019-12-07 13:51:04
问题 I am currently using iOS 6.0. I have a custom UIView that needs to have a certain size. If I programmatically init the view and add it it's fine. However, I can't find a place where I can set the size of the view in the storyboard. Setting its size in the storyboard doesn't work because the storyboard thinks it's empty and set it's size to zero. Setting its size in viewDidLoad or viewDidAppear doesn't work because later on the size will be overwritten by _applyISEngineLayoutValue . 回答1: You

How do I add a Back Button to the Navigation Bar through Storyboard?

≡放荡痞女 提交于 2019-12-07 12:46:15
问题 I'm very perplexed right now. Everywhere online I am seeing tutorials to add a custom back button, but I can't even seem to get the default one going. In my MainViewController, I have performSegueWithIdentifier(...) and then on the other end, I want the Navigation Bar to have the back button on the left. How does one achieve this? I can't seem to find any tutorials online. I've tried having a UINavigationController, and whenever I drag the "Navigation Item" in the storyboard up to the

iOS Constraints on Grid of Equal Width/Height Buttons cause positioning and size to vary

杀马特。学长 韩版系。学妹 提交于 2019-12-07 10:32:28
I'm updating my Calculator app to use new dynamically sized buttons and having a problem with the constraints. The contains should work fine as far as I can tell, but Xcode complains about misplaced views. The values it gives for the misplaced views are not proper and if I try to fix them, then it just causes more views to be "misplaced." In the screenshot below, the first multi-colored row (orange, green, pink, yellow, red) is a row of UILabels. They should all have equal widths with 0 spacing between them and the edges of the screen. They are in a container view (Xcode label is "Register

Connected IBOutlets are not initialized

眉间皱痕 提交于 2019-12-07 10:26:36
问题 I've implemented custom UICollectionViewCell class in Swift, created storyboard with UICollectionViewCotroller, assigned my custom controller class, custom cell class, cell id etc... Basically everything required to make UICollectionViewController work. In storyboard cell prototype I've added few views and connected them as IBOutlets to my custom cell class: here my IBOutlets in code (as you can see, they are connected): I registered custom cell class in my controller too: self.collectionView

How to manually set which storyboard view to show in app delegate

佐手、 提交于 2019-12-07 08:20:29
问题 I have an app that wants to log out user whenever application is inactive for a set period of time. It's multiple different views in the app, and i want the app delegate to set loginview as current view whenever this method fires: - (void)applicationDidBecomeActive:(UIApplication *)application How to manually set loginViewController as current showing view in the storyboard in this method? 回答1: UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil];

Swift add line above to control

妖精的绣舞 提交于 2019-12-07 07:44:32
问题 In the below screen, I want to add horizontal line above to "Item" label and after "Add" button (below to the add button, I have dynamic table). UIGraphicsGetCurrentContext() doesn't work here. Can someone help me how to do this? 回答1: It is simple to add a subview to act as a line. For example: Swift 4 var lineView = UIView(frame: CGRect(x: 0, y: 100, width: 320, height: 1.0)) lineView.layer.borderWidth = 1.0 lineView.layer.borderColor = UIColor.black.cgColor self.view.addSubview(lineView)

What is the relationship between Storyboard form factor & Active Scheme in Xcode using Autolayout?

柔情痞子 提交于 2019-12-07 07:25:15
问题 I have a project in Xcode 5.0.1 targeting iOS7. I'm designing the app with a Storyboard, and I'm using Autolayout. When I build and run the app, I'm using the iOS Simulator to test it. I switch between the 3.5" and 4" retina schemes to view the app on different screen sizes. For the most part, everything works fine and Autolayout seems to work great. However, on one screen, there is a problem with the layout, but only under the following conditions: I set the scheme to "iPhone Retina (4-inch)