Skip to content

Commit

Permalink
准备发布1.1.6版本, Demo工程消除警告, 优化微信风格ActionSheet样式细节适配
Browse files Browse the repository at this point in the history
  • Loading branch information
lixiang1994 committed May 30, 2018
1 parent c0c7eb1 commit 9e5e3ba
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Framework/LEEAlert/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.5</string>
<string>1.1.6</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
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>
4 changes: 2 additions & 2 deletions LEEAlert.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "LEEAlert"
s.version = "1.1.5"
s.version = "1.1.6"
s.summary = "优雅的Alert ActionSheet"

s.homepage = "https://github.com/lixiang1994/LEEAlert"
Expand All @@ -13,7 +13,7 @@ s.author = { "LEE" => "18611401994@163.com" }
s.platform = :ios
s.platform = :ios, "8.0"

s.source = { :git => "https://github.com/lixiang1994/LEEAlert.git", :tag => "1.1.5"}
s.source = { :git => "https://github.com/lixiang1994/LEEAlert.git", :tag => "1.1.6"}

s.source_files = "LEEAlert/**/*.{h,m}"

Expand Down
9 changes: 5 additions & 4 deletions LEEAlert/LEEAlert.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @brief LEEAlert
*
* @author LEE
* @copyright Copyright © 2016 - 2017年 lee. All rights reserved.
* @version V1.1.5
* @copyright Copyright © 2016 - 2018年 lee. All rights reserved.
* @version V1.1.6
*/

#import <Foundation/Foundation.h>
Expand Down Expand Up @@ -229,6 +229,9 @@

/** ✨actionSheet 专用设置 */

/** 设置 ActionSheet的背景视图颜色 -> 格式: .LeeActionSheetBackgroundColor(UIColor) */
@property (nonatomic , copy , readonly ) LEEConfigToColor LeeActionSheetBackgroundColor;

/** 设置 取消动作的间隔宽度 -> 格式: .LeeActionSheetCancelActionSpaceWidth(10.0f) */
@property (nonatomic , copy , readonly ) LEEConfigToFloat LeeActionSheetCancelActionSpaceWidth;

Expand All @@ -238,8 +241,6 @@
/** 设置 ActionSheet距离屏幕底部的间距 -> 格式: .LeeActionSheetBottomMargin(10.0f) */
@property (nonatomic , copy , readonly ) LEEConfigToFloat LeeActionSheetBottomMargin;



/** 设置 当前关闭回调 -> 格式: .LeeCloseComplete(^{ //code.. }) */
@property (nonatomic , copy , readonly ) LEEConfigToBlock LeeCloseComplete;

Expand Down
37 changes: 27 additions & 10 deletions LEEAlert/LEEAlert.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @brief LEEAlert
*
* @author LEE
* @copyright Copyright © 2016 - 2017年 lee. All rights reserved.
* @version V1.1.5
* @copyright Copyright © 2016 - 2018年 lee. All rights reserved.
* @version V1.1.6
*/

#import "LEEAlert.h"
Expand Down Expand Up @@ -85,6 +85,7 @@ @interface LEEAlertConfigModel ()
@property (nonatomic , assign ) UIBlurEffectStyle modelBackgroundBlurEffectStyle;
@property (nonatomic , assign ) UIInterfaceOrientationMask modelSupportedInterfaceOrientations;

@property (nonatomic , strong ) UIColor *modelActionSheetBackgroundColor;
@property (nonatomic , strong ) UIColor *modelActionSheetCancelActionSpaceColor;
@property (nonatomic , assign ) CGFloat modelActionSheetCancelActionSpaceWidth;
@property (nonatomic , assign ) CGFloat modelActionSheetBottomMargin;
Expand Down Expand Up @@ -119,6 +120,7 @@ - (instancetype)init
_modelQueuePriority = 0; //默认队列优先级 (大于0时才会加入队列)


