ImageView Keeps coming to the front - ios

I am working on an app using Xcode. When I am in the editing menu everything looks fine I am able to see the textfields and buttons however when I run the app on the simulator the image I have for the background comes to the front and hides everything else. Is there anyway to fix the background to the back and make it never come forward?
If you post any code could you please do it using SWIFT

In Interface Builder check the left sidebar and you will see the view hierarchy.
Just add your view as normal, then drag it up the view hierarchy to the top of the list in 'View' and it will be at the bottom of the stack.
Alternatively, Select the view in the Interface Builder, and then do Editor -> Arrange -> Send to Back

Related

Tabs and webView

It will become clear as you read that I have very little experience programming please excuse me for an elementary question. I have on the storyboard the template for a tab based app. which has two view controllers both of which have a web view on them and both seem to be working fine. As I needed a third tab I dragged a view controller onto the storyboard and linked it to the tab bar controller, I also created a "thirdViewContoller.swift" file which was copied from one of the other two which was in the template. Ran the app and everything works fine. I now drag a UiWebView onto the third view controller and unlike the other two when I try to control drag the webView to the code it will not link up. What am I missing. Many thanks for any help.
Did you check that your thirdViewController class is set in the storyboard? Click the yellow circle on your third view controller that you added in the storyboard. Go to the Identity inspector tab. Make sure the "Custom class:" field is set to thirdViewController. Now you should be able to make an IBOutlet for your web view by control dragging.

Creating an animated slide-down menu using Autolayout

I'm trying to upgrade my app to use Autolayout, basically to be future-proof, but I'm running into a huge amount of problems TRYING to use autolayout.
What I have is a view controller which contains two UINavigationControllers (using view controller containment). If I press a button, I want the menu to come down. Within the menu, i'll push view controllers and whatever else, and if the user wants to quickly get out of the menu they can tap the bottom part of the view at the bottom. Basically, if you've used Uber, something similar to that.
I have fiddled and fiddled but I can't get it to work correctly. The best I got was set up a XIB for the container view, and have two views within it (as well as a few outlets for some constraints). Within code, I change the constants of these constraints to make the menu view move and to force the correct height of the menu (which is the same as the bottom minus an offset).
The problem comes in when I try to push another view controller in the menu as it seems to throw away the height constraint set on the menu -- new view controllers take up the entire screen. I don't want to use clipSubviews because that doesn't really solve the problem, and sometimes I use overlays which need to go outside of the view.
To be honest, I don't even really care that much if this animation even uses autolayout, but I want to be able to use it on the view controllers within each navigation controller. Right now, if I turn it on, the animation won't work at all.
Any ideas?

UI keyboard not appearing when UI textfield tapped after model to a different view controller

Ok. So I have been testing out a simple application on xcode to become familiar with the platform, but I've come across an interesting situation. Using storyboard, I've dragged two view controllers that are connected by buttons by segues. They both have a uitextfield dragged on them that respond on click when they are the initial view. However, when I move to another viewcontroller from the buttoned segue, the keyboards no longer automatically popup. Is this a problem with apple's uitextfield? (ps. there is no code to this as I thought this would simply be automatic responding)
Look to see if the view hierarchy has become messed up. You can easily see this in the 'document outline.'
If you don't see this pane, look on the left, bottom side of the storyboard and click the small arrow pointing to the left.
What do you see here? Is the Text Field an immediate child of the View or of something else? If it's an immediate child, do you see other children of View listed here that you don't recognize?

How to re-order segues in initial view's tabbar controller in xcode 4.5?

How do I reorder the initial view's tabbar controller elements without having to delete all the segues and re connect them manually in the desired order? Is there a way to change the order of these after they have been hooked up?
I was able to do this by just dragging them around in xcode 4.4 but that option seems to be non available in xcode 4.5.
Hopefully, this is possible from within the storyboard mode. But if it's only possible programmatically, that's ok too, just looking for any proper way to accomplish this without having to delete them all and re hook them up.
For example, how would I move the 'Home' item to first position?
The positions in each view are associated with the positions on the bottom bar of the Tab Bar Controller. If you reorder that bar you will reorder your views. You can reorder them by drag and drop on your interface builder.
In your example just select Home in your Tab Bar Controller and drag it to the first position.
If you have problems dragging and dropping try to select first your Tab View Controller or exit your XCode and open it again (like #thepumpkin1979 and #Rick pointed out).
Just edit the xml file and it will work.
Click on your "storyboard" and click the most right of the 3 buttons in "Editor".
This will show up an xml file on the left which u can edit anyway you wish.
Inside that file you should see xml tag "tabBar", inside it is "items", inside this is "tabBarItem".
All your tabBar items will be listed. You may cut and paste them in the order you wish.
I just did it now in Xcode 4.5.2.
Hope it also works for you too.
Ps. I am new to iOS so I can't use all the right Xcode names.
I think you can control+drag the tab item to reorder.
Drag and drop should work
You can drag the bar Item to the left to rearrange its position from the Storyboard.

How can I make my UIView visible in Xcode's Storyboard editor?

Please have a look at the screenshot that shows a part of a storyboard in Xcode. It is one controller. On the same level as the controller there are two UIViews "Date Picker View" and "Input Accessory View".
In the controller itself, they are shown in the bottom toolbar (see 2nd screenshot - the two icons to the right are tiny previews of the the views).
But how can I edit them? I cannot get them on the screen! I know they are there but I'd like to edit them (used to work before I made them parallel elements of the controller)! I tried right clicking, long clicking, zooming, panning, double clicking - nothing. If I drag one of the views into the controller's view, I can see them.
There are also outlets in the controller, referencing the views and the view can be used from code just fine. But editing them seems to have become impossible.
You can select them and edit their properties in the inspector, but there is no way to visually edit them short of physically moving them into one the scenes, editing them, and moving them back.

Resources