How can I set "Update Frames" to None in XCode 8.3? - ios

I'm doing a the Ray Wanderlich iOS Appprentice and we are right now working with AutoLayout.
I'm asked to add some constraints to the this particular Table View and I can do so.
What I can't do is modify the "Update Frames" behavior. In this particular case, the book asks me to set it to None.
I can tell you that his is not the default behavior because my label has shrunk as per the warning in the book—see attached warning and image.
Note: If you had set Update Frames to “Items of New Constraints”, then Interface Builder would have moved the label to where the dotted
box is. That’s why you left it set to None because you didn’t want it
to do that here.
What can I do to do as the tutorial intends?

So either you click on the round arrow:
or by simply using this shortkey:

Related

Accessibility: focus on a view

In my application (that has to be accessible for blind user) I have this scenario (its a grammatic exercise)
When I try it on a device turning on VoiceOver, first it focus on the first part of the sentence, so in that case it read "Kesha" and when i swipe right to read the next part it read the second part of the sentence "the contract because...". What I want is to make it also focus on the gray box (that is a UIViewelement) before it read the second part of the sentence, so that the user know where that empty box is in the sentence, but i don't know how to do that.
I alread tried grayBox.accessibilityLabel = "empty box" or grayBox.accessibilityHint = "empty box" but it just don't set the focus on that view and it doesn't speak. I also tried to put an empty UILabel inside the box but I have some issue positioning that in the right order and I don't think it is the right way to do it. Any suggestion?
On the UIView that you want to 'receive focus' you just need to enable accessibility or mark it as an accessible element, An example:
myGreyView.isAccessibilityElement = true
myGreyView.accessibilityLabel = "A grey box"
myGreyView.accessibilityHint = "this is a secretive box. I don't know what it does"
You can also tick a box in the UIView's properties in xcode interface builder "Accessibility Enabled" I think its called. Which also lets you set the label and hint.
For more information see this Apple guide to VoiceOver
In regards to the order of elements being read out. Is the first part and second part different UILabels or one label?
Are you adding these in code or Xib/Storyboard? Depending on the order they are added as subviews can effect the order VoiceOver reads items out.
When adding the 3x UI elements add them in this order below.
UILabel - "Kesha"
UIView - Gray box, "A grey box"
UILabel - "the contract because it was not fair."
If you have added them via Interface builder (Xib/Storyboard) make sure the order is correct in the view hierarchy.
If this fails you could try overriding the method "accessibilityElements" and return an array of the labels and grey view in the order you want them read out.

Set the Storyboard guide title to a #IBInspectable value for a custom #IBDesignable view in swift?

I have a custom #IBDesignable UIButton. I use several of them on a screen in the Storyboard file and they are central to the whole flow of the app. They all appear in the Guide as "Button":
"Button"s in guide
Seeing the actual title would be a whole lot easier in managing the Storyboard (although of course has no effect on actual runtime). I'd like to set the title to an #IBInspectable label text I'm using:
Their attribute Inspector
I'm using my own label text instead of the regular button title because it's layout and format is special. If I set the button title it shows up in the middle over the real title.
Ideally I want to set the guide "title" to my label. I couldn't find anything anywhere on how to do this. Otherwise, is there some work around trick to use the Button Label? Keep in mind this is just to make the Storyboard less confusing for others to see and use.
Thanks!
You can always slow double click each button (in the Document Outline (the left pane (your first picture))). It'll let you rename it right there.
By "slow double click" I mean, click to select, wait a sec, click again (without moving the mouse).
I'm only familiar with The Document Outline automatically naming things when you provide referencing outlets (control dragging to a .swift file). They'll take on the names of the variables you're dragging them to (even so far as formatting camel case with spaces and caps for you). Otherwise, in your case, you're probably going to have to manually name each one.
You can "name" your elements by filling in the Label field in the Identity Inspector pane:
As you see, I have a normal UIButton, and I put "Button One" in the Label field... so it shows up as "Button One" in the outline pane.

In Xcode Interface Builder - why are the options in the Editor--->Arrange menu (containing Send to Front, Send to Back) often disabled?

What I'm trying to do is simple: bring a label in front of an image within a subview.
But all of the options for arranging are disabled/un-selectable when my label is selected. I find this happens often.
What could be the reason that I'm almost never allowed to change the z-axis of my objects in the Arrange menu? Is it a better practice to avoid this feature and set the order of views programmatically?
It can depend on how you have selected the label (similar to how the label can only be moved with the keyboard when selected in some ways).
A simple alternative is to look at the list of view in the pane on the left and to drag the views up and down to change the order.
It happens sometimes. In that situation, click the view or image you want to send back then you will see little square box at the edges of image from which you can re size your image, Just click on it once and then go to Editor > Arrange > Choose option according your need.

Highlighted property is only for display within Interface Builder

How do I solve such warning? What does it mean in most of the cases?
When I click on it, there is nothing highlighted on my Interface Builder (it just zooms in on some area between 2 view controllers).
You have a UIImageView with Highlighted set to true in Xcode. Xcode tells you that the value is for WYSIWYG but won't work at runtime.
After looking at warning message details I got to know, but still there was no way, I could find particular Image is having highlighted="YES"
Perfect Trick suggested by #Keller in Accepted answer's comment.
Just right click your Storyboard --> Open As --> Source Code.
search for
highlighted="YES
Just set YES to NO.
or event if you look carefully code around searched string, you can get in which ViewController's Scene particular ImageView.
Thanks to #Keller
Right click on your Storyboard -> Open as -> Source Code.
Search for highlighted = "YES".
Check the name of the image.
Find the image on the Storyboard.
Click the image, go to Show the Attributes inspector.
Uncheck the Highlighted option
Highlighted image

Does this UIBarButton exists by default in iOS? How is it called

I think I've seen this kind of button before, and now I need one.
A button like the one below who's label can be changed to whatever number I need (from 2 to 10 for example).
I have a feeling that this exists by default in iOS SDK but I can't seem to find it.
Does it exist by default or do I have to create it myself?
Thanks!
Its easy to replicate. Add a new RoundRectButton in interface builder, then in the attributes inspector change the type to Custom. Set the BackgroundImage to an image similar to above, and then set the Title to the number. By default the title will centered in the button, but you can use the Inset options in the attributes inspector and nudge the title in and down using the Top and Left inset attributes.
No, it's not a default item as far as I know. You can see all the default items in the Apple Human Interface Guidelines (see "System-Provided Buttons and Icons").

Resources