Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Commit 27cfb3e

Browse files
committed
Update README.md
1 parent 5c4a95b commit 27cfb3e

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

AMXFontAutoScale.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Pod::Spec.new do |s|
33

44
s.name = "AMXFontAutoScale"
5-
s.version = "1.0.4"
5+
s.version = "1.1.0"
66
s.summary = "Scale the font for UILabel and UITextView proportionally across all the screen sizes."
77

88
s.description = <<-DESC

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Scale the font for **UILabel** and **UITextView** proportionally across all the
66

77
## Usage
88

9-
#### :earth_africa: Global scaling:
9+
#### :earth_africa: Global scaling
1010
```swift
1111
import AMXFontAutoScale
1212

@@ -27,7 +27,7 @@ iPhone 4 inch | iPhone 4.7 inch | iPhone 5.5 inch
2727
------------ | ------------- | -------------
2828
![Contact List](/assets/iphone-4-inch.png) | ![Contact Details](/assets/iphone-4-7-inch.png) | ![Edit Contact](/assets/iphone-5-5-inch.png)
2929

30-
#### Instance scaling:
30+
#### Instance scaling
3131
```swift
3232
import AMXFontAutoScale
3333

@@ -45,7 +45,7 @@ class SomeViewController: UIViewController {
4545

4646
**Note**: The instance scaling overrides the global one if set.
4747

48-
#### Disable scaling for some instances:
48+
#### Disable scaling for some instances
4949

5050
```swift
5151
import AMXFontAutoScale
@@ -64,6 +64,27 @@ class SomeViewController: UIViewController {
6464
}
6565
```
6666

67+
#### Handle manually font point size updates
68+
69+
Get a closure called every time the font should be updated.
70+
71+
```swift
72+
import AMXFontAutoScale
73+
74+
class SomeViewController: UIViewController {
75+
76+
override func viewDidLoad() {
77+
super.viewDidLoad()
78+
79+
for someLabel in someLabels {
80+
someLabel.amx_fontSizeUpdateHandler = { originalSize, preferredSize, multiplier in
81+
print("For original size: \(originalSize) set preferred size: \(preferredSize), multiplier: \(multiplier)")
82+
}
83+
}
84+
}
85+
}
86+
```
87+
6788
## Installation
6889

6990
#### Manual installation

0 commit comments

Comments
 (0)