TabBarView
class TabBarView : UIView, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource, UICollectionViewDelegate
Set up tab bar view
-
This is a
UICollcetionView
which is used to save an ordered collectionDeclaration
Swift
@IBOutlet var collectionView: UICollectionView!
-
This is a
UIView
which is used as awhiteBar
under the selected iconDeclaration
Swift
@IBOutlet var whiteBar: UIView!
-
This a
NSLayoutConstrait
which is used to size thewhiteBar
Declaration
Swift
@IBOutlet var whiteBarLeadingConstraint: NSLayoutConstraint!
-
This variable is used to save the selected cell in
UICollectionView
Declaration
Swift
var selectedIndex: Int
-
Customise
TabBarView
Declaration
Swift
func customisation()
-
Animate to show the Menu
Declaration
Swift
@objc func animateMenu(notification: Notification)
-
Asks
tabBarImages
for the number of items in the specified section.Declaration
Swift
func collectionView(_: UICollectionView, numberOfItemsInSection _: Int) -> Int
Parameters
collectionView
The collection view requesting this information.
section
An index number identifying a section in collectionView. This index value is 0-based.
Return Value
The number of rows in section.
-
Asks
tabBarImages
for the cell that corresponds to the specified item in the collection view.Declaration
Swift
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
Parameters
collectionView
The collection view requesting this information.
indexPath
The index path that specifies the location of the item.
Return Value
A configured cell object. You must not return nil from this method.
-
Asks the delegate for the size of the specified item’s cell.
Declaration
Swift
func collectionView(_: UICollectionView, layout _: UICollectionViewLayout, sizeForItemAt _: IndexPath) -> CGSize
Parameters
collectionView
The collection view object displaying the flow layout.
indexPath
The index path of the item
collectionViewLayout
The layout object requesting the
Return Value
The width and height of the specified item. Both values must be greater than 0.
-
Tells the delegate that the item at the specified index path was selected.
Declaration
Swift
func collectionView(_: UICollectionView, didSelectItemAt indexPath: IndexPath)
Parameters
collectionView
The collection view object displaying the flow layout.
indexPath
The index path of the item
-
Called after the controller's view is loaded into memory. Load
customisation
MethodDeclaration
Swift
override func awakeFromNib()
-
Deinitialization Function
Declaration
Swift
deinit