Selection Indicator using an imageView.
Just drag and drop the SHSelectionIcon.swift file from SHSelectionIndicator folder to your project.
- a- You can use by drag and drop an imageView in storyboard and set image class to SHSelectionIcon and set an outlet for the imageView
b- Or you can initialize using a variable like below:
var selection = SHSelectionIcon()
- a- You can set selection indicator icon height and width.
for example:
b- You can set selection indicator icon direction. for example:
selection.selectionIconHeight = 30 //By default 30 for both height and width selection.selectionIconWidth = 30
c- You can set selection indicator icon Image. for example:selection.pointerDirection = .vertical //.vertical and .horizontal are available
d- You can set selection indicator icon initial selected button for example:selection.image = UIImage(named: "icon")
selection.initialButton(object: sampleButtons[0]) //Here sample buttons is a collection of buttons
- Change the selection indicator icon to selected button
call a method setSelection(object: buttonObject) inside button action with its buttonObject
for example:
try using sample projeect to know the working.
selection.setSelection(object: sender) //this method is called inside action of selected button
- iOS 10.0+
Download the Sample project.
Mail me @: shezadahamed95@gmail.com

