Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasmusson authored Jun 3, 2020
1 parent 5ab67af commit fc31897
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions basics/DynamicFont/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ The way Apple keeps its fonts looking good (even when people resize their device
<img src="https://github.com/jrasmusson/ios-starter-kit/blob/master/basics/DynamicFont/images/sizes.png" alt="drawing" width="800"/>



So long as you stick to these `UIFontTextStyle`s, your app will resize its fonts appropriatedly. The advantages here aren't just astectic. They can also serve as the design language you use with your designers. So when you say `Title1` everyone will know what you mean, and you won't have to hardcode font sizes any more.


## Source

```swift
Expand Down Expand Up @@ -132,6 +130,12 @@ public static var traitUIOptimized: UIFontDescriptor.SymbolicTraits { get }
public static var traitTightLeading: UIFontDescriptor.SymbolicTraits { get }
public static var traitLooseLeading: UIFontDescriptor.SymbolicTraits { get }
```

### Customer font

```swift
tagline.font = UIFontMetrics.default.scaledFont(for: UIFont.systemFont(ofSize: 12, weight: .bold))
```

### Links that help

Expand Down

0 comments on commit fc31897

Please sign in to comment.