_modelActionSheetBackgroundColor = [UIColor clearColor]; //默认actionsheet背景颜色
_modelActionSheetCancelActionSpaceColor = [UIColor clearColor]; //默认actionsheet取消按钮间隔颜色
_modelActionSheetCancelActionSpaceWidth = 10.0f; //默认actionsheet取消按钮间隔宽度
_modelActionSheetBottomMargin = 10.0f; //默认actionsheet距离屏幕底部距离
Expand Down Expand Up @@ -888,6 +890,19 @@ - (LEEConfigToFloat)LeeActionSheetBottomMargin{

}

- (LEEConfigToColor)LeeActionSheetBackgroundColor{

__weak typeof(self) weakSelf = self;

return ^(UIColor *color){

if (weakSelf) weakSelf.modelActionSheetBackgroundColor = color;

return weakSelf;
};

}

- (LEEConfigToBlock)LeeCloseComplete{

__weak typeof(self) weakSelf = self;
Expand Down Expand Up @@ -2519,15 +2534,15 @@ - (void)updateActionSheetLayoutWithViewWidth:(CGFloat)viewWidth ViewHeight:(CGFl

actionSheetViewFrame.size.height = actionSheetViewHeight > actionSheetViewMaxHeight - cancelActionTotalHeight ? actionSheetViewMaxHeight - cancelActionTotalHeight : actionSheetViewHeight;

actionSheetViewFrame.origin.x = 0;
actionSheetViewFrame.origin.x = (viewWidth - actionSheetViewMaxWidth) * 0.5f;

self.actionSheetView.frame = actionSheetViewFrame;

if (self.actionSheetCancelAction) {

CGRect spaceFrame = self.actionSheetCancelActionSpaceView.frame;

spaceFrame.origin.x = 0;
spaceFrame.origin.x = actionSheetViewFrame.origin.x;

spaceFrame.origin.y = actionSheetViewFrame.origin.y + actionSheetViewFrame.size.height;

Expand All @@ -2539,7 +2554,7 @@ - (void)updateActionSheetLayoutWithViewWidth:(CGFloat)viewWidth ViewHeight:(CGFl

CGRect buttonFrame = self.actionSheetCancelAction.frame;

buttonFrame.origin.x = 0;
buttonFrame.origin.x = actionSheetViewFrame.origin.x;

buttonFrame.origin.y = actionSheetViewFrame.origin.y + actionSheetViewFrame.size.height + spaceFrame.size.height;

Expand All @@ -2550,15 +2565,15 @@ - (void)updateActionSheetLayoutWithViewWidth:(CGFloat)viewWidth ViewHeight:(CGFl

CGRect containerFrame = self.containerView.frame;

containerFrame.size.width = actionSheetViewFrame.size.width;
containerFrame.size.width = viewWidth;

containerFrame.size.height = actionSheetViewFrame.size.height + cancelActionTotalHeight;
containerFrame.size.height = actionSheetViewFrame.size.height + cancelActionTotalHeight + VIEWSAFEAREAINSETS(self.view).bottom + self.config.modelActionSheetBottomMargin;

containerFrame.origin.x = (viewWidth - actionSheetViewMaxWidth) * 0.5f;
containerFrame.origin.x = 0;

if (isShowed) {

containerFrame.origin.y = (viewHeight - containerFrame.size.height - VIEWSAFEAREAINSETS(self.view).bottom) - self.config.modelActionSheetBottomMargin;
containerFrame.origin.y = viewHeight - containerFrame.size.height;

} else {

Expand All @@ -2578,6 +2593,8 @@ - (void)configActionSheet{

[self.containerView addSubview: self.actionSheetView];

self.containerView.backgroundColor = self.config.modelActionSheetBackgroundColor;

self.containerView.layer.shadowOffset = self.config.modelShadowOffset;

self.containerView.layer.shadowRadius = self.config.modelShadowRadius;
Expand Down Expand Up @@ -2926,7 +2943,7 @@ - (void)showAnimationsWithCompletionBlock:(void (^)(void))completionBlock{

containerFrame.origin.x = (viewWidth - containerFrame.size.width) * 0.5f;

containerFrame.origin.y = (viewHeight - containerFrame.size.height) - weakSelf.config.modelActionSheetBottomMargin - VIEWSAFEAREAINSETS(weakSelf.view).bottom;
containerFrame.origin.y = viewHeight - containerFrame.size.height;

weakSelf.containerView.frame = containerFrame;

Expand Down
4 changes: 2 additions & 2 deletions LEEAlert/LEEAlertHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @brief LEEAlertHelper
*
* @author LEE
* @copyright Copyright © 2016 - 2017年 lee. All rights reserved.
* @version V1.1.5
* @copyright Copyright © 2016 - 2018年 lee. All rights reserved.
* @version V1.1.6
*/

#ifndef LEEAlertHelper_h
Expand Down
14 changes: 10 additions & 4 deletions LEEAlertDemo/LEEAlertDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,12 @@
9B0BB21D1E8E28760087D231 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = lee;
TargetAttributes = {
9B0BB2241E8E28760087D231 = {
CreatedOnToolsVersion = 8.3;
DevelopmentTeam = 8K4E58U732;
DevelopmentTeam = 3GNXU2LRUU;
ProvisioningStyle = Automatic;
};
9B0BB23D1E8E28760087D231 = {
Expand Down Expand Up @@ -512,13 +512,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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 @@ -566,13 +568,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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 @@ -604,7 +608,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 8K4E58U732;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
DEVELOPMENT_TEAM = 3GNXU2LRUU;
INFOPLIST_FILE = LEEAlertDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -618,7 +623,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 8K4E58U732;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
DEVELOPMENT_TEAM = 3GNXU2LRUU;
INFOPLIST_FILE = LEEAlertDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
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>
1 change: 1 addition & 0 deletions LEEAlertDemo/LEEAlertDemo/ActionSheetTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ - (void)demo:(NSInteger)index{

return CGRectGetWidth([[UIScreen mainScreen] bounds]);
})
.LeeActionSheetBackgroundColor([UIColor whiteColor]) // 通过设置背景颜色来填充底部间隙
.LeeShow();
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "icon.png",
"scale" : "1x"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 4 additions & 21 deletions LEEAlertDemo/LEEAlertDemo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina5_9" orientation="landscape">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina5_9" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment version="4352" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="812" height="375"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="cKx-tJ-VFx"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<scenes/>
</document>
2 changes: 1 addition & 1 deletion LEEAlertDemo/LEEAlertDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<false/>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ typedef SDAutoLayoutModel *(^MarginEqualToView)(UIView *toView);
typedef SDAutoLayoutModel *(^WidthHeight)(CGFloat value);
typedef SDAutoLayoutModel *(^WidthHeightEqualToView)(UIView *toView, CGFloat ratioValue);
typedef SDAutoLayoutModel *(^AutoHeightWidth)(CGFloat ratioValue);
typedef SDAutoLayoutModel *(^SameWidthHeight)();
typedef SDAutoLayoutModel *(^SameWidthHeight)(void);
typedef SDAutoLayoutModel *(^Offset)(CGFloat value);
typedef void (^SpaceToSuperView)(UIEdgeInsets insets);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
/**
* 关闭Block
*/
@property (nonatomic , copy ) void (^closeBlock)();
@property (nonatomic , copy ) void (^closeBlock)(void);

@end
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
/**
* 关闭Block
*/
@property (nonatomic , copy ) void (^closeBlock)();
@property (nonatomic , copy ) void (^closeBlock)(void);

@end
5 changes: 5 additions & 0 deletions UPDATELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

# LEEAlert - 更新日志


V1.1.6
==============
- 增加ActionSheet背景视图颜色设置方法, 可通过设置颜色解决填充底部间隙的效果.

V1.1.5
==============
- 优化阴影处理, 增加阴影偏移 颜色 透明度等设置方法
Expand Down

0 comments on commit 9e5e3ba

Please sign in to comment.