Dawn

Results 7 comments of Dawn

![IMG_3B6ACA46EB0B-1](https://user-images.githubusercontent.com/17351286/118744985-ea8ae900-b887-11eb-8415-b2cb21cb2cb1.jpeg) iOS 12.5.2 ![IMG_F42983650052-1](https://user-images.githubusercontent.com/17351286/118745043-01c9d680-b888-11eb-8827-2e5cdce51d7e.jpeg) iOS 14.4.1

IBPCollectionCompositionalLayoutSolver.m line 152 Modify the code Can fix the problem, but I don't know whether there will be other bugs @kishikawakatsumi `itemSize.width = (CGRectGetWidth(containerFrame)-(group.contentInsets.leading + group.contentInsets.trailing) - interItemFixedSpacing * (group.count...

![image](https://user-images.githubusercontent.com/17351286/150944703-a1ad8c21-bc02-4c81-b3e1-6edfc8c73667.png) 示例.

**问题原理分析:** `QMUIModalPresentationViewController` 的显示动画事件是在 `viewWillAppear ` 内的.这就会导致一个问题.如果在进入下级页面之后.下级页面被销毁消失. QMUIModalPresentationViewController 重新显示.就会重新触发 `viewWillAppear ` 方法.重新进入显示动画的逻辑.也就是说.不只是`presentViewController ` 其实`pushViewController ` 也会出现这个问题. **解决方案:** 第一种, 在外部重写 `showingAnimation` 和 `hidingAnimation` 外部自行通过临时变量实现的需求 第二种,则需要再内部通过临时变量判断 在 `showingAnimationWithCompletion` 方法中拦截判断当前是否已经执行过一次显示动画

`- (instancetype)initWithCoder:(NSCoder *)coder{ return [self init]; } + (BOOL)supportsSecureCoding{ return YES; }` 确认应该是bug.在一个纯净的项目中,并没有这个问题.我尝试在NSArray的分类中.重写实现以上代码,能够解决这个崩溃问题.但是应该还有更好的解决方式 @MoLice

特殊的布局可以参考iOS 13 的新api UICollectionViewCompositionalLayout 和兼容12之前的三方框架 IBPCollectionViewCompositionalLayout,自定义度很高

不能直接用.如果想用的话.可以用OC创建一个文件.在文件的.h 中创建类方法,内部调用宏定义之后.在swift中用点语法调用.