TabBarView
class TabBarView : UIView, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource, UICollectionViewDelegate
Set up tab bar view
-
This is a
UICollcetionViewwhich is used to save an ordered collectionDeclaration
Swift
@IBOutlet var collectionView: UICollectionView! -
This is a
UIViewwhich is used as awhiteBarunder the selected iconDeclaration
Swift
@IBOutlet var whiteBar: UIView! -
This a
NSLayoutConstraitwhich is used to size thewhiteBarDeclaration
Swift
@IBOutlet var whiteBarLeadingConstraint: NSLayoutConstraint! -
This variable is used to save the selected cell in
UICollectionViewDeclaration
Swift
var selectedIndex: Int
-
Customise
TabBarViewDeclaration
Swift
func customisation() -
Animate to show the Menu
Declaration
Swift
@objc func animateMenu(notification: Notification)
-
Asks
tabBarImagesfor the number of items in the specified section.Declaration
Swift
func collectionView(_: UICollectionView, numberOfItemsInSection _: Int) -> IntParameters
collectionViewThe collection view requesting this information.
sectionAn index number identifying a section in collectionView. This index value is 0-based.
Return Value
The number of rows in section.
-
Asks
tabBarImagesfor the cell that corresponds to the specified item in the collection view.Declaration
Swift
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCellParameters
collectionViewThe collection view requesting this information.
indexPathThe 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) -> CGSizeParameters
collectionViewThe collection view object displaying the flow layout.
indexPathThe index path of the item
collectionViewLayoutThe 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
collectionViewThe collection view object displaying the flow layout.
indexPathThe index path of the item
-
Called after the controller's view is loaded into memory. Load
customisationMethodDeclaration
Swift
override func awakeFromNib() -
Deinitialization Function
Declaration
Swift
deinit
TabBarView Class Reference