File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -28,24 +28,23 @@ public protocol StackScrollViewCellType: class {
2828
2929extension StackScrollViewCellType where Self: UIView {
3030
31- public var stackScrollView : StackScrollView {
31+ public var stackScrollView : StackScrollView ? {
3232 var superview : UIView ? = self
3333
3434 while !( superview is StackScrollView ) {
3535 superview = superview? . superview
3636 }
3737
38- precondition ( superview is StackScrollView , " Must be added StackScrollView " )
39- return superview as! StackScrollView
38+ return superview as? StackScrollView
4039 }
4140
4241 public func scrollToSelf( animated: Bool ) {
4342
44- stackScrollView. scroll ( to: self , animated: animated)
43+ stackScrollView? . scroll ( to: self , animated: animated)
4544 }
4645
4746 public func updateLayout( animated: Bool ) {
4847 invalidateIntrinsicContentSize ( )
49- stackScrollView. updateLayout ( animated: animated)
48+ stackScrollView? . updateLayout ( animated: animated)
5049 }
5150}
You can’t perform that action at this time.
0 commit comments