File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
EyeSpeak/Features/Presets Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -21,20 +21,34 @@ class PresetUICollectionViewCompositionalLayout: UICollectionViewCompositionalLa
2121 override func initialLayoutAttributesForAppearingItem( at itemIndexPath: IndexPath ) -> UICollectionViewLayoutAttributes ? {
2222 let attr = super. initialLayoutAttributesForAppearingItem ( at: itemIndexPath)
2323 // Make animation only happen for preset items
24- guard let item = dataSource? . itemIdentifier ( for: itemIndexPath) , case PresetsViewController . ItemWrapper . presetItem ( _ ) = item else {
24+ guard let item = dataSource? . itemIdentifier ( for: itemIndexPath) else {
2525 return attr
2626 }
27- attr? . transform = CGAffineTransform ( translationX: 0 , y: 500.0 )
27+
28+ switch item {
29+ case . presetItem, . keyGroup, . keyboardFunctionButton:
30+ attr? . transform = CGAffineTransform ( translationX: 0 , y: 500.0 )
31+ default :
32+ break
33+ }
34+
2835 return attr
2936 }
3037
3138 override func finalLayoutAttributesForDisappearingItem( at itemIndexPath: IndexPath ) -> UICollectionViewLayoutAttributes ? {
3239 let attr = super. finalLayoutAttributesForDisappearingItem ( at: itemIndexPath)
3340 // Make animation only happen for preset items
34- guard let item = dataSource? . itemIdentifier ( for: itemIndexPath) , case PresetsViewController . ItemWrapper . presetItem ( _ ) = item else {
41+ guard let item = dataSource? . itemIdentifier ( for: itemIndexPath) else {
3542 return attr
3643 }
37- attr? . transform = CGAffineTransform ( translationX: 0 , y: 500.0 )
44+
45+ switch item {
46+ case . presetItem, . keyGroup, . keyboardFunctionButton:
47+ attr? . transform = CGAffineTransform ( translationX: 0 , y: 500.0 )
48+ default :
49+ break
50+ }
51+
3852 return attr
3953 }
4054
You can’t perform that action at this time.
0 commit comments