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

Commit 838f4fa

Browse files
committed
Fix the issue where instance scaling was broken if global one was enabled (part 2).
1 parent d50dab5 commit 838f4fa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
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.2"
5+
s.version = "1.0.3"
66
s.summary = "Scale the font for UILabel and UITextView proportionally across all the screen sizes."
77

88
s.description = <<-DESC

AMXFontAutoScale/UITextView+AMXFontScale.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ - (BOOL)wasInstanceAutoScaleSet
8080

8181
+ (void)load
8282
{
83-
[self amx_swizzleInstanceSelector:@selector(willMoveToSuperview:)
84-
withSelector:@selector(swizzle_willMoveToSuperview:)];
83+
[self amx_swizzleInstanceSelector:@selector(willMoveToWindow:)
84+
withSelector:@selector(swizzle_willMoveToWindow:)];
8585
}
8686

87-
- (void)swizzle_willMoveToSuperview:(UIView *)newSuperview
87+
- (void)swizzle_willMoveToWindow:(UIWindow *)newWindow
8888
{
8989
AMXScreenSize referenceScreenSize = AMXScreenSizeCurrent;
9090
if (self.amx_autoScaleEndabled) {
@@ -97,7 +97,7 @@ - (void)swizzle_willMoveToSuperview:(UIView *)newSuperview
9797
self.font = [self.font amx_scaleForReferenceScreenSize:referenceScreenSize];
9898
}
9999

100-
[self swizzle_willMoveToSuperview:newSuperview];
100+
[self swizzle_willMoveToWindow:newWindow];
101101
}
102102

103103
@end

0 commit comments

Comments
 (0)