@@ -13,31 +13,31 @@ import CollectionViewSlantedLayout
1313@IBDesignable
1414
1515class ___TABLE___ListForm : ListFormCollection {
16-
16+
1717 // Do not edit name or override tableName
1818 public override var tableName : String {
1919 return " ___TABLE___ "
2020 }
21-
21+
2222 let layout = CollectionViewSlantedLayout ( )
2323 let actionButton = UIButton ( )
24-
24+
2525 // MARK: Events
2626 override func onLoad( ) {
2727 // Do any additional setup after loading the view.
2828 navigationController? . isNavigationBarHidden = true
29-
29+
3030 // Action Button definition
3131 actionButton. frame = CGRect ( x: screenWidth - 70 , y: 45 , width: 50 , height: 50 )
3232 let image = UIImage ( named: " moreButton " )
3333 actionButton. setImage ( image, for: UIControl . State. normal)
3434 actionButton. actionSheet = self . actionSheet
3535 actionButton. transform = CGAffineTransform ( scaleX: 0 , y: 0 )
3636 view. addSubview ( actionButton)
37-
37+
3838 // SearchBar text style
3939 let blueColor = UIColor ( red: 90 / 255 , green: 179 / 255 , blue: 174 / 255 , alpha: 1.0 )
40-
40+
4141 // Floating SearchBar definition
4242 searchBar = UISearchBar ( frame: CGRect ( x: 20 , y: 50 , width: UIScreen . main. bounds. width - 100 , height: 40 ) )
4343 searchBar. layer. cornerRadius = 10
@@ -48,26 +48,29 @@ class ___TABLE___ListForm: ListFormCollection {
4848 let barButtonAppearanceInSearchBar : UIBarButtonItem ?
4949 barButtonAppearanceInSearchBar = UIBarButtonItem . appearance ( whenContainedInInstancesOf: [ UISearchBar . self] )
5050 barButtonAppearanceInSearchBar? . tintColor = blueColor
51-
51+
5252 // SearchBar text style
5353 let textFieldInsideUISearchBar = searchBar. value ( forKey: " searchField " ) as? UITextField
5454 textFieldInsideUISearchBar? . textColor = blueColor
5555 textFieldInsideUISearchBar? . font = UIFont ( name: " HelveticaNeue-Thin " , size: 15 )
56-
56+
5757 self . refreshControl? . tintColor = blueColor
5858 searchBar. searchBarStyle = UISearchBar . Style. prominent
5959 searchBar. isTranslucent = false
6060 searchBar. backgroundImage = UIImage ( )
6161 searchBar. delegate = self
6262 self . view. addSubview ( searchBar)
6363 }
64-
64+
6565 override func onWillAppear( _ animated: Bool ) {
6666 // Called when the view is about to made visible. Default does nothing
6767 collectionView. collectionViewLayout. invalidateLayout ( )
6868 collectionView. contentInset. top = - UIApplication. shared. statusBarFrame. height
69+ if actionSheet == nil {
70+ self . actionButton. isHidden = true
71+ }
6972 }
70-
73+
7174 override func onDidAppear( _ animated: Bool ) {
7275 // Called when the view has been fully transitioned onto the screen. Default does nothing
7376 UIView . animate ( withDuration: 1.0 , delay: 0.2 , usingSpringWithDamping: 0.6 , initialSpringVelocity: 2 , options: [ . curveEaseOut] , animations: {
@@ -78,21 +81,21 @@ class ___TABLE___ListForm: ListFormCollection {
7881 self . actionButton. transform = . identity
7982 } , completion: nil )
8083 }
81-
84+
8285 override func onWillDisappear( _ animated: Bool ) {
8386 // Called when the view is dismissed, covered or otherwise hidden. Default does nothing
8487 }
85-
88+
8689 override func onDidDisappear( _ animated: Bool ) {
8790 // Called after the view was dismissed, covered or otherwise hidden. Default does nothing
8891 }
89-
92+
9093 open override func onSearchFetching( ) {
9194 collectionView? . collectionViewLayout = layout
9295 layout. isFirstCellExcluded = true
9396 layout. isLastCellExcluded = true
9497 }
95-
98+
9699 open override func onSearchCancel( ) {
97100 collectionView? . collectionViewLayout = layout
98101 layout. isFirstCellExcluded = true
@@ -102,7 +105,7 @@ class ___TABLE___ListForm: ListFormCollection {
102105
103106// MARK: Layout
104107extension ___TABLE___ListForm : CollectionViewDelegateSlantedLayout {
105-
108+
106109 override func scrollViewDidScroll( _ scrollView: UIScrollView ) {
107110 guard let collectionView = collectionView else { return }
108111 guard let visibleCells = collectionView. visibleCells as? [ ___TABLE___CustomCollectionCell ] else { return }
0 commit comments