This repository was archived by the owner on Jun 22, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 2
2
Pod ::Spec . new do |s |
3
3
4
4
s . name = "AMXFontAutoScale"
5
- s . version = "1.0.4 "
5
+ s . version = "1.1.0 "
6
6
s . summary = "Scale the font for UILabel and UITextView proportionally across all the screen sizes."
7
7
8
8
s . description = <<-DESC
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Scale the font for **UILabel** and **UITextView** proportionally across all the
6
6
7
7
## Usage
8
8
9
- #### :earth_africa : Global scaling:
9
+ #### :earth_africa : Global scaling
10
10
``` swift
11
11
import AMXFontAutoScale
12
12
@@ -27,7 +27,7 @@ iPhone 4 inch | iPhone 4.7 inch | iPhone 5.5 inch
27
27
------------ | ------------- | -------------
28
28
![ Contact List] ( /assets/iphone-4-inch.png ) | ![ Contact Details] ( /assets/iphone-4-7-inch.png ) | ![ Edit Contact] ( /assets/iphone-5-5-inch.png )
29
29
30
- #### Instance scaling:
30
+ #### Instance scaling
31
31
``` swift
32
32
import AMXFontAutoScale
33
33
@@ -45,7 +45,7 @@ class SomeViewController: UIViewController {
45
45
46
46
** Note** : The instance scaling overrides the global one if set.
47
47
48
- #### Disable scaling for some instances:
48
+ #### Disable scaling for some instances
49
49
50
50
``` swift
51
51
import AMXFontAutoScale
@@ -64,6 +64,27 @@ class SomeViewController: UIViewController {
64
64
}
65
65
```
66
66
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
+
67
88
## Installation
68
89
69
90
#### Manual installation
You can’t perform that action at this time.
0 commit comments