Skip to content

Commit

Permalink
v1.5.5
Browse files Browse the repository at this point in the history
update to Xcode 9 & iOS 11
  • Loading branch information
yulingtianxia committed Sep 22, 2017
1 parent f7f0869 commit 1f8c957
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 18 deletions.
14 changes: 13 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 = 0800;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = "杨萧玉";
TargetAttributes = {
A4910BF61C1FFD95009D25F9 = {
Expand Down Expand Up @@ -372,14 +372,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -417,14 +423,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
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 = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -36,6 +37,7 @@
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 = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -45,6 +46,7 @@
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
Expand Up @@ -39,6 +39,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
22 changes: 13 additions & 9 deletions Source/TBActionSheet/TBActionContainer.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,22 @@ - (instancetype)initWithSheet:(TBActionSheet *)actionSheet
return self;
}

- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
- (BOOL)isSupportSystemBlurEffect
{

// iOS 10 圆角毛玻璃有 bug,使用 box blur 方案
if (kiOS10Later && !kiOS11Later && self.actionSheet.rectCornerRadius > 0) {
return NO;
}
// iOS 8 之后才支持
if (!kiOS8Later) {
return NO;
}
return YES;
}

- (BOOL)useSystemBlurEffect
{
if (kiOS10Later && self.actionSheet.rectCornerRadius > 0) {
return NO;
}
if (kiOS8Later) {
if ([self isSupportSystemBlurEffect]) {
self.backgroundColor = self.actionSheet.ambientColor;
self.layer.masksToBounds = YES;
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
Expand All @@ -74,10 +79,10 @@ - (BOOL)useSystemBlurEffectUnderView:(UIView *)view

- (BOOL)useSystemBlurEffectUnderView:(UIView *)view withColor:(UIColor *)color
{
if (!view || (kiOS10Later && self.actionSheet.rectCornerRadius > 0)) {
if (!view) {
return NO;
}
if (kiOS8Later) {
if ([self isSupportSystemBlurEffect]) {
UIView *colorView = [[UIView alloc] initWithFrame:view.frame];
colorView.backgroundColor = color ? color : self.actionSheet.ambientColor;
colorView.layer.masksToBounds = YES;
Expand All @@ -101,7 +106,6 @@ - (BOOL)useSystemBlurEffectUnderView:(UIView *)view withColor:(UIColor *)color
TBActionButton *btn = (TBActionButton *)view;
btn.behindColorView = colorView;
}

return YES;
}
return NO;
Expand Down
7 changes: 3 additions & 4 deletions Source/TBActionSheet/TBActionSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ - (instancetype)init
[self addSubview:_background];
_scrollView = [[UIScrollView alloc] initWithFrame:self.bounds];
_scrollView.delegate = self;
_scrollView.showsVerticalScrollIndicator = NO;
[self addSubview:_scrollView];
_actionContainer = [[TBActionContainer alloc] initWithSheet:self];
[_scrollView addSubview:_actionContainer];
Expand Down Expand Up @@ -443,8 +444,6 @@ - (void)setupStyle

self.originalBackgroundImage = [self screenShotRect:CGRectMake(kContainerLeft, kScreenHeight-containerHeight, self.sheetWidth, containerHeight)];

CGFloat heightLargerThanImage = containerHeight - self.originalBackgroundImage.size.height;// 计算 container 的高度超出截图的数值

__block BOOL useBoxBlurEffect = NO;
// self.displayLink.paused = YES;

Expand Down Expand Up @@ -651,7 +650,7 @@ - (void)refreshBlurEffect

self.originalBackgroundImage = [self screenShotRect:CGRectMake(kContainerLeft, kScreenHeight-containerHeight, self.sheetWidth, containerHeight)];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
for (void (^blurBlock)() in self.blurBlocks) {
for (void (^blurBlock)(void) in self.blurBlocks) {
blurBlock();
}
});
Expand Down Expand Up @@ -820,7 +819,7 @@ - (void)statusBarDidChangeOrientation:(NSNotification *)notification {

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
for (void (^blurBlock)() in self.blurBlocks) {
for (void (^blurBlock)(void) in self.blurBlocks) {
blurBlock();
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/TBAlertController/TBAlertController.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef NS_ENUM(NSInteger, TBAlertControllerStyle) {
@property (nullable,nonatomic,weak) UIViewController *ownerController;
@property (nullable,nonatomic,strong) UIColor *tintColor;
@property(nonatomic,assign) UIAlertViewStyle alertViewStyle;
@property (nonatomic, copy, nullable) void (^completion)();// Don't use this.
@property (nonatomic, copy, nullable) void (^completion)(void);// Don't use this.

+ (instancetype)alertControllerWithTitle:(nullable NSString *)title message:(nullable NSString *)message preferredStyle:(TBAlertControllerStyle)preferredStyle;
- (void)addAction:(TBAlertAction *)action;
Expand Down
1 change: 1 addition & 0 deletions Source/Utils/TBMacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ _Pragma("clang diagnostic pop")
#define kiOS8Later SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")
#define kiOS9Later SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")
#define kiOS10Later SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")
#define kiOS11Later SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
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.4"
s.version = "1.5.5"
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 1f8c957

Please sign in to comment.