xcode-storyboard

how to set view controller programmatically for subview in storyboard?

旧时模样 提交于 2019-12-08 08:10:24
问题 (Designed in storyboard , screenshot below) I have two subviews on my rootviewcontroller's view In my code i want to assign a separate view controller to each subview. i.e Assign a tableViewController to the TableView. I tried to do this in awakeFromNib (or ViewDidLoad) method but to no avail. The delegate method in my tableview controller are never called. I think storyboard does the job of loading the subviews here even before the tableviewcontroller i assign can do something. self

iOS do the button's action before prepareSegue

自作多情 提交于 2019-12-08 05:52:29
问题 Basically, I have a button that when you press it, it runs its action methond (changes a field in my Data class) and segues into another view which displays the field. After some debugging I realized that prepareSegue, and perhaps other related methods run before my button's action, and thus display the old field value instead of the new. Is there anyway around this. I was thinking maybe instead of segueing on the button press, I would create a segue to my first scene and segue to it at the

Tab bar item icons appear darker

扶醉桌前 提交于 2019-12-07 19:47:59
问题 When setting the icons for the tab bar items it seems that the icons are appearing darker for some reason. Examples below Tab bar in app What it should be like from designs As you can see in the second example the colours are softer and lighter compared to the ones above i can't seem to figure out why because even in my image.xcassets the icons look like the ones in the design and in my setting in the identity inspector shown below there doesn't seem to be any settings for tints. Storyboard

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

Storyboard warning : First baseline layout attribute before iOS 8.0

拥有回忆 提交于 2019-12-07 07:51:32
问题 I can't figure out how to get rid of this warning, I'm using a storyboard with many viewControllers (with labels, textfields and a lot of constraints ) all of them have been created almost the same way. When I click on the warning it highlights a UILabel inside a scrollView : This scrollView has many UILabels with constraints, I tried everything I could find on so including : Attribute Unavailable: First baseline layout attribute on iOS versions prior to 8.0 This Warning doesn't cause my app

UIScrollView child jumping after UINavigationController push and pop

Deadly 提交于 2019-12-07 06:10:45
问题 So I have a UIScrollView on my iPad app with a single child view (which itself is parent to all the controls). The scrolling all works fine on it. Rotating works fine (the whole view fits in portrait, scrolls on landscape). Once pushing a new screen on the UINavigationController , and then coming back breaks it. It looks as if the frame of the scrollview's child has moved up, relative to the scroll position, but the scrollview has remained at the bottom (the entire child view has shifted

Xcode storyboard issue with auto layout not allowing me to move an objects origin.y value

倾然丶 夕夏残阳落幕 提交于 2019-12-06 13:35:21
问题 In my storyboard I have just implemented size classes which added perfect constraints to my elements but when trying to modify where the elements y position is located to move it up on the keyboard show event so that it appears attached to the keyboard like this, the elements don't move at all because of the constraints. I have tried removing the constraints, which did not help. From what I've read my understanding of it is if there are no constraints, there are some generated when the app is

Polymorphism in Storyboard ViewControllers

瘦欲@ 提交于 2019-12-06 11:12:14
I am wondering how can I implement polymorphism in the iPhone XCode storyboard ViewControllers. This is my problem: Two different ViewControllers in my application are segueing to a common ViewController. This common ViewController is behaving differently depending on the VC it was segued from - different remote API server calls and CoreData fetches are performed (for the first it presents all users in a table, for another it presents a list of admins - subclass of users, and I may have a third one that will presents filtered list of users). This common ViewController is very centric in my

What is the quickest way to clean up all warnings in all XIB / Storyboard files In Xcode 7

会有一股神秘感。 提交于 2019-12-06 05:36:09
In Xcode, whenever I see warnings (usually about misplaced elements) appear in the XIB / Storyboard, I have to: Select the container (Usually the containing view controller or the top most view) From the Xcode menu select Editor -> Resolve Auto Layout Issues -> All views in <container name> -> Appropriate action ( For instance: Update frames ) to resolve the issues. The above method takes requires steps and a bit time consuming to me. It would be great if I could: - Resolve all warnings for ALL view controllers in a storyboard/XIB file - Even better resolve ALL warnings of all storyboard/XIB

How to use custom Navigationcontroller in AppDelegate by using a Storyboard

心不动则不痛 提交于 2019-12-06 03:31:34
问题 I've got a problem concerning Navigationcontroller in AppDelegate. I'm using a storyboard, which looks like this: As a result of using Push notifications, i've got the following function in my AppDelegate File: - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { //... } When the notification arrives I want to initialize the "Detail View" - Controller which needs an ID as a parameter. This ID is part of my payload so it is present in