SPickerList
supports Swift 5.0 since version 1.0
.
Use Carthage.
- Create a file name
Cartfile
. - Add the line
github "sonmbol/PickerList"
. - Run
carthage update
. - Drag the built
SPickerList.framework
into your Xcode project.
A regular way to use SPickerList in your project would be using Embedded Framework. There are two approaches, using source code and adding submodule.
Add submodule
- In your favorite terminal,
cd
into your top-level project directory, and entering the following command:
$ git submodule add git@github.com:sonmbol/PickerList.git
After you get the source code either by adding it directly or using submodule, then do the following steps:
- Open
SoPickerList
folder, and dragSoPickerList.xcodeproj
into the file navigator of your app project, under you app project. - In Xcode, navigate to the target configuration window by clicking the blue project icon, and selecting the application target under the "Targets" heading in the sidebar.
- Open "Build Phases" panel in the tab bar at the top of the window, expend the "Target Dependencies" group and add
SPickerList.framework
u.
import SPickerList
let vc = PickerListVC(PickerDelegate: self, title: "Countries", searchPlaceholder: "search", itemArray: Constants.COUNTRIES)
navigationController?.pushViewController(vc, animated: true)
// when select item
extention ViewController: PickerListDelegate {
func didSelect(index: Int, name: String) {
print(" index : \(index) , name : \(name)")
}
}
## Important ⚠️
Don't forget to use :
```swift
(PickerDelegate: UIViewControllr(), title: "Title", searchPlaceholder: "Search", itemArray: [String])
- Xcode 11+
- iOS 11+
This project is under MIT license. For more information, see LICENSE
file.
It will be updated when necessary and fixes will be done as soon as discovered to keep it up to date.
You can find me on Twitter @sonmbol.
Enjoy!