Skip to content

Commit

Permalink
2.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLice committed Jul 5, 2018
1 parent 33afad6 commit cab48b1
Show file tree
Hide file tree
Showing 46 changed files with 1,300 additions and 761 deletions.
6 changes: 5 additions & 1 deletion QMUIKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "QMUIKit"
s.version = "2.7.1"
s.version = "2.7.2"
s.summary = "致力于提高项目 UI 开发效率的解决方案"
s.description = <<-DESC
QMUI iOS 是一个致力于提高项目 UI 开发效率的解决方案,其设计目的是用于辅助快速搭建一个具备基本设计还原效果的 iOS 项目,同时利用自身提供的丰富控件及兼容处理, 让开发者能专注于业务需求而无需耗费精力在基础代码的设计上。不管是新项目的创建,或是已有项目的维护,均可使开发效率和项目质量得到大幅度提升。
Expand Down Expand Up @@ -265,6 +265,10 @@ Pod::Spec.new do |s|
sss.dependency 'QMUIKit/QMUIComponents/QMUIToastView'
sss.dependency 'QMUIKit/QMUIResources'
end

ss.subspec 'QMUIVisualEffectView' do |sss|
sss.source_files = 'QMUIKit/QMUIComponents/QMUIVisualEffectView.{h,m}'
end

ss.subspec 'QMUIZoomImageView' do |sss|
sss.source_files = 'QMUIKit/QMUIComponents/QMUIZoomImageView.{h,m}'
Expand Down
2 changes: 1 addition & 1 deletion QMUIKit/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>2.7.1</string>
<string>2.7.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
27 changes: 13 additions & 14 deletions QMUIKit/QMUIComponents/AssetLibrary/QMUIAsset.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,26 @@
#import <UIKit/UIKit.h>
#import <Photos/PHImageManager.h>

/// Asset 的类型
typedef NS_ENUM(NSUInteger, QMUIAssetType) {
QMUIAssetTypeUnknow, // 未知类型的 Asset
QMUIAssetTypeImage, // 图片类型的 Asset
QMUIAssetTypeVideo, // 视频类型的 Asset
QMUIAssetTypeAudio // 音频类型的 Asset
QMUIAssetTypeUnknow,
QMUIAssetTypeImage,
QMUIAssetTypeVideo,
QMUIAssetTypeAudio
};

typedef NS_ENUM(NSUInteger, QMUIAssetSubType) {
QMUIAssetSubTypeUnknow, // 未知类型
QMUIAssetSubTypeImage, // 静态图片类型
QMUIAssetSubTypeLivePhoto NS_ENUM_AVAILABLE_IOS(9_1), // Live Photo 类型
QMUIAssetSubTypeGIF // GIF类型
QMUIAssetSubTypeUnknow,
QMUIAssetSubTypeImage,
QMUIAssetSubTypeLivePhoto NS_ENUM_AVAILABLE_IOS(9_1),
QMUIAssetSubTypeGIF
};

