Skip to content

Commit

Permalink
3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLice committed Dec 28, 2018
1 parent be9eb64 commit 1a97b3a
Show file tree
Hide file tree
Showing 42 changed files with 582 additions and 243 deletions.
7 changes: 4 additions & 3 deletions QMUIConfigurationTemplate/QMUIConfigurationTemplate.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ - (void)applyConfigurationTemplate {

#pragma mark - Global Color

QMUICMI.clearColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0]; // UIColorClear : 透明色
QMUICMI.whiteColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:1]; // UIColorWhite : 白色(不用 [UIColor whiteColor] 是希望保持颜色空间为 RGB)
QMUICMI.blackColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1]; // UIColorBlack : 黑色(不用 [UIColor blackColor] 是希望保持颜色空间为 RGB)
QMUICMI.clearColor = UIColorMakeWithRGBA(255, 255, 255, 0); // UIColorClear : 透明色
QMUICMI.whiteColor = UIColorMake(255, 255, 255); // UIColorWhite : 白色(不用 [UIColor whiteColor] 是希望保持颜色空间为 RGB)
QMUICMI.blackColor = UIColorMake(0, 0, 0); // UIColorBlack : 黑色(不用 [UIColor blackColor] 是希望保持颜色空间为 RGB)
QMUICMI.grayColor = UIColorMake(179, 179, 179); // UIColorGray : 最常用的灰色
QMUICMI.grayDarkenColor = UIColorMake(163, 163, 163); // UIColorGrayDarken : 深一点的灰色
QMUICMI.grayLightenColor = UIColorMake(198, 198, 198); // UIColorGrayLighten : 浅一点的灰色
Expand Down Expand Up @@ -215,6 +215,7 @@ - (void)applyConfigurationTemplate {
QMUICMI.preventConcurrentNavigationControllerTransitions = YES; // PreventConcurrentNavigationControllerTransitions : 自动保护 QMUINavigationController 在上一次 push/pop 尚未结束的时候就进行下一次 push/pop 的行为,避免产生 crash
QMUICMI.navigationBarHiddenInitially = NO; // NavigationBarHiddenInitially : QMUINavigationControllerDelegate preferredNavigationBarHidden 的初始值,默认为NO
QMUICMI.shouldFixTabBarTransitionBugInIPhoneX = NO; // ShouldFixTabBarTransitionBugInIPhoneX : 是否需要自动修复 iOS 11 下,iPhone X 的设备在 push 界面时,tabBar 会瞬间往上跳的 bug
QMUICMI.shouldFixTabBarButtonBugForAll = NO; // ShouldFixTabBarButtonBugForAll : 是否要对 iOS 12.1.1 及以后的版本也修复手势返回时 tabBarButton 布局错误的 bug(issue #410),默认为 NO
QMUICMI.shouldAssertResizableImageCapInsetsError = YES; // ShouldAssertResizableImageCapInsetsError : UIImage (QMUI) 里的 resizableImage 遇到错误的 inset 值时是否需要以 NSAssert 的方式的方式提醒,默认为 NO,NO 则用 QMUILog
QMUICMI.sendAnalyticsToQMUITeam = YES; // SendAnalyticsToQMUITeam : 是否允许在 DEBUG 模式下上报 Bundle Identifier 和 Display Name 给 QMUI 统计用
}
Expand Down
15 changes: 8 additions & 7 deletions QMUIKit.podspec
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Pod::Spec.new do |s|
s.name = "QMUIKit"
s.version = "2.9.3"
s.version = "3.0.0"
s.summary = "致力于提高项目 UI 开发效率的解决方案"
s.description = <<-DESC
QMUI iOS 是一个致力于提高项目 UI 开发效率的解决方案,其设计目的是用于辅助快速搭建一个具备基本设计还原效果的 iOS 项目,同时利用自身提供的丰富控件及兼容处理, 让开发者能专注于业务需求而无需耗费精力在基础代码的设计上。不管是新项目的创建,或是已有项目的维护,均可使开发效率和项目质量得到大幅度提升。
DESC
s.homepage = "http://qmuiteam.com/ios"
s.homepage = "https://qmuiteam.com/ios"
s.license = 'MIT'
s.author = {"qmuiteam" => "[email protected]"}
s.source = {:git => "https://github.com/QMUI/QMUI_iOS.git", :tag => s.version.to_s}
#s.source = {:git => "https://github.com/QMUI/QMUI_iOS.git", :branch => 'master'}
s.social_media_url = 'https://github.com/QMUI/QMUI_iOS'
s.source = {:git => "https://github.com/Tencent/QMUI_iOS.git", :tag => s.version.to_s}
#s.source = {:git => "https://github.com/Tencent/QMUI_iOS.git", :branch => 'master'}
s.social_media_url = 'https://github.com/Tencent/QMUI_iOS'
s.requires_arc = true
s.documentation_url = 'http://qmuiteam.com/ios/page/document.html'
s.documentation_url = 'https://qmuiteam.com/ios/page/document.html'
s.screenshot = 'https://cloud.githubusercontent.com/assets/1190261/26751376/63f96538-486a-11e7-81cf-5bc83a945207.png'

