Title of all my UIbuttons is written twice - ios

Suddendly a strange problem appears in my app.
The title of all my buttons is written twice !
For instance, instead of "Menu", it is written "Menu Menu".
It appears only at runtime, on simulator and on real device. All is ok in my storyboard.
The buttons and their title are all created in my storyboard.
I have a button in navigationBar and 3 buttons per rows of tableView.
The title of all these buttons is written twice.
Here is a github image :
buttonTitleRepeated.tiff
Here is the scene description in storyboard.
After this problem occured, I downloaded last version of Xcode : 6.1.1, but my problem is still there.
Elsewhere in my code I create buttons programmatically, in this case, titles are not repeated.
Please, can you help ?**

Related

"Print" & "Cancel" disappeared from Printer Options in UIActivityViewController

The buttons are still there and function fine, however as you can see they are completely invisible. Adjusting font colors and navigation bar colors had no effect. I have been trying to resolve this for months and despite reading Apple's documentation, I am unable to even see where you would change what I assumed to be a system wide function.
So to help narrow down this issue I created a simple navigation controller with a print button. If I put these both on the Login storyboard (the first storyboard) it works perfectly fine. If I put it on Main.storyboard (the second storyboard) it doesn't work.
If I change my project settings to make Main.storyboard the first storyboard it works. Leading me to believe the issue is in my FirstViewController.
You can set the color of the print and cancel button
UIBarButtonItem.appearance(whenContainedInInstancesOf: [UIToolbar.self]).tintColor = UIColor.green
After narrowing down the problem to the first view controller I discovered the tint was set to Clear Color (ie Alpha is 0). Fixing this resolved the problem in the rest of the app. I am surprised a setting in a view can propogate to the rest of the app and overwrite all of the other views in the process. Perhaps apple set the first view to determine the colors for system pop ups etc.

iOS Swift first app, controls dont appear

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.

Custom bar button item not detecting touch correctly

I have created two custom buttons in the nav bar's right bar button using storyboard like so:
Below is how they look. I've added background colours to the buttons for easy viewing of detectable area.
The problem I am having is that the map button on the right is only detecting touch events on the left side of the button. The left button is detecting touch events fine. What's even stranger is that it seems to work fine in the simulator, but not on devices. I've tried on multiple devices and they all have the same issue. This is driving me crazy.... been at it all day. Please help!
After banging my head against the wall for two days with this one, I finally realised that as of Xcode 7 you can finally just drag multiple UIBarButtonItems to the UINavigationItem directly in Interface Builder. Creating the two buttons this way instead of the previous method fixed the issue.

Tabbed icons & Keyboard not appearing in text field in Swift

I am working in Xcode 6 in swift. I am using the default UITabBarItem tab icons which are appearing in Main.storyboard, but are not appearing in the simulator (I am using the default images -- nothing uploaded). In addition, the keyboard is not appearing after touching into a text field. I am getting the following error:
Could not load the " " image referenced from a nib in the bundle with identifier "Project Name".
Note that this error is only happened after a segue into the tab bar controller. It is working correctly in prior views.
It looks like you have a bad layout which is pushing the tab icons off the screen. Suggest you use the Resolve AutoLayout Issues and check it out. Can't comment on the second issue without the code.
Just clear the constraints and then click on the Add Missing Constraints

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