iOS Swift first app, controls dont appear - ios

I have created my first app with xcode and swift followin a tutorial.
I have added a button and 2 images to the main story board.
I have also added some easy code:
http://screencast.com/t/m8DVzHNNz60M
However when I run the app, the simulator is blank, nothing in it, and the button I know its not hidden.

There are a few things that could be wrong.
1. Your button isn't centered. You need to center it using constraints. Check out this: https://stackoverflow.com/a/26959256/5143847
2. In your IBAction, you are hiding your button. Try this:
uncoolButton.hidden = false
Or you can just remove it completely. Based on your question, it seems like you want to keep the button showing.

Related

Ios menu related issue

Since I'm new to Ios , What i wanted to is given demonstration bellow
That means, on over the image and some text will remain static but , bellow a sliding menu would work like the gif.
if I tap on some menu item it will slide to bring related menu. if I press on the cross it will act back ward.
I don't even know what does it call. I tried with customsegue and transitions. but no luck . also tried with transparent show modally. it works for one view but not for backword (i.e. unwinding) . it get darker.
You can try using UIPageController for pagination effect.

Text Field doesn't active for Static Cell in Table View Controller?

I have Single View App for IOS Xcode 6.4. Example Add Player screen, I tried it by myself, but Text Field doesn't active to click and typing at my application simulator (UITableViewController Static Cell) I have compared my project with example final project, everything looks good similar. How to fix this problem?
First you try with cmd+k that will open the simulator's keyboard. If that is not working then try with cmd+shit+k that may hide your keyboard but you can able to type on the text filed. If that also not work then you may accidentally off the user interaction for text field. Or may be some other view covering your text field which is transparent, so you are not able to see it. I hope that will save your problem, otherwise please provide your code sample.
There is a bug in the segue transition. Set the transition to None and it should work. I had the problem with a Curl transition.

How to make the buttons visible on simulator?

I'm using Xcode 5.1.1. I recently added a background image to my application but the buttons on the view controller aren't visible. When I remove the background image, the buttons become visible again. How to handle this?
If you are not checking the view hierarchy, then do one thing create outlet of you button and then write following code in viewDidLoad.
[self.view bringSubviewToFront:yourButton];
I don't know if you were used xib...
If you are using xib in your project, giving a background image for your button will more easy.
Place a button anywhere you want. Then go to attributes inspector on the right hand side. There you can find a field for changing your background image. Just give the name of your image.
Hope it will helpful for you

Editing toolbar in Xcode 4.6 - unable to add Bar Button Items

I am attempting to add a toolbar as an input accessory, and as such have added it via xcode storyboard editor to the view controller (and not within the view). This was as specified in this tutorial(which seems to be written for an earlier version of xcode): reference
My issue: "8.) Now we need to open the toolbar item itself. Double click Toolbar in the document window."
This is no longer valid behavior in Xcode 4.6 it appears, so I ask you: how do I add button items to a toolbar? I would prefer to avoid doing it programmatically (Still reasonably new to xcode development and normally make my GUIs with storyboards) but if I have to, I have to.
Many thanks!
If you're doing what I think you are doing, adding UIBarButtonItems to a UIToolbar, then you simply drag a Bar Button Item out to the toolbar.
However, I would assume that what they mean when they say 'double-click' is not what people normally think of when they think double click. Try double clicking slowly this often does the trick.
Found the issue - it was appearing behind the UIView. However you dont ever need to graphically interact witha toolbar, you can just drag-and-drop controls onto it in the sidebar. If there is a need for more info on this message me or vote up.

XCode 4: some button titles not visible in iOS simulation

I try to make a simple calculator using Xcode 4 for iPhone. It is my very first iOS application.
I use several buttons with titles: 1, 2,...9, +, =, -...
But when I run the program in iOS simulation, some of the buttons do not show their titles (i.e. they have nothing written on them).
The buttons without the titles are somewhat random: majorly the ones at the bottom of the screen, but also one on the top. The other buttons show their titles normally.
What the hell?
I had the same experience while doing the iOS calculator app from the iTunes U Piazza course. I think it started when I moved some of the buttons. I checked in the MainStoryboard.storyboard file with text edit - it appears that the height constraint went missing from these buttons - not clear how/why
whatever the root cause , I was able to fix it only by deleting the buttons in question and recreating them in the xcode editor
Try simply copy and pasting the duff control - I had this problem after changing the view from inferred to retina 3.5
This can be fixed by turning off "AutoLayout" on the storyboard. more info here: https://stackoverflow.com/a/16556044/26510
Changing text type from attributed to plain worked for me.
Per Apple developer guide, you should not set either the button title label text or color directly as a property (for example, do not do this: myButton.titleLabel.text=#"SomeText" or myButton.titleLabel.textColor=[UIColor blackColor]).
Rather, you set them using the UIButton setter functionality, like this:
[myButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
...or like this:
[myButton setTitle:#"SomeText" forState:UIControlStateNormal];.
See the Apple guide.
I Figure it out that there are some reasons why this can happen. In my case the problem was that I was setting the background image as button image, so the text was right-shifted out of the bounds of the button.

Resources