storyboard

iOS add a CollectionView to a another view within the storyboard UI builder

限于喜欢 提交于 2019-12-11 04:59:38
问题 Just getting started with iOS, and trying to make the collection view on the right be a child view of the view on the left. I cant seem to drag it in. I think part of the problem is that on the left hand part of the nav (immediate left of the work area) the collection view is being called a scene. To create the view into which I want to put the collection view, I just dragged a new view controller into the work area, then did the control+click to add it to the main tab view. I am going to

Autolayout resize UIButton with text and then the container view

微笑、不失礼 提交于 2019-12-11 04:44:30
问题 I am loading a view with buttons from a xib file. The button (green) has localized variable text. I need the UIButton to be resized dynamically with the text and then the container view (red) should be resized to the button size, so that container view does not have extra space. Since the whole container view should be horizontally middle in a view with a clear background and the text should not look like aligned in left or right. I have added background color to mark clearly :) Is it

IBOutlet to two viewControllers on two storyboards… is that possible

穿精又带淫゛_ 提交于 2019-12-11 04:05:58
问题 I have an app with two targets, for iPhone and for iPad. This project is not using size classes. On the iPhone version I have a storyboard that contains a viewController called “termsAndConditions”. This viewController has class files termsAndConditions.h and .m. Inside termsAndConditions.m I have an outlet linked to a textView on the viewController. Then I have the second target for iPad. I have the same viewController there called “termsAndConditions”. My idea was to use the same class

Passing data between the Tabs of a TabBarViewController

一笑奈何 提交于 2019-12-11 03:46:09
问题 I have a UITabBarController based application and I want to pass data from one view to another. I am doing this in storyboard and I am just doing some testing, before bringing it into the main application. I am just trying this with a NSString at the moment. I am able to pass data to the VC in question when I use a modal transition using this code: NSString *sendingString = @"This string has some content"; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle

iOS: programmatically see view controllers in navigation stack if not using a UINavigationController?

喜欢而已 提交于 2019-12-11 03:18:32
问题 Is it possible to see which view controllers are in the navigation stack? New to Swift and iOS and just want to make sure navigation is happening properly and view controllers aren't stacking up inadvertently. To clarify, it seems like you can use the viewControllers property in a UINavigationController , but for learning purposes , we're not using a navigation controller and doing the navigation manually through exit segues. Can you programmatically print out the view controller hierarchy if

-[UIView setShowsFPS:]: unrecognized selector error

坚强是说给别人听的谎言 提交于 2019-12-11 03:04:24
问题 I need to open a ViewController when a UIButton was press , for doing that I use the following code : NSString * storyboardName = @"Main"; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil]; UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"ViewController"]; [self presentViewController:vc animated:YES completion:nil]; when it take the final line [self presentViewController:vc animated:YES completion:nil]; it give me the

How to pop back to root view from a 2nd view?

可紊 提交于 2019-12-11 03:04:17
问题 I have connected 3 views (root, 1st, 2nd) together using 2 modal segues in apple watch storyboard. 1) In root view: Once the "save" button is pressed, 1st modal view will be displayed 2) In 1st modal view: Once the "500" button is pressed, 2nd modal view will be displayed. (I can press cancel button to pop back to root view) 3) In 2nd modal view: Once the "saved" button is pressed, I want to go back to root view. How to do this? --> I don't want to press cancel button twice to go back to the

iOS Container with multiple views

↘锁芯ラ 提交于 2019-12-11 03:00:02
问题 I am trying to create a View that has a container in it. On that View, I want to switch between a table view and a map view. Yelp's app does exactly what I'm looking to do. The problem I'm running into is switching between the views. Here is how my storyboard is set up: I created a controller that is used to switch between the table and the map. The problem is if I use a modal or custom segue, it takes over the whole view. I've tried embedding them in a navigation controller which does work

Adding UIImage ignores and resizes UIImageView frame

前提是你 提交于 2019-12-11 02:33:41
问题 I'm currently trying to add an image into the navigation item for one view. In the view's viewDidLoad() , a function is called with the following code, similar to this post: let logo = UIImage(named: "Menu_Logo") let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 122, height: 26)) imageView.contentMode = .scaleAspectFit imageView.clipsToBounds = true imageView.image = logo self.navigationItem.titleView = imageView Instead of giving me the expected size however, the view ends up

Receiver has no segue with identifier“***”

蓝咒 提交于 2019-12-11 02:32:54
问题 I encounter this problem for the first time. I checked similar problems on stack overflow, but none of the solutions can solve my issue so I have this posting. Up to the present, I have two view controllers (let's say A and B) and I am trying to connect them with a segue with name "toB". When I run the program, Xcode told me Receiver(B) has no segue with identifier "toB" . I am pretty sure that the spellings of the identifier in the storyboard and in the code are exactly the same. And the