Skip to content

Commit 5e59bde

Browse files
committed
Merge commit '1f615362134ab370cb48075bb22f9f27e2f977a6'
2 parents fe38c39 + 1f61536 commit 5e59bde

8 files changed

Lines changed: 48 additions & 18 deletions

File tree

QMUI/QMUIKit.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "QMUIKit"
3-
s.version = "1.3.2"
3+
s.version = "1.3.3"
44
s.summary = "致力于提高项目 UI 开发效率的解决方案"
55
s.description = <<-DESC
66
QMUI iOS 是一个致力于提高项目 UI 开发效率的解决方案,其设计目的是用于辅助快速搭建一个具备基本设计还原效果的 iOS 项目,同时利用自身提供的丰富控件及兼容处理, 让开发者能专注于业务需求而无需耗费精力在基础代码的设计上。不管是新项目的创建,或是已有项目的维护,均可使开发效率和项目质量得到大幅度提升。
@@ -20,6 +20,6 @@ Pod::Spec.new do |s|
2020
# s.ios.exclude_files = 'Classes/osx'
2121
# s.osx.exclude_files = 'Classes/ios'
2222
# s.public_header_files = 'Classes/**/*.h'
23-
s.frameworks = 'Foundation', 'UIKit', 'CoreGraphics'
23+
s.frameworks = 'Foundation', 'UIKit', 'CoreGraphics', 'Photos'
2424

2525
end

