Will we get frequent conflicts when using storyboard? - ios

I think using storyboard will save us a lot of work sometimes. But when more than one mates working on the same storyboard. Is it possible that conflicts occurs frequently? When using .xib I and my workmates will have conflicts when we are working on the same .xib. So how about the storyboard? BTW:Don't tell me to use more than one storyboard. I think I prefer xib than storyboard if I need to use more than one storyboard.

If you have one big storyboard for your app, and several developers on your team will need to make changes in the storyboard, you will probably get conflicts.
If you're using xibs, you can put unrelated views in separate xibs. Then when developer A needs to change something in view 1, he just changes the xib containing view 1. And at the same time, if developer B changes something in view 2, he changes the xib containing view 2, which is probably separate from the xib containing view 1. So you don't get a conflict.
If you're using a storyboard, all the views are in one file. So developer A changes the storyboard to modify view 1, and at the same time developer B changes the storyboard to modify view 2. Boom, you get a conflict.
If your team has multiple developers working on the app user interface, you are much more likely to get conflicts if you use storyboards than if you use (carefully-separated) xibs. This is a serious problem with storyboards.
However, you can't create a table view controller with static content in a xib. You can only do that in a storyboard. So sometimes it's worthwhile to create a storyboard containing just one table view controller, in a project that uses xibs for everything else.

Related

Multiple developer work one storyboard in iOS

Multiple developers are working on one project using Git. However, multiple developers are not working at the same time on the same storyboard.
Currently we found out one solution :
Create a storyboard particular to a UIViewController like xib.
If this is not right way then suggest me which way is best?
Memory leak accord when i use multiple storyboard for separate VC?
It really depends on how complex your views/storyboards are.
You could have 1 storyboard, which has multiple UIViewControllers, and multiple folks can work on different view controllers, with low chance of conflicts. You could have one storyboard for each view controller, but IMO you don't have to. Our project sometimes have almost ten UIViewControllers in one storyboard, and things are fine.
My two cents here is that, use one storyboard to include multiple view controllers that are relevant in a same workflow (like Sunny said), and use xib for those small pieces that are repeatedly used in various places across the app. So for a complete app, you might end up with a few storyboards and each in turn has multiple related view controllers, plus some xibs if needed.
Split up the Storyboard into several Storyboards. You can extract subviews into container views. Then you extract these into their own storyboards -> Editor -> Refactor to Storyboard.

Delete View References from View Controllers Swift iOS app

How to automatically remove all references in an iOS Swift app(developed using XCode) from ViewControllers when deleting the View in a storyboard?
I think there's not an automatic way to remove the reference within your code. Anyway, you can use the Connections inspector to see all the outlets and actions referring to your view and you can unlink them before actually removing the view from the storyboard. The rest is kind of code maintenance that I usually do by hand.

How to see a particular view clearly amongst lots of overlapping UIViews

