MGSelector is a customised table selector for iOS.
To run the example project, clone the repo, and run pod install from the Example directory first.
MGSelector is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MGSelector', '~> 0.1'Prepare your model which confirms the MGSelectorModel protocol at first.
struct Option: MGSelectorOption {
var title: String
var detail: String?
}Confirm the MGSelectable protocol in your view controller, and invokes the openSelector method.
let options: [Options] = ...
class ViewController: UIViewController, MGSelectable {
//...
@IBAction func open(_ sender: UIButton) {
openSelector(title: "Title", options: options, theme: .dark)
}
func didSelect(option: MGSelectorOption) {
title = option.title
}
}Get the select result using the didSelect protocol method.
lm2343635, [email protected]
MGSelector is available under the MIT license. See the LICENSE file for more info.