QMUI/QMUIKit/UIComponents/QMUIModalPresentationViewController.m

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ - (void)setDimmingView:(UIView *)dimmingView {
275275
- (void)initDefaultDimmingViewWithoutAddToView {
276276
if (!self.dimmingView) {
277277
_dimmingView = [[UIView alloc] init];
278-
self.dimmingView.alpha = 0.0;
279278
self.dimmingView.backgroundColor = UIColorMask;
280279
[self addTapGestureRecognizerToDimmingViewIfNeeded];
281280
if ([self isViewLoaded]) {
@@ -284,11 +283,6 @@ - (void)initDefaultDimmingViewWithoutAddToView {
284283
}
285284
}
286285

287-
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
288-
[super touchesBegan:touches withEvent:event];
289-
NSLog(@"");
290-
}
291-
292286
// 要考虑用户可能创建了自己的dimmingView,则tap手势也要重新添加上去
293287
- (void)addTapGestureRecognizerToDimmingViewIfNeeded {
294288
if (!self.dimmingView) {

QMUI/QMUIKit/UIKitExtensions/QMUITextField.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* 1. 自定义 placeholderColor。
3333
* 2. 自定义 UITextField 的文字 padding。
3434
* 3. 支持限制输入的文字的长度。
35+
* 4. 修复 iOS 10 之后 UITextField 输入中文超过文本框宽度后再删除,文字往下掉的 bug。
3536
*/
3637
@interface QMUITextField : UITextField
3738

QMUI/QMUIKit/UIKitExtensions/QMUITextView.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414

1515
@optional
1616
/**
17-
* 输入框高度发生变化时的回调,仅当 `autoResizable` 属性为 YES 时才有效
17+
* 输入框高度发生变化时的回调,仅当 `autoResizable` 属性为 YES 时才有效。
18+
* @note 只有当内容高度与当前输入框的高度不一致时才会调用到这里,所以无需在内部做高度是否变化的判断。
1819
*/
19-
- (void)textView:(QMUITextView *)textView contentHeightAfterTextChanged:(CGFloat)height;
20+
- (void)textView:(QMUITextView *)textView newHeightAfterTextChanged:(CGFloat)height;
2021

2122
/**
2223
* 用户点击键盘的 return 按钮时的回调(return 按钮本质上是输入换行符“\n”)
@@ -92,7 +93,7 @@
9293

9394
/**
9495
* 是否支持自动拓展高度,默认为NO
95-
* @see textView:contentHeightAfterTextChanged:
96+
* @see textView:newHeightAfterTextChanged:
9697
*/
9798
@property(nonatomic, assign) BOOL autoResizable;
9899

QMUI/QMUIKit/UIKitExtensions/QMUITextView.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ - (void)handleTextChanged:(id)sender {
304304

305305

306306
// 通知delegate去更新textView的高度
307-
if ([textView.originalDelegate respondsToSelector:@selector(textView:contentHeightAfterTextChanged:)]) {
308-
[textView.originalDelegate textView:self contentHeightAfterTextChanged:resultHeight];
307+
if ([textView.originalDelegate respondsToSelector:@selector(textView:newHeightAfterTextChanged:)] && resultHeight != CGRectGetHeight(self.bounds)) {
308+
[textView.originalDelegate textView:self newHeightAfterTextChanged:resultHeight];
309309
}
310310
}
311311

QMUI/QMUIKit/UIMainFrame/QMUINavigationController.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,19 @@
9090
* 初始化时调用的方法,会在 initWithNibName:bundle: 和 initWithCoder: 这两个指定的初始化方法中被调用,所以子类如果需要同时支持两个初始化方法,则建议把初始化时要做的事情放到这个方法里。否则仅需重写要支持的那个初始化方法即可。
9191
*/
9292
- (void)didInitialized NS_REQUIRES_SUPER;
93+
94+
@end
95+
96+
@interface QMUINavigationController (UISubclassingHooks)
97+
98+
/**
99+
* 每个界面Controller在即将展示的时候被调用,在`UINavigationController`的方法`navigationController:willShowViewController:animated:`中会自动被调用,同时因为如果把一个界面dismiss后回来此时并不会调用`navigationController:willShowViewController`,所以需要在`viewWillAppear`里面也会调用一次。
100+
*/
101+
- (void)willShowViewController:(nonnull UIViewController *)viewController NS_REQUIRES_SUPER;
102+
103+
/**
104+
* 同上
105+
*/
106+
- (void)didShowViewController:(nonnull UIViewController *)viewController NS_REQUIRES_SUPER;
107+
93108
@end

QMUI/QMUIKit/UIMainFrame/QMUINavigationController.m

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,12 @@ - (void)viewDidLoad {
7171

7272
- (void)viewWillAppear:(BOOL)animated {
7373
[super viewWillAppear:animated];
74-
// 在这里为什么还需要调用一次,是因为如果把一个界面dismiss后回来这里,此时并不会调用navigationController:willShowViewController,但会调用viewWillAppear
75-
[self renderStyleInNavigationController:self currentViewController:self.topViewController];
74+
[self willShowViewController:self.topViewController];
75+
}
76+
77+
- (void)viewDidAppear:(BOOL)animated {
78+
[super viewDidAppear:animated];
79+
[self didShowViewController:self.topViewController];
7680
}
7781

7882
- (UIViewController *)popViewControllerAnimated:(BOOL)animated {
@@ -255,7 +259,7 @@ - (void)handleInteractivePopGestureRecognizer:(UIScreenEdgePanGestureRecognizer
255259
// 注意如果实现了某一个navigationController的delegate方法,必须同时检查并且调用delegateProxy相对应的方法
256260

257261
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
258-
[self renderStyleInNavigationController:navigationController currentViewController:viewController];
262+
[self willShowViewController:viewController];
259263
if ([self.delegateProxy respondsToSelector:_cmd]) {
260264
[self.delegateProxy navigationController:navigationController willShowViewController:viewController animated:animated];
261265
}
@@ -264,6 +268,7 @@ - (void)navigationController:(UINavigationController *)navigationController will
264268
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
265269
self.viewControllerPopping = nil;
266270
self.isViewControllerTransiting = NO;
271+
[self didShowViewController:viewController];
267272
if ([self.delegateProxy respondsToSelector:_cmd]) {
268273
[self.delegateProxy navigationController:navigationController didShowViewController:viewController animated:animated];
269274
}
@@ -300,3 +305,17 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
300305
}
301306

302307
@end
308+
309+
310+
@implementation QMUINavigationController (UISubclassingHooks)
311+
312+
- (void)willShowViewController:(UIViewController *)viewController {
313+
// 子类可以重写
314+
[self renderStyleInNavigationController:self currentViewController:viewController];
315+
}
316+
317+
- (void)didShowViewController:(UIViewController *)viewController {
318+
// 子类可以重写
319+
}
320+
321+
@end

QMUI/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ QMUI iOS 是一个致力于提高项目 UI 开发效率的解决方案,其设
4040
#### Podfile
4141
```
4242
platform :ios, '7.0'
43-
pod 'QMUIKit', '~>1.3.2'
43+
pod 'QMUIKit', '~>1.3.3'
4444
```
4545
如果你的项目支持 iOS 8+,建议使用QMUI的动态库:
4646

@@ -61,7 +61,7 @@ pod setup (这个步骤比较费时,请耐心等一等)
6161

6262
#### Cartfile
6363
```
64-
github "QMUI/QMUI_iOS" ~>1.3.2
64+
github "QMUI/QMUI_iOS" ~>1.3.3
6565
```
6666
### 作为子项目
6767
具体请查看我们的[开始使用](http://qmuiteam.com/ios/page/start.html#qw_downloadForUse)文档。

0 commit comments

Comments
 (0)