Segmented disable? - ios

I'm configuring my UI, in my first view all work perfect, but on my second view have a problem with segment button.
And don't apear on my view. I can drag but still looks "disable" and generate warning "Position is ambiguous for segmented control"
What happen?

This may solve your issue. Check the option "installed" in IB. see below gif image

Try to select "Favs" controller in your storyboard, then select "Editor -> Resolve Autolayout Issues -> Reset to suggested constraints" from Xcode upper menu.

Related

Size inspector not working in Xcode: there are no options showing

I have added a UIViewController in the storyboard. And when I tried to change its size, there are no options showing in the size inspector. The attributes inspector also shows nothing. The xcode version that I am using is 9.4.1. It was working before.
Sometimes it happens with the Xcode, it seems the bug in it.
The solution is
Just close the current tab and open a new tab. Now Size inspector, attribute inspector, etc. will be shown.
Sometime its Xcode Bug, Just close current tab and open new … Hopefully you will see the Size Inspector.
Work with View Controllers
If you will still face the problem follow the below instructions to test your Xcode is working properly and you are using ode in proper way.
For this, you’ll use an image view (UIImageView), a user interface
element that displays a picture.
To add an image view to your scene
Open your storyboard, Main.storyboard.
Open the Object library in the utility area. (Alternatively, choose
View > Utilities > Show Object Library.)






In the Object library, type image view in the filter field to find
the Image View object quickly.



Drag an Image View object from the Object library to your scene so
that it’s in the stack view below the button.






With the image view selected, open the Size inspector  in the
utility area.

Recall that the Size inspector appears when you select the fifth
button from the left in the inspector selector bar. It lets you edit
the size and position of an object in your storyboard.



Xcode Interface Builder - views are vertically ambiguous

Xcode is telling me that 8 views are vertically ambiguous, but it's not pointing to which view controller in my storyboard is actually causing the problem. I've clicked the warning message which just takes me to the storyboard and tried expanding all 20 something view controllers in the document outline, and none are showing that little warning indicator.
How can I determine the offending view controller?
This might be a pretty ugly way of figuring out what views are causing the warnings but I was having the same problem. What I did was in the Issue Navigator, right click on the warning and click "reveal in log". In the log, xcode gave me the warning statements followed by a semicolon and a value. Then I opened the storyboard in TextEdit to see the XML of the storyboard. I searched the values and found that they were ID numbers for views in the storyboard. From there I was able to figure out what views in what view controllers caused the problems. Hope that helps.
if you open the left panel on storyboard (Document Outline) you will see a red circle with arrow near the ambiguous view name. click it to see more details.
Here is an example with the red circle with arrow.
Those details may include another such red circle with arrow that will make suggestions.
I got this silly issue, too. I selected all the elements, cut them, and pasted them again, then the warning disappeared. Really sucks.....
Selecting everything and turning auto layout to off and then back to on, in the file inspector pane in the storyboard, solved it for me

UIButton title set in Storyboard is missing when run

I am quite new to iOS development and I encountered a problem when I was trying out a simple calculator tutorial. For some reason, the "0" and "=" does not appear on the iOS simulator while it appeared perfectly fine on the user interface shown on XCode.
Any idea on how to resolve this problem?
Thanks! =)
Just set the Style value to "Default" from "Attributes Inspector" tab as shown in the image below.
Now you should see the Font, Color and other attributed properties are back :)
In my case the button title disappeared, when I made changes to its attributes. Changing the Button title back to 'plain' and back again to 'attributed' made the text visible again.
One possibility could be that you accidentally set the titles of those two buttons on a control state other than default or UIControlStateNormal.
The buttons in your screenshot are in a state called UIControlStateNormal because they aren't being tapped or disabled. Select the buttons and make sure the 'State Config' option in the Attributes inspector is set to 'Default' when you're setting your title in Storyboard.
EDIT
Autolayout sometimes causes unintended behavior like this. If you aren't relying on Autolayout and don't plan to, you can turn it off in the File inspector. If you are relying on Autolayout, you'll have to write some code to undo the unintended behavior it's causing.

I want to change name of the view in the IB. Please see the screenshot

I want to rename View to View1. How can I do this?
Not sure what you are planning to do. If you want to have this view renamed in IB objects inspector:
Select the view
open right panel
go to the Identity Inspector(3rd icon)
fill Identity->Label (with placeholder "Xcode Specific Label").
However, if you want to access the view from view controller(use it in code), you should read about IBOutlets.
in the identity inspector, there's a section called "Identity". in that section is a textfield for "Label". changing that will change the name that appears in xcode. note that this is only something that has effect in xcode - it doesn't change anything about how the view is used in the app. is that what you want?
I think the operator wants to change the name in the outline. This can be done as described but it is no longer under Identity but Document.

Why storyboard constraints are changed automatically?

Friends my project is in ending state ,but even in my backup all constraints are changed i,don't know how and why ,but if i run all is available but in storyboard can't see any thing.
it is storyboard image :
it is simulator image :
how i have to solve this ,i need my previous constraints how its changed automatically ?
No issues, you can get your storyboard clean and restored.
Goto your storyboard, select the particular view controller/ table view controller.
Choose the file inspector on the right side, goto Interface Builder Document section uncheck Use Size Classes
Proceed by choosing Disable Size Classes option from the dialog popup. Find that all your views have been visible now, and there is the possibility of constraint warnings.
Click on the yellow mark to the right side of your view controller, update the constraints one by one.
At the end, your previous viewcontroller/tableviewcontroller state is restored.
If you have more than one viewcontroller/tableviewcontroller has this problem, do the above steps for all.
Note: Don't forget to check the Use Size Classes back.
Happy coding :)

Resources