Skip to content

Commit f7f7c86

Browse files
committed
新版本更新,包含 iOS 11 适配等大量更新点
1 parent ca92e3b commit f7f7c86

File tree

91 files changed

+2252
-1738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2252
-1738
lines changed

QMUIConfigurationTemplate/QMUIConfigurationTemplate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// QMUIConfigurationTemplate.h
33
//
4-
// Created by QQMail on 15/3/29.
4+
// Created by QMUI Team on 15/3/29.
55
// Copyright (c) 2015年 QMUI Team. All rights reserved.
66
//
77

QMUIConfigurationTemplate/QMUIConfigurationTemplate.m

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// QMUIConfigurationTemplate.m
33
// qmui
44
//
5-
// Created by QQMail on 15/3/29.
5+
// Created by QMUI Team on 15/3/29.
66
// Copyright (c) 2015年 QMUI Team. All rights reserved.
77
//
88

@@ -79,7 +79,7 @@ + (void)setupConfigurationTemplate {
7979
QMUICMI.navBarBackgroundImage = nil; // NavBarBackgroundImage : UINavigationBar 的背景图
8080
QMUICMI.navBarShadowImage = nil; // NavBarShadowImage : UINavigationBar.shadowImage,也即导航栏底部那条分隔线
8181
QMUICMI.navBarBarTintColor = nil; // NavBarBarTintColor : UINavigationBar.barTintColor,也即背景色
82-
QMUICMI.navBarTintColor = nil; // NavBarTintColor : UINavigationBar 的 tintColor,也即导航栏上面的按钮颜色
82+
QMUICMI.navBarTintColor = nil; // NavBarTintColor : QMUINavigationBar 的 tintColor,也即导航栏上面的按钮颜色
8383
QMUICMI.navBarTitleColor = UIColorBlack; // NavBarTitleColor : UINavigationBar 的标题颜色,以及 QMUINavigationTitleView 的默认文字颜色
8484
QMUICMI.navBarTitleFont = nil; // NavBarTitleFont : UINavigationBar 的标题字体,以及 QMUINavigationTitleView 的默认字体
8585
QMUICMI.navBarBackButtonTitlePositionAdjustment = UIOffsetZero; // NavBarBarBackButtonTitlePositionAdjustment : 导航栏返回按钮的文字偏移
@@ -129,6 +129,8 @@ + (void)setupConfigurationTemplate {
129129

130130
#pragma mark - TableView / TableViewCell
131131

132+
QMUICMI.tableViewEstimatedHeightEnabled = YES; // TableViewEstimatedHeightEnabled : 是否要开启全局 UITableView 的 estimatedRow(Section/Footer)Height
133+
132134
QMUICMI.tableViewBackgroundColor = nil; // TableViewBackgroundColor : Plain 类型的 QMUITableView 的背景色颜色
133135
QMUICMI.tableViewGroupedBackgroundColor = nil; // TableViewGroupedBackgroundColor : Grouped 类型的 QMUITableView 的背景色
134136
QMUICMI.tableSectionIndexColor = nil; // TableSectionIndexColor : 列表右边的字母索引条的文字颜色
@@ -169,6 +171,11 @@ + (void)setupConfigurationTemplate {
169171
QMUICMI.windowLevelQMUIAlertView = UIWindowLevelAlert - 4.0; // UIWindowLevelQMUIAlertView : QMUIModalPresentationViewController、QMUIPopupContainerView 里使用的 UIWindow 的 windowLevel
170172
QMUICMI.windowLevelQMUIImagePreviewView = UIWindowLevelStatusBar + 1.0; // UIWindowLevelQMUIImagePreviewView : QMUIImagePreviewViewController 里使用的 UIWindow 的 windowLevel
171173

174+
#pragma mark - QMUILog
175+
QMUICMI.shouldPrintDefaultLog = YES; // ShouldPrintDefaultLog : 是否允许输出 QMUILogLevelDefault 级别的 log
176+
QMUICMI.shouldPrintInfoLog = YES; // ShouldPrintInfoLog : 是否允许输出 QMUILogLevelInfo 级别的 log
177+
QMUICMI.shouldPrintWarnLog = YES; // ShouldPrintInfoLog : 是否允许输出 QMUILogLevelWarn 级别的 log
178+
172179
#pragma mark - Others
173180

174181
QMUICMI.supportedOrientationMask = UIInterfaceOrientationMaskPortrait; // SupportedOrientationMask : 默认支持的横竖屏方向
@@ -177,6 +184,7 @@ + (void)setupConfigurationTemplate {
177184
QMUICMI.needsBackBarButtonItemTitle = NO; // NeedsBackBarButtonItemTitle : 全局是否需要返回按钮的 title,不需要则只显示一个返回image
178185
QMUICMI.hidesBottomBarWhenPushedInitially = NO; // HidesBottomBarWhenPushedInitially : QMUICommonViewController.hidesBottomBarWhenPushed 的初始值,默认为 NO,以保持与系统默认值一致,但通常建议改为 YES,因为一般只有 tabBar 首页那几个界面要求为 NO
179186
QMUICMI.navigationBarHiddenInitially = NO; // NavigationBarHiddenInitially : QMUINavigationControllerDelegate preferredNavigationBarHidden 的初始值,默认为NO
187+
QMUICMI.shouldFixTabBarTransitionBugInIPhoneX = NO; // ShouldFixTabBarTransitionBugInIPhoneX : 是否需要自动修复 iOS 11 下,iPhone X 的设备在 push 界面时,tabBar 会瞬间往上跳的 bug
180188
}
181189

182190
@end

QMUIKit/QMUIComponents/AssetLibrary/QMUIAsset.h

+22-26
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111

1212
/// Asset 的类型
1313
typedef NS_ENUM(NSUInteger, QMUIAssetType) {
14-
QMUIAssetTypeUnknow, // 未知类型的 Asset
15-
QMUIAssetTypeImage, // 图片类型的 Asset
16-
QMUIAssetTypeVideo, // 视频类型的 Asset
17-
QMUIAssetTypeAudio NS_ENUM_AVAILABLE_IOS(8_0), // 音频类型的 Asset,仅被 PhotoKit 支持,因此只适用于 iOS 8.0
18-
QMUIAssetTypeLivePhoto NS_ENUM_AVAILABLE_IOS(9_1) // Live Photo 类型的 Asset,仅被 PhotoKit 支持,因此只适用于 iOS 9.1
14+
QMUIAssetTypeUnknow, // 未知类型的 Asset
15+
QMUIAssetTypeImage, // 图片类型的 Asset
16+
QMUIAssetTypeVideo, // 视频类型的 Asset
17+
QMUIAssetTypeAudio // 音频类型的 Asset
18+
};
19+
20+
typedef NS_ENUM(NSUInteger, QMUIAssetSubType) {
21+
QMUIAssetSubTypeUnknow, // 未知类型
22+
QMUIAssetSubTypeImage, // 静态图片类型
23+
QMUIAssetSubTypeLivePhoto NS_ENUM_AVAILABLE_IOS(9_1), // Live Photo 类型
24+
QMUIAssetSubTypeGIF // GIF类型
1925
};
2026

2127
/// 从 iCloud 请求 Asset 大图的状态
@@ -27,17 +33,15 @@ typedef NS_ENUM(NSUInteger, QMUIAssetDownloadStatus) {
2733
};
2834

2935

30-
@class ALAsset;
3136
@class PHAsset;
3237

3338
@interface QMUIAsset : NSObject
3439

3540
@property(nonatomic, assign, readonly) QMUIAssetType assetType;
41+
@property(nonatomic, assign, readonly) QMUIAssetSubType assetSubType;
3642

3743
- (instancetype)initWithPHAsset:(PHAsset *)phAsset;
3844

39-
- (instancetype)initWithALAsset:(ALAsset *)alAsset;
40-
4145
@property(nonatomic, assign, readonly) QMUIAssetDownloadStatus downloadStatus; // 从 iCloud 下载资源大图的状态
4246
@property(nonatomic, assign) double downloadProgress; // 从 iCloud 下载资源大图的进度
4347
@property(nonatomic, assign) NSInteger requestID; // 从 iCloud 请求获得资源的大图的请求 ID
@@ -48,7 +52,7 @@ typedef NS_ENUM(NSUInteger, QMUIAssetDownloadStatus) {
4852
/**
4953
* Asset 的缩略图
5054
*
51-
* @param size 指定返回的缩略图的大小,仅在 iOS 8.0 及以上的版本有效,其他版本则调用 ALAsset 的接口由系统返回一个合适当前平台的图片
55+
* @param size 指定返回的缩略图的大小
5256
*
5357
* @return Asset 的缩略图
5458
*/
@@ -57,29 +61,27 @@ typedef NS_ENUM(NSUInteger, QMUIAssetDownloadStatus) {
5761
/**
5862
* Asset 的预览图
5963
*
60-
* @warning 仿照 ALAssetsLibrary 的做法输出与当前设备屏幕大小相同尺寸的图片,如果图片原图小于当前设备屏幕的尺寸,则只输出原图大小的图片
64+
* @warning 输出与当前设备屏幕大小相同尺寸的图片,如果图片原图小于当前设备屏幕的尺寸,则只输出原图大小的图片
6165
* @return Asset 的全屏图
6266
*/
6367
- (UIImage *)previewImage;
6468

6569
/**
6670
* 异步请求 Asset 的原图,包含了系统照片“编辑”功能处理后的效果(剪裁,旋转和滤镜等),可能会有网络请求
6771
*
68-
* @param completion 完成请求后调用的 block,参数中包含了请求的原图以及图片信息,在 iOS 8.0 或以上版本中
69-
* 这个 block 会被多次调用,其中第一次调用获取到的尺寸很小的低清图,然后不断调用,直到获取到高清图。
72+
* @param completion 完成请求后调用的 block,参数中包含了请求的原图以及图片信息,这个 block 会被多次调用
73+
* 其中第一次调用获取到的尺寸很小的低清图,然后不断调用,直到获取到高清图。
7074
* @param phProgressHandler 处理请求进度的 handler,不在主线程上执行,在 block 中修改 UI 时注意需要手工放到主线程处理。
7175
*
72-
* @wraning iOS 8.0 以下中并没有异步请求预览图的接口,因此实际上为同步请求,这时 block 中的第二个参数(图片信息)返回的为 nil。
73-
*
7476
* @return 返回请求图片的请求 id
7577
*/
7678
- (NSInteger)requestOriginImageWithCompletion:(void (^)(UIImage *result, NSDictionary<NSString *, id> *info))completion withProgressHandler:(PHAssetImageProgressHandler)phProgressHandler;
7779

7880
/**
7981
* 异步请求 Asset 的缩略图,不会产生网络请求
8082
*
81-
* @param size 指定返回的缩略图的大小,仅在 iOS 8.0 及以上的版本有效,其他版本则调用 ALAsset 的接口由系统返回一个合适当前平台的图片
82-
* @param completion 完成请求后调用的 block,参数中包含了请求的缩略图以及图片信息,在 iOS 8.0 或以上版本中,这个 block 会被多次调用,
83+
* @param size 指定返回的缩略图的大小
84+
* @param completion 完成请求后调用的 block,参数中包含了请求的缩略图以及图片信息,这个 block 会被多次调用,
8385
* 其中第一次调用获取到的尺寸很小的低清图,然后不断调用,直到获取到高清图,这时 block 中的第二个参数(图片信息)返回的为 nil。
8486
*
8587
* @return 返回请求图片的请求 id
@@ -89,12 +91,10 @@ typedef NS_ENUM(NSUInteger, QMUIAssetDownloadStatus) {
8991
/**
9092
* 异步请求 Asset 的预览图,可能会有网络请求
9193
*
92-
* @param completion 完成请求后调用的 block,参数中包含了请求的预览图以及图片信息,在 iOS 8.0 或以上版本中
93-
* 这个 block 会被多次调用,其中第一次调用获取到的尺寸很小的低清图,然后不断调用,直到获取到高清图。
94+
* @param completion 完成请求后调用的 block,参数中包含了请求的预览图以及图片信息,这个 block 会被多次调用
95+
* 其中第一次调用获取到的尺寸很小的低清图,然后不断调用,直到获取到高清图。
9496
* @param phProgressHandler 处理请求进度的 handler,不在主线程上执行,在 block 中修改 UI 时注意需要手工放到主线程处理。
9597
*
96-
* @wraning iOS 8.0 以下中并没有异步请求预览图的接口,因此实际上为同步请求,这时 block 中的第二个参数(图片信息)返回的为 nil。
97-
*
9898
* @return 返回请求图片的请求 id
9999
*/
100100
- (NSInteger)requestPreviewImageWithCompletion:(void (^)(UIImage *result, NSDictionary<NSString *, id> *info))completion withProgressHandler:(PHAssetImageProgressHandler)phProgressHandler;
@@ -117,20 +117,16 @@ typedef NS_ENUM(NSUInteger, QMUIAssetDownloadStatus) {
117117
* @param completion 完成请求后调用的 block,参数中包含了请求的 AVPlayerItem 以及相关信息,若 assetType 不是 QMUIAssetTypeVideo 则为 nil
118118
* @param phProgressHandler 处理请求进度的 handler,不在主线程上执行,在 block 中修改 UI 时注意需要手工放到主线程处理。
119119
*
120-
* @wraning iOS 8.0 以下中并没有异步请求 AVPlayerItem 的接口,因此实际上为同步请求,这时 block 中的第二个参数(AVPlayerItem 相关信息)返回的为 nil。
121-
*
122120
* @return 返回请求 AVPlayerItem 的请求 id
123121
*/
124122
- (NSInteger)requestPlayerItemWithCompletion:(void (^)(AVPlayerItem *playerItem, NSDictionary<NSString *, id> *info))completion withProgressHandler:(PHAssetVideoProgressHandler)phProgressHandler;
125123

126124
/**
127125
* 异步请求图片的 Data
128126
*
129-
* @param completion 完成请求后调用的 block,参数中包含了请求的图片 Data(若 assetType 不是 QMUIAssetTypeImage 或 QMUIAssetTypeLivePhoto 则为 nil),以及该图片是否为 GIF 的判断值
130-
*
131-
* @wraning iOS 8.0 以下中并没有异步请求 Data 的接口,因此实际上为同步请求,这时 block 中的第二个参数(图片信息)返回的为 nil。
127+
* @param completion 完成请求后调用的 block,参数中包含了请求的图片 Data(若 assetType 不是 QMUIAssetTypeImage 或 QMUIAssetTypeLivePhoto 则为 nil),该图片是否为 GIF 的判断值,以及该图片的文件格式是否为 HEIC
132128
*/
133-
- (void)requestImageData:(void (^)(NSData *imageData, NSDictionary<NSString *, id> *info, BOOL isGif))completion;
129+
- (void)requestImageData:(void (^)(NSData *imageData, NSDictionary<NSString *, id> *info, BOOL isGIF, BOOL isHEIC))completion;
134130

135131
/**
136132
* 获取图片的 UIImageOrientation 值,仅 assetType 为 QMUIAssetTypeImage 或 QMUIAssetTypeLivePhoto 时有效

0 commit comments

Comments
 (0)