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

Commit

Permalink
Fix a typo in the property name.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmx committed May 18, 2017
1 parent 311df4c commit 0916345
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions AMXFontAutoScale/AMXFontAutoScalable.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ typedef NS_ENUM(NSInteger, AMXScreenSize) {

@protocol AMXFontAutoScalable <NSObject>

@property (nonatomic, assign, setter=set_amx_autoScaleEndabled:) BOOL amx_autoScaleEndabled;
@property (nonatomic, class, setter=set_amx_autoScaleEndabled:) BOOL amx_autoScaleEndabled;
@property (nonatomic, class, setter=set_amx_autoScaleEnabled:) BOOL amx_autoScaleEnabled;
@property (nonatomic, assign, setter=set_amx_autoScaleEnabled:) BOOL amx_autoScaleEnabled;

@property (nonatomic, assign, setter=set_amx_referenceScreenSize:) AMXScreenSize amx_referenceScreenSize;
@property (nonatomic, class, setter=set_amx_referenceScreenSize:) AMXScreenSize amx_referenceScreenSize;
Expand Down
24 changes: 12 additions & 12 deletions AMXFontAutoScale/UILabel+AMXFontScale.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ @implementation UILabel (AMXFontScale)

+ (void)amx_autoScaleFontForReferenceScreenSize:(AMXScreenSize)screenSize
{
[self set_amx_autoScaleEndabled:YES];
[self set_amx_autoScaleEnabled:YES];
[self set_amx_referenceScreenSize:screenSize];
}

+ (BOOL)amx_autoScaleEndabled
+ (BOOL)amx_autoScaleEnabled
{
return s_globalAutoScaleEnabled;
}

+ (void)set_amx_autoScaleEndabled:(BOOL)amx_autoScaleEndabled
+ (void)set_amx_autoScaleEnabled:(BOOL)amx_autoScaleEnabled
{
s_globalAutoScaleEnabled = amx_autoScaleEndabled;
s_globalAutoScaleEnabled = amx_autoScaleEnabled;
}

+ (AMXScreenSize)amx_referenceScreenSize
Expand All @@ -47,18 +47,18 @@ + (void)set_amx_referenceScreenSize:(AMXScreenSize)amx_referenceScreenSize

- (void)amx_autoScaleFontForReferenceScreenSize:(AMXScreenSize)screenSize
{
self.amx_autoScaleEndabled = YES;
self.amx_autoScaleEnabled = YES;
self.amx_referenceScreenSize = screenSize;
}

- (BOOL)amx_autoScaleEndabled
- (BOOL)amx_autoScaleEnabled
{
return [[self amx_getObjectForKey:@selector(amx_autoScaleEndabled)] boolValue];
return [[self amx_getObjectForKey:@selector(amx_autoScaleEnabled)] boolValue];
}

- (void)set_amx_autoScaleEndabled:(BOOL)amx_autoScaleEndabled
- (void)set_amx_autoScaleEnabled:(BOOL)amx_autoScaleEnabled
{
[self amx_storeObject:@(amx_autoScaleEndabled) forKey:@selector(amx_autoScaleEndabled)];
[self amx_storeObject:@(amx_autoScaleEnabled) forKey:@selector(amx_autoScaleEnabled)];
}

- (AMXScreenSize)amx_referenceScreenSize
Expand All @@ -73,7 +73,7 @@ - (void)set_amx_referenceScreenSize:(AMXScreenSize)amx_referenceScreenSize

- (BOOL)wasInstanceAutoScaleSet
{
return [self amx_getObjectForKey:@selector(amx_autoScaleEndabled)] != nil;
return [self amx_getObjectForKey:@selector(amx_autoScaleEnabled)] != nil;
}

#pragma mark - Swizzles
Expand All @@ -87,9 +87,9 @@ + (void)load
- (void)swizzle_willMoveToWindow:(UIWindow *)newWindow
{
AMXScreenSize referenceScreenSize = AMXScreenSizeCurrent;
if (self.amx_autoScaleEndabled) {
if (self.amx_autoScaleEnabled) {
referenceScreenSize = self.amx_referenceScreenSize;
} else if (self.class.amx_autoScaleEndabled && ![self wasInstanceAutoScaleSet]) {
} else if (self.class.amx_autoScaleEnabled && ![self wasInstanceAutoScaleSet]) {
referenceScreenSize = self.class.amx_referenceScreenSize;
}

Expand Down
24 changes: 12 additions & 12 deletions AMXFontAutoScale/UITextView+AMXFontScale.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ @implementation UITextView (AMXFontScale)

+ (void)amx_autoScaleFontForReferenceScreenSize:(AMXScreenSize)screenSize
{
[self set_amx_autoScaleEndabled:YES];
[self set_amx_autoScaleEnabled:YES];
[self set_amx_referenceScreenSize:screenSize];
}

+ (BOOL)amx_autoScaleEndabled
+ (BOOL)amx_autoScaleEnabled
{
return s_globalAutoScaleEnabled;
}

+ (void)set_amx_autoScaleEndabled:(BOOL)amx_autoScaleEndabled
+ (void)set_amx_autoScaleEnabled:(BOOL)amx_autoScaleEnabled
{
s_globalAutoScaleEnabled = amx_autoScaleEndabled;
s_globalAutoScaleEnabled = amx_autoScaleEnabled;
}

+ (AMXScreenSize)amx_referenceScreenSize
Expand All @@ -47,18 +47,18 @@ + (void)set_amx_referenceScreenSize:(AMXScreenSize)amx_referenceScreenSize

- (void)amx_autoScaleFontForReferenceScreenSize:(AMXScreenSize)screenSize
{
self.amx_autoScaleEndabled = YES;
self.amx_autoScaleEnabled = YES;
self.amx_referenceScreenSize = screenSize;
}

- (BOOL)amx_autoScaleEndabled
- (BOOL)amx_autoScaleEnabled
{
return [[self amx_getObjectForKey:@selector(amx_autoScaleEndabled)] boolValue];
return [[self amx_getObjectForKey:@selector(amx_autoScaleEnabled)] boolValue];
}

- (void)set_amx_autoScaleEndabled:(BOOL)amx_autoScaleEndabled
- (void)set_amx_autoScaleEnabled:(BOOL)amx_autoScaleEnabled
{
[self amx_storeObject:@(amx_autoScaleEndabled) forKey:@selector(amx_autoScaleEndabled)];
[self amx_storeObject:@(amx_autoScaleEnabled) forKey:@selector(amx_autoScaleEnabled)];
}

- (AMXScreenSize)amx_referenceScreenSize
Expand All @@ -73,7 +73,7 @@ - (void)set_amx_referenceScreenSize:(AMXScreenSize)amx_referenceScreenSize

- (BOOL)wasInstanceAutoScaleSet
{
return [self amx_getObjectForKey:@selector(amx_autoScaleEndabled)] != nil;
return [self amx_getObjectForKey:@selector(amx_autoScaleEnabled)] != nil;
}

#pragma mark - Swizzles
Expand All @@ -87,9 +87,9 @@ + (void)load
- (void)swizzle_willMoveToWindow:(UIWindow *)newWindow
{
AMXScreenSize referenceScreenSize = AMXScreenSizeCurrent;
if (self.amx_autoScaleEndabled) {
if (self.amx_autoScaleEnabled) {
referenceScreenSize = self.amx_referenceScreenSize;
} else if (self.class.amx_autoScaleEndabled && ![self wasInstanceAutoScaleSet]) {
} else if (self.class.amx_autoScaleEnabled && ![self wasInstanceAutoScaleSet]) {
referenceScreenSize = self.class.amx_referenceScreenSize;
}

Expand Down

0 comments on commit 0916345

Please sign in to comment.