MKAToggleButton is multiple icons toggle button for iOS.
MKAToggleButton is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "MKAToggleButton"- Downloads latest MKAToggleButton
- Drags & Drops MKAToggleButton.framework into your Xcode project
-
Imports the module
Swift
import MKAToggleButtonObjective-C
#import <MKAToggleButton/MKAToggleButton.h>
-
Creates an instance and sets up
Swift
// Creates an instance with icon images. let toggleButton = MKAIconToggleButton(images: [UIImage(named: "circle")!, UIImage(named: "square")!, UIImage(named: "triangle")!, UIImage(named: "star")!]) self.view.addSubview(toggleButton) // Should use click handler for user interaction. toggleButton.clickHandler = { sender in if let button = sender as? MKAIconToggleButton { // `currentStateIndex` property returns the current state. print("index=\(button.currentStateIndex)") } }
Objective-C
TBA
When the template mode is enabled, the toggle button applies its tintColor to the icon images.
Swift
// Uses the template rendering mode and sets a color to `tintColor`.
toggleButton.isImageTemplate = true
toggleButton.tintColor = UIColor(red: 241.0 / 255.0, green: 196.0 / 255.0, blue: 15.0 / 255.0, alpha: 1.0)Objective-C
TBA
More info, see my sample code.





