Skip to content

Commit c0acbdb

Browse files
committed
Update StackScrollViewCellType
1 parent b564031 commit c0acbdb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

StackScrollView/StackScrollViewCellType.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ public protocol StackScrollViewCellType: class {
2929
extension StackScrollViewCellType where Self: UIView {
3030

3131
public var stackScrollView: StackScrollView {
32-
let superview = self.superview?.superview?.superview
32+
var superview: UIView? = self
33+
34+
while !(superview is StackScrollView) {
35+
superview = superview?.superview
36+
}
37+
3338
precondition(superview is StackScrollView, "Must be added StackScrollView")
3439
return superview as! StackScrollView
3540
}

0 commit comments

Comments
 (0)