Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
Fix bugs about button colors.
  • Loading branch information
yulingtianxia committed Apr 5, 2018
1 parent 5d9670d commit da4d321
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
osx_image: xcode9.1
osx_image: xcode9.2
language: objective-c
xcode_project: TBAlertControllerDemo
xcode_scheme: TBActionSheetKit
xcode_sdk: iphoneos11.1
xcode_sdk: iphoneos11.2
env:
global:
- FRAMEWORK_NAME=TBActionSheetKit
Expand Down
6 changes: 5 additions & 1 deletion Example/TBAlertControllerDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
A4910BEF1C1FFD95009D25F9 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "杨萧玉";
TargetAttributes = {
A4910BF61C1FFD95009D25F9 = {
Expand Down Expand Up @@ -376,12 +376,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -427,12 +429,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -37,7 +36,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -46,7 +45,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
8 changes: 1 addition & 7 deletions Source/TBActionSheet/TBActionButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)dealloc
- (void)setHighlighted:(BOOL)highlighted {
[super setHighlighted:highlighted];
if (highlighted) {
if (self.highlightedColor) {
if (self.highlightedColor && !self.currentBackgroundImage) {
self.backgroundColor = self.highlightedColor;
}
else {
Expand All @@ -62,10 +62,4 @@ - (void)setHighlighted:(BOOL)highlighted {
}
}

- (void)setNormalColor:(UIColor *)normalColor
{
_normalColor = normalColor;
self.backgroundColor = normalColor;
}

@end
23 changes: 2 additions & 21 deletions Source/TBActionSheet/TBActionSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ @interface TBActionSheet () <UIScrollViewDelegate>
@property (nonatomic,strong,nullable,readwrite) UILabel *messageLabel;
@property (weak, nonatomic, readwrite) UIWindow *previousKeyWindow;
@property (strong, nonatomic) UIWindow *window;
//@property (weak, nonatomic) NSTimer *timer;
@property (strong, nonatomic, nullable) UIImage *originalBackgroundImage;
@property (strong, nonatomic) NSMutableArray<TBBlurEffectBlock> *blurBlocks;

Expand Down Expand Up @@ -623,25 +622,17 @@ - (void)setupStyle
[obj setBackgroundImage:nil forState:UIControlStateNormal];
[obj setBackgroundImage:nil forState:UIControlStateHighlighted];
}
obj.normalColor = nil;
obj.highlightedColor = nil;
obj.backgroundColor = [UIColor clearColor];
}
else {
[obj setBackgroundImage:nil forState:UIControlStateNormal];
[obj setBackgroundImage:nil forState:UIControlStateHighlighted];
if (!obj.normalColor) {
obj.normalColor = self.ambientColor;
}
obj.backgroundColor = obj.normalColor ?: self.ambientColor;
if (!obj.highlightedColor) {
obj.highlightedColor = [UIColor colorWithWhite:0.5 alpha:0.5];
}
}
}];

if (useBoxBlurEffect) {
// 性能问题,暂时关闭
// [self.timer fire];
}
}

- (void)refreshBlurEffect
Expand All @@ -666,10 +657,6 @@ - (void)setupContainerFrame
*/
- (void)show
{
// [self.timer invalidate];
// self.timer = nil;
// self.timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(refreshBlurEffect) userInfo:nil repeats:YES];

if ([self.delegate respondsToSelector:@selector(willPresentAlertView:)]) {
[self.delegate willPresentActionSheet:self];
}
Expand Down Expand Up @@ -717,9 +704,6 @@ - (void)showInView:(UIView *)view
*/
- (void)buttonTapped:(TBActionButton *)sender
{
// [self.timer invalidate];
// self.timer = nil;

if (![self isVisible]) {
return;
}
Expand Down Expand Up @@ -760,9 +744,6 @@ - (void)buttonTapped:(TBActionButton *)sender
*/
- (void)close
{
// [self.timer invalidate];
// self.timer = nil;

if (![self isVisible]) {
return;
}
Expand Down
7 changes: 6 additions & 1 deletion Source/TBActionSheet/TBActionSheetController.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ - (BOOL)prefersStatusBarHidden
return [[window tb_viewControllerForStatusBarHidden] prefersStatusBarHidden];
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if (self.actionSheet.blurEffectEnabled && ((kiOS10Later && self.actionSheet.rectCornerRadius > 0) || !kiOS8Later)) {
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
if (self.actionSheet.blurEffectEnabled && !kiOS8Later) {
[self.actionSheet setupStyle];
}
}
#pragma clang diagnostic pop

@end
2 changes: 1 addition & 1 deletion TBActionSheet.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "TBActionSheet"
s.version = "1.5.6"
s.version = "1.6.0"
s.summary = "A Custom&Magical ActionSheet."
s.description = <<-DESC
TBActionSheet is a small library that allows you to substitute Apple's uncustomizable UIActionSheet, with a beautiful and totally customizable actionsheet that you can use in your iOS app. The default style is iOS9/10, you can make your own style. Enjoy!
Expand Down

0 comments on commit da4d321

Please sign in to comment.