s.platform = :ios, '8.0'
s.platform = :ios, '9.0'
s.frameworks = 'Foundation', 'UIKit', 'CoreGraphics', 'Photos'
s.preserve_paths = 'QMUIConfigurationTemplate/*'
s.source_files = 'QMUIKit/QMUIKit.h'
Expand Down Expand Up @@ -335,6 +335,7 @@ Pod::Spec.new do |s|
ss.subspec 'QMUIToastView' do |sss|
sss.source_files = 'QMUIKit/QMUIComponents/ToastView/*.{h,m}'
sss.dependency 'QMUIKit/QMUIComponents/QMUIKeyboardManager'
sss.dependency 'QMUIKit/QMUIComponents/QMUIVisualEffectView'
end

ss.subspec 'QMUIStaticTableView' do |sss|
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.9.3</string>
<string>3.0.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ - (void)viewWillAppear:(BOOL)animated {
QMUIAsset *imageAsset = self.imagesAssetArray[self.imagePreviewView.currentImageIndex];
self.checkboxButton.selected = [self.selectedImageAssetArray containsObject:imageAsset];
}

BeginIgnoreDeprecatedWarning
[[UIApplication sharedApplication] setStatusBarHidden:YES];
EndIgnoreDeprecatedWarning

if ([self conformsToProtocol:@protocol(QMUICustomNavigationBarTransitionDelegate)]) {
UIViewController<QMUICustomNavigationBarTransitionDelegate> *vc = (UIViewController<QMUICustomNavigationBarTransitionDelegate> *)self;
if ([vc respondsToSelector:@selector(shouldCustomizeNavigationBarTransitionIfHideable)] &&
Expand All @@ -121,7 +125,11 @@ - (void)viewWillAppear:(BOOL)animated {

- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];

BeginIgnoreDeprecatedWarning
[[UIApplication sharedApplication] setStatusBarHidden:NO];
EndIgnoreDeprecatedWarning

if ([self conformsToProtocol:@protocol(QMUICustomNavigationBarTransitionDelegate)]) {
UIViewController<QMUICustomNavigationBarTransitionDelegate> *vc = (UIViewController<QMUICustomNavigationBarTransitionDelegate> *)self;
if ([vc respondsToSelector:@selector(shouldCustomizeNavigationBarTransitionIfHideable)] &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ - (void)didInitialize {
_minimumSelectImageCount = 0;
_shouldShowDefaultLoadingView = YES;
// 为了让使用者可以在 init 完就可以直接改 UI 相关的 property,这里提前触发 loadView
BeginIgnoreAvailabilityWarning
[self loadViewIfNeeded];
EndIgnoreAvailabilityWarning
}

- (void)dealloc {
Expand Down
6 changes: 3 additions & 3 deletions QMUIKit/QMUIComponents/QMUIAlertController.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ typedef NS_ENUM(NSInteger, QMUIAlertControllerStyle) {
/// alert destructive 按钮样式,默认@{NSForegroundColorAttributeName:UIColorRed,NSFontAttributeName:UIFontMake(17),NSKernAttributeName:@(0)}
@property(nonatomic, strong) NSDictionary<NSString *, id> *alertDestructiveButtonAttributes UI_APPEARANCE_SELECTOR;

/// alert圆角大小,默认值是:IOS_VERSION >= 9.0 ? 13 : 6,以保持与系统默认样式一致
/// alert圆角大小,默认值是 13,以保持与系统默认样式一致
@property(nonatomic, assign) CGFloat alertContentCornerRadius UI_APPEARANCE_SELECTOR;

/// alert按钮高度,默认44pt
Expand Down Expand Up @@ -180,10 +180,10 @@ typedef NS_ENUM(NSInteger, QMUIAlertControllerStyle) {
/// sheet cancel 按钮距离其上面元素(按钮或者header)的间距,默认8pt
@property(nonatomic, assign) CGFloat sheetCancelButtonMarginTop UI_APPEARANCE_SELECTOR;

/// sheet内容的圆角,默认值是:(IOS_VERSION >= 9.0 ? 13 : 6),以保持与系统默认样式一致
/// sheet内容的圆角,默认值是 13,以保持与系统默认样式一致
@property(nonatomic, assign) CGFloat sheetContentCornerRadius UI_APPEARANCE_SELECTOR;

/// sheet按钮高度,默认值是:(IOS_VERSION >= 9.0 ? 57 : 44),以保持与系统默认样式一致
/// sheet按钮高度,默认值是 57,以保持与系统默认样式一致
@property(nonatomic, assign) CGFloat sheetButtonHeight UI_APPEARANCE_SELECTOR;

/// sheet头部(非按钮部分)背景色,默认值是:UIColorMakeWithRGBA(247, 247, 247, 1)
Expand Down
6 changes: 3 additions & 3 deletions QMUIKit/QMUIComponents/QMUIAlertController.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ + (void)resetAppearance {
alertControllerAppearance.alertButtonDisabledAttributes = @{NSForegroundColorAttributeName:UIColorMake(129, 129, 129),NSFontAttributeName:UIFontMake(17),NSKernAttributeName:@(0)};
alertControllerAppearance.alertCancelButtonAttributes = @{NSForegroundColorAttributeName:UIColorBlue,NSFontAttributeName:UIFontBoldMake(17),NSKernAttributeName:@(0)};
alertControllerAppearance.alertDestructiveButtonAttributes = @{NSForegroundColorAttributeName:UIColorRed,NSFontAttributeName:UIFontMake(17),NSKernAttributeName:@(0)};
alertControllerAppearance.alertContentCornerRadius = (IOS_VERSION >= 9.0 ? 13 : 6);
alertControllerAppearance.alertContentCornerRadius = 13;
alertControllerAppearance.alertButtonHeight = 44;
alertControllerAppearance.alertHeaderBackgroundColor = UIColorMakeWithRGBA(247, 247, 247, 1);
alertControllerAppearance.alertButtonBackgroundColor = alertControllerAppearance.alertHeaderBackgroundColor;
Expand All @@ -162,8 +162,8 @@ + (void)resetAppearance {
alertControllerAppearance.sheetCancelButtonAttributes = @{NSForegroundColorAttributeName:UIColorBlue,NSFontAttributeName:UIFontBoldMake(20),NSKernAttributeName:@(0)};
alertControllerAppearance.sheetDestructiveButtonAttributes = @{NSForegroundColorAttributeName:UIColorRed,NSFontAttributeName:UIFontMake(20),NSKernAttributeName:@(0)};
alertControllerAppearance.sheetCancelButtonMarginTop = 8;
alertControllerAppearance.sheetContentCornerRadius = (IOS_VERSION >= 9.0 ? 13 : 6);
alertControllerAppearance.sheetButtonHeight = (IOS_VERSION >= 9.0 ? 57 : 44);
alertControllerAppearance.sheetContentCornerRadius = 13;
alertControllerAppearance.sheetButtonHeight = 57;
alertControllerAppearance.sheetHeaderBackgroundColor = UIColorMakeWithRGBA(247, 247, 247, 1);
alertControllerAppearance.sheetButtonBackgroundColor = alertControllerAppearance.sheetHeaderBackgroundColor;
alertControllerAppearance.sheetButtonHighlightBackgroundColor = UIColorMake(232, 232, 232);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,8 @@ - (void)setQmui_cacheCellHeightByKeyAutomatically:(BOOL)qmui_cacheCellHeightByKe

[self replaceMethodForDelegateIfNeeded:(id<QMUITableViewDelegate>)self.delegate];

// 在上面那一句 replaceMethodForDelegateIfNeeded 里可能修改了 delegate 里的一些方法,所以需要通过重新设置 delegate 来触发 tableView 读取新的方法。iOS 8 要先置空再设置才能生效。
if (@available(iOS 9.0, *)) {
self.delegate = self.delegate;
} else {
id <QMUITableViewDelegate> tempDelegate = (id<QMUITableViewDelegate>)self.delegate;
// 如果正在使用 QMUIMultipleDelegate,那么它内部会自己先设置为 nil,因此这里不需要额外再弄一次。而且如果这里设置为 nil,反而会使 QMUIMultipleDelegate 内的所有 delegate 都被清空
if (![tempDelegate isKindOfClass:[QMUIMultipleDelegates class]]) {
self.delegate = nil;
}
self.delegate = tempDelegate;
}
// 在上面那一句 replaceMethodForDelegateIfNeeded 里可能修改了 delegate 里的一些方法,所以需要通过重新设置 delegate 来触发 tableView 读取新的方法。
self.delegate = self.delegate;
}
}

Expand Down
13 changes: 12 additions & 1 deletion QMUIKit/QMUIComponents/QMUICollectionViewPagingLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,25 @@ typedef NS_ENUM(NSInteger, QMUICollectionViewPagingLayoutStyle) {
@property(nonatomic, assign) BOOL allowsMultipleItemScroll;

/**
* 规定了当支持一次滑动允许滚动多个 item 的时候,滑动速度要达到多少才会滚动多个 item,默认为 0.7
* 规定了当支持一次滑动允许滚动多个 item 的时候,滑动速度要达到多少才会滚动多个 item,默认为 2.5
*
* 仅当 allowsMultipleItemScroll 为 YES 时生效
*/
@property(nonatomic, assign) CGFloat multipleItemScrollVelocityLimit;

@end

@interface QMUICollectionViewPagingLayout (DefaultStyle)

/// 当前 cell 的百分之多少滚过临界点时就会触发滚到下一张的动作,默认为 .666,也即超过 2/3 即会滚到下一张。
/// 对应地,触发滚到上一张的临界点将会被设置为 (1 - pagingThreshold)
@property(nonatomic, assign) CGFloat pagingThreshold;

/// 打开时,会在 collectionView.backgroundView 上添加一条红线,用来标志分页的参考点位置。仅对 Default style 有效。
@property(nonatomic, assign) BOOL debug;

@end


@interface QMUICollectionViewPagingLayout (ScaleStyle)

Expand Down
Loading

0 comments on commit 1a97b3a

Please sign in to comment.