/// 从 iCloud 请求 Asset 大图的状态
/// Status when download asset from iCloud
typedef NS_ENUM(NSUInteger, QMUIAssetDownloadStatus) {
QMUIAssetDownloadStatusSucceed, // 下载成功或资源本来已经在本地
QMUIAssetDownloadStatusDownloading, // 下载中
QMUIAssetDownloadStatusCanceled, // 取消下载
QMUIAssetDownloadStatusFailed, // 下载失败
QMUIAssetDownloadStatusSucceed,
QMUIAssetDownloadStatusDownloading,
QMUIAssetDownloadStatusCanceled,
QMUIAssetDownloadStatusFailed
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ - (void)initSubviews {

_operationToolBarView = [[UIView alloc] init];
self.operationToolBarView.backgroundColor = UIColorWhite;
self.operationToolBarView.qmui_borderPosition = QMUIBorderViewPositionTop;
self.operationToolBarView.qmui_borderPosition = QMUIViewBorderPositionTop;
[self.view addSubview:self.operationToolBarView];

_sendButton = [[QMUIButton alloc] init];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ + (void)load {
dispatch_once(&onceToken, ^{
Class cls = [self class];
ExchangeImplementations(cls, @selector(pushViewController:animated:), @selector(NavigationBarTransition_pushViewController:animated:));
ExchangeImplementations(cls, @selector(setViewControllers:animated:), @selector(NavigationBarTransition_setViewControllers:animated:));
ExchangeImplementations(cls, @selector(popViewControllerAnimated:), @selector(NavigationBarTransition_popViewControllerAnimated:));
ExchangeImplementations(cls, @selector(popToViewController:animated:), @selector(NavigationBarTransition_popToViewController:animated:));
ExchangeImplementations(cls, @selector(popToRootViewControllerAnimated:), @selector(NavigationBarTransition_popToRootViewControllerAnimated:));
Expand Down Expand Up @@ -513,6 +514,19 @@ - (void)NavigationBarTransition_pushViewController:(UIViewController *)viewContr
return [self NavigationBarTransition_pushViewController:viewController animated:animated];
}

- (void)NavigationBarTransition_setViewControllers:(NSArray<UIViewController *> *)viewControllers animated:(BOOL)animated {
if (viewControllers.count <= 0 || !animated) {
return [self NavigationBarTransition_setViewControllers:viewControllers animated:animated];
}
UIViewController *disappearingViewController = self.viewControllers.lastObject;
UIViewController *appearingViewController = viewControllers.lastObject;
if (!disappearingViewController) {
return [self NavigationBarTransition_setViewControllers:viewControllers animated:animated];
}
[self handlePopViewControllerNavigationBarTransitionWithDisappearViewController:disappearingViewController appearViewController:appearingViewController];
return [self NavigationBarTransition_setViewControllers:viewControllers animated:animated];
}

- (UIViewController *)NavigationBarTransition_popViewControllerAnimated:(BOOL)animated {
UIViewController *disappearingViewController = self.viewControllers.lastObject;
UIViewController *appearingViewController = self.viewControllers.count >= 2 ? self.viewControllers[self.viewControllers.count - 2] : nil;
Expand Down
14 changes: 10 additions & 4 deletions QMUIKit/QMUIComponents/QMUIAlertController.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ typedef NS_ENUM(NSInteger, QMUIAlertControllerStyle) {
*
* @param title 按钮标题
* @param style 按钮style,跟系统一样,有 Default、Cancel、Destructive 三种类型
* @param handler 处理点击时间的block
* @param handler 处理点击事件的block,注意 QMUIAlertAction 点击后必定会隐藏 alertController,不需要手动在 handler 里 hide
*
* @return QMUIAlertController按钮的实例
*/
+ (instancetype)actionWithTitle:(NSString *)title style:(QMUIAlertActionStyle)style handler:(void (^)(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action))handler;
+ (instancetype)actionWithTitle:(nullable NSString *)title style:(QMUIAlertActionStyle)style handler:(nullable void (^)(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action))handler;

/// `QMUIAlertAction`对应的 button 对象
@property(nonatomic, strong, readonly) QMUIButton *button;
Expand Down Expand Up @@ -86,7 +86,7 @@ typedef NS_ENUM(NSInteger, QMUIAlertControllerStyle) {
@property(nonatomic, assign) CGFloat alertContentMaximumWidth UI_APPEARANCE_SELECTOR;

/// alert上分隔线颜色,默认UIColorMake(211, 211, 219)。
@property(nonatomic, strong) UIColor *alertSeperatorColor UI_APPEARANCE_SELECTOR;
@property(nonatomic, strong) UIColor *alertSeparatorColor UI_APPEARANCE_SELECTOR;

/// alert标题样式,默认@{NSForegroundColorAttributeName:UIColorBlack,NSFontAttributeName:UIFontBoldMake(17),NSParagraphStyleAttributeName:[NSMutableParagraphStyle qmui_paragraphStyleWithLineHeight:0 lineBreakMode:NSLineBreakByTruncatingTail]}
@property(nonatomic, strong) NSDictionary<NSString *, id> *alertTitleAttributes UI_APPEARANCE_SELECTOR;
Expand Down Expand Up @@ -144,7 +144,7 @@ typedef NS_ENUM(NSInteger, QMUIAlertControllerStyle) {
@property(nonatomic, assign) CGFloat sheetContentMaximumWidth UI_APPEARANCE_SELECTOR;

/// sheet分隔线颜色,默认UIColorMake(211, 211, 219)
@property(nonatomic, strong) UIColor *sheetSeperatorColor UI_APPEARANCE_SELECTOR;
@property(nonatomic, strong) UIColor *sheetSeparatorColor UI_APPEARANCE_SELECTOR;

/// sheet标题样式,默认@{NSForegroundColorAttributeName:UIColorMake(143, 143, 143),NSFontAttributeName:UIFontBoldMake(13),NSParagraphStyleAttributeName:[NSMutableParagraphStyle qmui_paragraphStyleWithLineHeight:0 lineBreakMode:NSLineBreakByTruncatingTail]}
@property(nonatomic, copy) NSDictionary<NSString *, id> *sheetTitleAttributes UI_APPEARANCE_SELECTOR;
Expand Down Expand Up @@ -240,6 +240,12 @@ typedef NS_ENUM(NSInteger, QMUIAlertControllerStyle) {
/// 将`QMUIAlertController`弹出来的`QMUIModalPresentationViewController`对象
@property(nonatomic, strong, readonly) QMUIModalPresentationViewController *modalPresentationViewController;

/// 主体内容(alert 下指整个弹窗,actionSheet 下指取消按钮上方的那些 header 和 按钮)背后用来做背景样式的 view,默认为空白的 UIView,当你需要做磨砂效果时可以将一个 UIVisualEffectView 赋值给它(但推荐用 QMUIVisualEffectView)。当赋值为 nil 时,内部会自动创建一个空白的 UIView 代替,以保证这个属性不为空。
@property(nonatomic, strong) UIView *mainVisualEffectView;

/// actionSheet 下的取消按钮背后用来做背景样式的 view,默认为空白的 UIView,当你需要做磨砂效果时可以将一个 UIVisualEffectView 赋值给它(但推荐用 QMUIVisualEffectView)。alert 情况下不会出现。当赋值为 nil 时,内部会自动创建一个空白的 UIView 代替,以保证这个属性不为空。
@property(nonatomic, strong) UIView *cancelButtonVisualEffectView;

/**
* 设置按钮的排序是否要由用户添加的顺序来决定,默认为NO,也即与系统原生`UIAlertController`一致,QMUIAlertActionStyleDestructive 类型的action必定在最后面。
*
Expand Down
Loading

0 comments on commit cab48b1

Please sign in to comment.