Skip to content

nigelbrady/MultipleChoiceController-iOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

MultipleChoiceController-iOS

This class lets you quickly implement a multiple-selection list screen in your iOS application. To use:

...

let vc = MultipleChoiceController(style: UITableViewStyle.Grouped)
vc.choices = ["Apples", "Oranges", "Bananas"] //Provide an array of choices. These must be NSObjects.

vc.allowMultipleSelections = true
vc.maximumAllowedSelections = 2 // Optional, limits selection.

vc.header = "Choose some fruits" // A header that appears before the list.
vc.footer = "Make sure to choose some delicious ones!" //A footer that appears after the list.
vc.delegate = self //Implement the MultipleChoiceControllerDelegate protocol to handle selections.

self.navigationController?.pushViewController(vc, animated: true)

...

/* Delegate method when selection is finished */

func multipleChoiceController(controller: MultipleChoiceController, didSelectItems items: [NSObject]) {
  //Do something with the "items" the user selected.
  navigationController?.popViewControllerAnimated(true)
}

About

An iOS TableViewController for quickly implementing multiple list selection. Written in Swift.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages