File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 11import Cocoa
22
33class ThumbnailsView {
4- let scrollView = ScrollView ( )
4+ var scrollView : ScrollView !
55 var contentView : EffectView !
66 static var recycledViews = [ ThumbnailView] ( )
77 var rows = [ [ ThumbnailView] ] ( )
88 static var thumbnailsWidth = CGFloat ( 0.0 )
99 static var thumbnailsHeight = CGFloat ( 0.0 )
1010
1111 init ( ) {
12- contentView = makeAppropriateEffectView ( )
13- contentView. addSubview ( scrollView)
12+ updateBackgroundView ( )
1413 // TODO: think about this optimization more
1514 ( 1 ... 20 ) . forEach { _ in ThumbnailsView . recycledViews. append ( ThumbnailView ( ) ) }
1615 }
1716
1817 func updateBackgroundView( ) {
19- let newEffectView = makeAppropriateEffectView ( )
20- scrollView. removeFromSuperview ( )
21- newEffectView. addSubview ( scrollView)
22- contentView. superview? . replaceSubview ( contentView, with: newEffectView)
23- contentView = newEffectView
18+ contentView = makeAppropriateEffectView ( )
19+ scrollView = ScrollView ( )
20+ contentView. addSubview ( scrollView)
2421 }
2522
2623 func reset( ) {
You can’t perform that action at this time.
0 commit comments