Swiftpack.co - rursache/RSDropDown as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by rursache.
rursache/RSDropDown v2.1.3
DropDown component for iOS
⭐️ 0
🕓 29 weeks ago
iOS
.package(url: "https://github.com/rursache/RSDropDown.git", from: "v2.1.3")

RSDropDown

A beautiful and fully customizable DropDown component for iOS.

Supports search and Storyboards out of the box.

Example

@IBOutlet private weak var dropDown: RSDropDown! // add a new UITextField in Storyboard then set its class to RSDropDown
    
func setupDropDown() {
    // optional customization
    self.dropDown.borderStyle = .none
    self.dropDown.backgroundColor = .systemBackground
    self.dropDown.textColor = .label
    self.dropDown.borderColor = .systemGreen
    self.dropDown.borderWidth = 1
    self.dropDown.rowBackgroundColor = .systemBackground
    self.dropDown.font = .systemFont(ofSize: 15, weight: .medium)
    self.dropDown.tableViewCellFont = .systemFont(ofSize: 15, weight: .medium)
    self.dropDown.tableViewCornerRadius = 8
    self.dropDown.chevronSize = 20
    self.dropDown.chevronColor = .systemRed
    self.dropDown.showTableViewBorder = true
    self.dropDown.showTableViewShadow = false
    self.dropDown.cornerRadius = 10
    self.dropDown.padding = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 0)
    
    // setup
    //self.dropDown.listWidth = 380
    self.dropDown.listSpacing = 10
    self.dropDown.rowHeight = 45
    self.dropDown.listHeight = self.dropDown.rowHeight * 4 // 4 items visible
    
    self.dropDown.placeholder = "Pick one"
    self.dropDown.optionArray = (1...500).compactMap { "Option \($0)" }
    self.dropDown.didSelect { selectedItemText, selectedItemIndex, selectedItemId in
        print(selectedItemText, selectedItemIndex, selectedItemId)
    }
    self.dropDown.selectedIndex = 2 // default selected index, optional. if not set, placeholder will show
}

GitHub

link
Stars: 0
Last commit: 29 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

29 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics