Fonts can be modified with code as well as in storyboards. In this tutorial, see how to add and activate Auto Layout pins in iOS.
- [Instructor] Not only can you set positioning…using auto layout with code,…you can also modify anything…that you can modify in a storyboard using code.…As an example of that,…let's look at manipulating fonts with code.…So, below all of this existing code,…I'm going to set the font of the label.…So, label.font, I'm going to set that equal…to the systemFont but change the size,…so UIFont, just using the code hinting…to fill that out for me,…so you can select it and press return on your keyboard…and then a .systemFont(ofSize…and then you can pass in the size that you want.…
I'm going to put in a gigantic size of 150.…And that may be a little bit big…in portrait or on smaller screens,…so to make up for that,…we're going to make sure that the font scales appropriately.…To do that, go the next slide…and set the minimumScaleFactor on the label,…so label.minimumScaleFactor…and this is a percentage between zero and one…of how small the font can get,…so I'm gonna put 0.2.…
That means 20% of its original size, so 30 points.…
- Installing and using Xcode
- Working with storyboards
- Working with UI objects and events
- Resizing objects and layouts dynamically
- Coding UI objects such as buttons
- Loading and displaying data in table views
- Testing your iOS app
Skill Level Beginner
1. Xcode Fundamentals
2. Core Skills
3. Responsive UI Design
4. Coding UI Objects
5. Table Views
6. App Flow and Testing
Next steps1m 8s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.