Xcode 6 : Changing the Font for a Size Class - ios

I'm trying to setup different fonts or some sort of font scaling in my Size Classes in Xcode 6 as listed by this page:
https://developer.apple.com/library/prerelease/ios/recipes/xcode_help-IB_adaptive_sizes/chapters/ChangingtheFontforaSizeClass.html#//apple_ref/doc/uid/TP40014436-CH12-SW1
The problem is I can't seem to get past Step #3 which says:
I do not see a + button.
Am I missing something or is the documentation wrong?
Thanks

It's very tiny (at least on Mavericks). Took me a moment to find it too.
Maybe this will help?

Related

Xcode: Which elements of my Xcode storyboard are causing the large file size?

I have been working on a project for about 1.5 years now. I have been periodically making changes and adding to the project. This has included adding new View Controllers and element to the Main.storyboard.
The last time I made a normal change to the project, I am suddenly getting an error when I try to push to GitHub:
Main.storyboard is 433.87 MB; this exceeds GitHub's file size limit of 100.00 MB
I don't understand what could have caused the size to jump so drastically.
So I have some questions:
Is there a way to see which elements of the storyboard are causing the large file size?
Did GitHub recently change how big a file can be?
Is there a non-evasive way to push this file to GitHub?
Thanks in advance for any help and suggestions.
Edit:
I looked at the raw text file for the storyboard and I found a very strange field. The entire file is 5,607,859 lines long. The field below goes clear from line 15,510 to 5,607,777 (or about 99.7% of the file). Can anyone tell me why this field might exist? Or what to do about it?
...
...
...

Seeing small dashes under Button's title in Xcode 8.1

I was creating a simple app in Xcode 8.1 with swift 3 and I got this problem (picture): dashes under buttons symbols.
How can I fix this issue?
Thanks.
So Nirmit dagly (https://stackoverflow.com/users/3401707/nirmit-dagly) has given the exact solution and it works perfectly.
He says: "You need to check button style on your iPhone device's setting. To check please go to General -> Accessibility -> Button Shapes. If it is enabled, then make it disable and run the app again. It'll hide the underlines from buttons."
I do thank him for his helpful answer and I has republish it here for the benefit of others.
Thank you again Nirmit and I prefer if we can get other independent solutions(not linked to the parameters of the phone user.).

Xcode custom fonts not showing up in Storyboard

I added my two fonts to my project folder:
I added them to info.plist:
I can not see them in my custom font list in the storyboard:
What have i done wrong?
I know this is a pretty old question, but I ran into the same issue. And the above tips didn't work for me. Apart from the standard checks (present in bundle, restarting XCode, the thing that fixed my issue was that my label text type was marked as "Plain" and hence some fonts were not showing in the dropdown in the Storyboard. As soon as I changed the text type to "Attributed", all the fonts appeared in the dropdown.
Hope this'll help someone stuck with the same issue.
This drop-down box shows the system-wide installed fonts. So you need to install your custom font on your system first so it's appearing in that drop-down box. You can do that by double-clicking it, the FontBook.app opens and asks you whether you want to install the font.
This was a huge headache for me but I simply fixed it by:
I fixed the issue by restarting my Mac.
Then restarting Xcode.
I Installed the font in the system as per DarkDust solution and i am able to see the font in attributed type.
Then i changed the type to plain and i able to see the Custom font in the font types drop down.
Had the same problem but this SO answer by user Saranjith solved it while the other solutions in this thread didn't: Xcode 8 custom font doesn't show up in interface builder
Basically in Font Book select "Computer Fonts" and then hit the + button and re add the Fonts.
This is happened to me after moving to Xcode 11 in Catalina from Xcode 10 in Mojave.
Well, silly mistake on my part, but I didn't realize my font was named something way different from the file name.
Double-clicking the actual font file opened it in the font book, and that showed the actual font name. It was in the dropdown all along.
I solved my problem when i used font name. Do not use file name. I was used like this [UIFont fontWithName:#"appFont" size:17] but it is wrong.
Upload your font file to https://fontdrop.info/ and use the name
My font file name is appFont.ttf but when i uploaded i saw Roboto Regular.
[UIFont fontWithName:#"Roboto Regular" size:17]
Sometime I go to another file and come back, then my custom fonts are arrived. I think this is an issue of Xcode and will be solved in following version.
In my case I just turn the text from plain to attributed then turn it back again to plain then it showed up., hope this help anyone.
I ran into the same issue and fixed with below steps
Closed storyboard
Cleared derived data
Cleaned the project and open the story board
If this is not working then restart the Xcode.
Thanks
For me it was case sensitive issue with the font file name. Not sure if it's always for this reason...
In my case my fonts were in woff2 formats. Although woff2 is supported in iOS, the fonts don't appear or get rendered in Storyboards.
If Xcode showed your custom font before but stopped to do it at some moment, try to readd font files to your project. It solved the problem for me. Other answers weren't helpful.

How Can I set different Constraint for different Screen sizes (For Ex: iPhone 3.5",4",4.7" and 5.5") using a single storyboard?

I have searched it out, but not gotten any fruitful answers. I want to set different constraints for all different screen size in a single storyboard itself (Not programmatically).
How can I resolve this?
Thanks in advance !!
Please see this useful link it helps you.
http://www.raywenderlich.com/83129/beginning-auto-layout-tutorial-swift-part-1
In this tutorial you can find "A quick note on Size Classes" section in that section you can find the solution of your problem :)
Also see following the tutorial for the constraints hope it will help you.
https://www.youtube.com/watch?v=G53PuA_TlXk
Without writing a single line!
No need to write device based conditions these :-
if device == iPhoneSE {
constant = 44
} else if device == iPhone6 {
constant = 52
}
I created a library Layout Helper so now you can update constraint for each device without writing a single line of code.
Step 1
Assign the NSLayoutHelper to your constraint
Step 2
Update the constraint for the device you want
Step 3
Run the app and see the MAGIC

Multiple UIImageViews with same image gives Inconsistency error

I add 3 UIImageView objects to a MainViewController.
For each of them add the same image "test.png".
The images display correctly for each of the controls.
Close the MainViewController and reopen it.
You get an error displayed saying "The MainViewControllre" has 3 internal inconsistencies that were found and repaired.
The details for the message indicates that there are resources with the same name.
Although the images still display correctly and the program executes in the simulator I would like to solve this message.
This seems to be something that was introduced in XCode 5.
Sounds like you might be using StoryBoards for setting these images? I remember hearing about this issue a few months ago. Check out this SO post:
Storyboard Internal Inconsistencies
Seems like it may have been a bug in an early release of Xcode 5. The correctly marked answer here states updating to Mavericks and Xcode 5.0.1 fixed the issue. Also, if this in fact the problem, and you can not update for what ever reason, removing the storyboard references to the images and adding the image to the image view programmatically may solve your issue. Trivial example, but just in case you (or anyone else reading this) doesn't know:
[imageView setImage:[UIImage imageNamed:#"imagename.png"]];

Resources