Is there a possible way to hide some views in Interface Builder? I don't mean to hide it when the app launches, but to hide it just in Interface Builder to be easy for me to see other views.
Actually I want to do that because my xib file has a lot of views and it is hard to see !
Admdrew,
Unfortunately there is no way you can do that in storyboard. The only thing you can do to view the Views which is overlapped by others, is drag it to the top.
For example, I drag PickerView to the red line to make it to the top, then edit PickerView, and drag it back to the previous position when finish: https://www.dropbox.com/s/e18nmr9mya9y0s8/DizSfOW_3F3a_wV4YVXgFk__h0PoFWbd3rs1HbcTN-4.png
I prefer to use many View Controllers, it's better for your performance. But I must say that in some cases, you still have to use many UIView place on top of others, and I think this is the best way to edit each View.
Cheers,
UPDATE AUGUST 17, 2015
Since XCODE 6.x already added in the feature called "Installed" in the right panel, so now you can easily disable the upper view for temporary by uncheck "Installed", then do-whatever-you-are-planning-to-do with the lower view. Just remember to return it to be checked after you finish.
Step by step following this:
1. Click to select the upper view.
2. On the right panel, look for "Installed".
3. Click to uncheck it.
That's it!
Cheers!
You'd use the Hidden property in the Attributes Inspector. But I'm not sure is this is what you'd like to achieve.
By doing that you'd need to set the attribute to Hidden = NO before running your app.
I think that using groups of views could be also a better way to handle lot of views in the same xib files. You could do that Editor -> Embed In -> View. Selecting all related views and making groups could help you to work with them easily by hiding or moving some groups.
Related
though the elements show, they don't show in the proper location
When I put UI elements in to the storyboard on this app that I'm working on they do not show up in the right location. I can edit them, move them, manipulate them... but all of it shows up lower than where they are actually located. then on this second viewcontroller that I have created, the header from the first viewcontroller is now showing up over there.
Not really sure if there is a way that I can reset the storyboards or get this to clean up at all.
thanks.
delete all your constraints first from the left hand side of the story board.
run the app and see how it looks
now, set contraints for each widget one by one properly and give it a try
The two buttons were in a stack view with constraints that were throwing them off. Once I removed the stack view and laid out the buttons without the extra view they worked perfectly.
I am creating a quiz app and for the buttons I need an outlet collection. So far in the array, I only have one button but I want to add the other three. On the other tutorial I've watched, it says to click the button on the side and drag to the thing you want to add (image link below). This doesn't work for me, is there a certain way you need to click? I've done this before, but this time its not working. The difference this time is that I've created a new class. I am not very familiar with Xcode or swift, sorry. Thank you.
Xcode is really buggy as far as outlet connections are concerned. Emptying the Derived Data folder as well as clean / rebuild help. But results could still be problematic. However, the old way to connect things which has been around since before the existence of an Assistant editor still works reliably. Select the ViewController and drag from ITS outlets in the Connection editor to the storyboard items (i.e. buttons).
Use Interface Builder alone. Use the Identity inspector to make sure your view controller has the correct class, the class where you put your outlet collection property. Now use the Connections inspector for your view controller. You'll see the outlet collection listed there; drag from it to your buttons, one by one.
So i have a problem that i know how to solve but not in ann efficient/fast way. Look at this example that i have right now:
So I had made all the outlets before I decided that I need a background image. You can see that I marked them but they are under the UIImage. I can solve this by first removing the image and dragging all the views to another view controller then adding the UIImage and putting the views back on the ImageView but this is time consuming as I have other view controllers. Is there another way to move views up/down?
Think of the views as being listed in the order they are placed on top of others. You start at the top of the list, adding views, and then add the ones next on the list on top, one a time. That's how I remember the ordering.
As Luk2302 says, you can simply drag your views around inside your storyboard to change their order.
Note that there is also an "arrange" sub-menu in the editor menu for IB. You could select your background image, then pick editor>arrange>send to back to move the background view to the back of the stack of views.
P.S.: Don't call them outlets. They are views. Views can be linked to your code using IBOutlets, but they don't have to be. Plus other non-view objects like constraints can also be linked to your code with IBOutlets
Its simple.what you have to do is simply drag you imageview to the top of the view(then it becomes the first IBOutlet you added). I have added some images, then it will easy to understand.
this is your situation
this is the solution(drag it to the top of the view)
then your other IBOutlets come to the front like this
I am new to iOS and have recently finished some classes.
Now, I'm onto my first app with Swift. I wanted to know:
Is it necessary to define all views/screens in the storyboard right in
the beginning, with proper navigation controllers?
What is better, define all in the beginning or keep adding as need
arises in the future?
Keep adding as needed.
You'll always be finding or coming up with new features, and at times you'll need to insert view controllers between other view controllers (adding an extra step, for example).
Within view controllers, you'll also find the need to put items into containers. That's where clicking the item/s (selecting them), and going to the menu, selecting "Editor" and then "Embed In" comes in really handy. For example, you may want to put a series of items into a scrollview after you've already laid them out properly, because they don't display properly on an iPhone (and you had done all of your testing in Simulator on an iPad first).
No it's not, you can create all views programmatically without using a storyboard at all. Its's just your choice what works better for you.
First of all, you can use storyboards for your UI (and navigation), use .xibs (only UI) or create everything programmatically. Each of these has its pros and cons. Also you can mix and match all these. For example have a storyboard, some views with .xibs and some views created programmatically all in the same project. You just have to choose what fits best your needs.
You don't have to create everything in the storyboard right in the beginning. Create only the views you need to start coding and then add more views as you progress your app development.
This is a "sort-of" question, that I am just hoping some astute individual can give me some guidance on.
I have an iOS project that has numerous screens (ViewControllers) that all share a top and bottom bar (an UIImageView with a button on each). I am using a storyboard because I want to be able to easily visualize the entire graph of screens.
Is there any way in Xcode 4.5 to make a sort of UI Template, or somehow subclass the "view" in IB so that whenever I make a new screen (VC) it inherits the top and bottom bars and the associated functionality?
I was hoping if I created a UIViewController subclass, put an IBOutlet for each ImageView and Button into it, and the associated IBAction for the two buttons, then subclassed it when making my VCs I would be able to link it all up, allowing me to only have to duplicate the visual elements on each screen. But alas, when I do that I get "not KVC-compliant" errors on the subclass (when linking it to the existing outlet and actions).
The other thought I had was to programmatically add the visual elements from a superclass, but then, for me, the problem is in IB I have to remember to account for the missing space at the top and bottom, which I will have to live with if that turns out to be the only option...
Is there some way to do this that I am not seeing or do I really have to code this all over and over for each screen?
Any insight/input/ideas greatly appreciated.