IconSelectorViewController
@available(iOSApplicationExtension, unavailable)
open class IconSelectorViewController : UITableViewController
A very simple view controller implementation of the IconSelector, which can be instantiated to display a custom
collection of icons, or pull the complete list from a given bundle.
-
The icons displayed by the receiver.
Declaration
Swift
public let icons: [Icon] -
Creates an
IconSelectorViewControllerwith icons from the givenbundle. Icons should be defined within theCFBundleIconsvalue of the givenbundle‘s Info.plist.Declaration
Swift
public convenience init(bundle: Bundle = .main)Parameters
bundleThe
Bundleto source icons from. Defaults to themainbundle. -
Undocumented
Declaration
Swift
public required convenience init?(coder: NSCoder)
-
Returns the icon selector managed by the controller object.
Declaration
Swift
public var iconSelector: IconSelector? { get } -
Undocumented
Declaration
Swift
public override func loadView()
-
Method called when the icon is selected within the view controller.
Note
The default implementation validates that alternate icons are supported, and that the application is in an active state before attempting to change the selected icon. If the application is not in an active state, the application will loop until it is.Declaration
Swift
open func iconSelector(_ iconSelector: IconSelector, didChangeValue selectedIcon: Icon)Parameters
iconSelectorThe
IconSelectorthat theselectedIconwas selected in.selectedIconThe
Iconthat was selected. -
Method called when the application throws an error upon attempting to select an icon.
Note
The default implementation does nothing, which is a mostly valid option. The only errors really thrown are to indicate that an invalid icon was selected, so as long as the icons you provide during init are sourced from the Info.plist (the default option), you’re golden.Declaration
Swift
open func iconSelector(_ iconSelector: IconSelector, didFailWith error: Swift.Error)Parameters
iconSelectorThe
IconSelectorthat theselectedIconwas selected in.errorThe
Errorthat was thrown by the system.
View on GitHub
IconSelectorViewController Class Reference