When a view controller (VC) has hordes of views and subviews it becomes very difficult to modify a subview because I can't even see it completely (it is hidden behind some other subview). For example please have a look at current state of one of my VC:
I can't see highlighted "Congratulations - UILabel" or its UIView.
Is there a way I can see a specific view clearly (may be at the top of all the other views)?
Generally I drag drop a UIView on a different dummy blank VC, design view completely on that VC with all constraints and finally drag drop it back to my actual VC. This works most of the times but it seems like an inefficient approach to me.
I've observed that seeing overlapping views used to be easier in iOS6 but it is Very difficult in iOS7. Is there any feature in iOS7 Interface Builder that I am missing? Thanks for your precious time.
Update: Would Spark Inspector help me here? I am newbie to development so don't want to waste my time trying and understanding new plugin if it doesn't help me achieve what I want. Thanks.
This is widely considered one of the weak points of Xcode's new Storyboards feature. They're great for apps that require a large number of simple controllers, but they become difficult to work with when your interfaces get complicated. Most experienced developers use Storyboards in some places and individual controller XIBs in others, depending on what they're building.
Here's how to solve your problem:
Step 1. Break the View Controller out of your Storyboard into it's own XIB
From the File menu, choose New File and choose an Empty XIB file (from the User Interface section). Name it "YourExactVCClassName.xib".
Go to your Storyboard. Copy the entire View of your View Controller and then delete it.
Paste the View Controller into your new XIB. Change the class of "File's Owner" to be your View Controller, and set it's "view" property by drawing an outlet from the view to File's Owner.
When your app runs, it will try to instantiate the view controller
from your storyboard. When it realizes there's no view in the
storyboard for that controller, it will automatically find the file
MyViewController.xib and load it from there.
Step 2. Organize the contents of your main view into detached views that make sense.
In your example above, it looks like you have different views for different states of the game (game over, high score, etc.) Take each of those and remove them from the main view. With your controller in it's own XIB file, you can just drag the view out in to the whitespace around your controller. Each view you drag out becomes a top level object in the XIB file that you can design and see easily.
You're no longer stuck with an iPhone-5-sized workspace.
Create IBOutlets for each of your detached, top level views so you can reference them in your controller.
In viewDidLoad, programmatically add each of the separate views to your main view. Note that you may want to set their frames, make some of them invisible, etc. You have to write more code, but it's generally worth it for an easily maintainable XIB.

Do I need multiple view controllers for the iPhone & iPad storyboards?

I'm still relatively unfamiliar with all the new features of iOS 5, and what I can do in Xcode now. So, a good explanation would be appreciated.
I'm designed a single-view application and I have both an iPhone and iPad storyboard. I chose 'Single View Application' when I first started, so Xcode created a ViewController for me. Both storyboards list this view controller as their own.
Back in iOS 4 the way that I linked button actions to my view controller was to Right-Click on the button on the nib, pick the action that I wanted, then drag it over into the view controller's '.h' file, which auto-created a method/property for me.
I am confused about how to accomplish this now, since I have multiple storyboards but only one view controller. Do I need to have multiple links for each button; one for the button on the iPhone and one for the iPad? Or is there a better way to accomplish what I am trying to do now?
You do it the same way you did it in iOS4. But obviously you never built an universal app there ;-)
It's totally okay to have a single UIViewController class for two different nib files.
And if you use storyboards it's fine to use different storyboards and a single viewController too.
You can even use the same viewController for different scenes inside a single storyboard.
The connections to the viewController are saved in the nib or storyboard. So you can't overwrite them while designing the other user interface.
Open the iPhone storyboard, make your connections to actions and outlets. Then open the iPad storyboard and make totally independent connections.
In response to the first reply, I was under the impression that a view controller could only support two scenes in a storyboard layout. I say that because I found this thread.

Using Storyboard how to interact with viewcontroller objects

I've reviewed many websites and youtube videos that have IOS 5 storyboarding information. Most of them are pretty basic and only describe how to get started with storyboarding and how to segue into other views. I'm interested in taking it a step further and actually adding custom code to the views contained within the storyboard.
Is the "normal" workflow when creating an IOS app using storyboard?
Create the layout of an app using storyboard (adding views and objects to those views).
Create viewcontroller files (.h and .m), one for each view contained within the storyboard.
Hook up the scenes from the storyboard with your own view controller subclasses by editing the "class" values in Identity Inspector.
I believe I followed those steps, but when I implemented step #3 above and ran my application, I was only able to see a black screen. The view I had created in storyboard wouldn't display.
You have the right steps. Make sure you create your .m and .h without a xib. Post your code for the view controller for your first view to get more help.
yes, this is the normal workflow. have you set the "initial viewcontroller? ?
see this image: http://dl.dropbox.com/u/31437518/Screen%20Shot%202012-01-24%20at%2012.29.34%20AM.png
It sounds like you made a storyboard file but it isn't being loaded.
Do you have the main storyboard setting in the target summary screen filled in?

Resources