Skip to content

rzgry/DayOfWeekPicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RZGDayOfWeekPicker

RZGDayOfWeekPicker is an iOS control for selecting days of the week built entirely with Swift.

Selecting Items Example

Installation

To use RZGDayOfWeekPicker simply clone/download this repo and then drag RZGDayOfWeekPicker.swift into your Xcode Project.

Customizations

  • selectedColor: The color that appears when a day of the week is selected
  • unselectedColor: The color that appears when a day of the week is not selected
  • textColor: The color of the text
  • fontSize: The size of the text
  • spacing: The spacing between each day

Attributes Inspector Example

How to Use

Create the DayOfWeekPicker either through code or storyboard.

You can then directly interact with the picker using these methods

func dayIsSelectedAtIndex(index: Int) -> Bool
func indexOfSelectedDays() -> [Int]
func selectDayWithIndex(index: Int)
func deselectDayWithIndex(index: Int)

or set your controller to be the pickers delegate to receive messages whenever items are selected or deselected

override func viewDidLoad() {
    super.viewDidLoad()
    picker.delegate = self
}

func dayWasSelected(picker: RZGDayOfWeekPicker, selectedIndex: Int) {
    print(picker.indexOfSelectedDays())
}

func dayWasDeselected(picker: RZGDayOfWeekPicker, deselectedIndex: Int) {
    print(picker.indexOfSelectedDays())
}

Delegate Example

About

πŸ—“ An iOS control for selecting days of the week built with Swift

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages