https://github.com/nakajijapan/shari
Shari is the alternative to the library of UIPickerView(drum roll) in Swift. You can select a item using UITableView.
https://github.com/nakajijapan/shari
carthage cocoapods navigation-controller swift ui uipickerview viewcontroller xcode
Last synced: about 1 year ago
JSON representation
Shari is the alternative to the library of UIPickerView(drum roll) in Swift. You can select a item using UITableView.
- Host: GitHub
- URL: https://github.com/nakajijapan/shari
- Owner: nakajijapan
- License: mit
- Created: 2015-12-21T03:08:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-01-13T05:31:37.000Z (over 4 years ago)
- Last Synced: 2025-02-27T23:02:00.346Z (over 1 year ago)
- Topics: carthage, cocoapods, navigation-controller, swift, ui, uipickerview, viewcontroller, xcode
- Language: Swift
- Homepage:
- Size: 3.37 MB
- Stars: 115
- Watchers: 4
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shari for Swift
[](https://github.com/Carthage/Carthage)
[](http://cocoapods.org/pods/Shari)
[](http://cocoapods.org/pods/Shari)
[](http://cocoapods.org/pods/Shari)
[](https://houndci.com)
Shari is the alternative to the library of `UIPickerView` (drum roll) in Swift. You can select a item using `UITableView`.

## Requirements
- iOS 10.0+
- Xcode 9+
- Swift 5+
#### Swift Package Manager
Add via Xcode in the [usual way](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app)
## CocoaPods
Shari is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "Shari"
```
Then, run the following code:
```ruby
$ pod install
```
## Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager for Cocoa applications.
``` bash
$ brew update
$ brew install carthage
```
To integrate Shari into your Xcode project using Carthage, specify it in your `Cartfile`:
``` ogdl
github "nakajijapan/Shari"
```
Then, run the following command to build the Shari framework:
``` bash
$ carthage update
```
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## ViewController
- UINavigationController
```swift
let modalNavigationController = storyboard!.instantiateViewController(withIdentifier: "ModalNavigationController") as! ShariNavigationController
modalNavigationController.parentNavigationController = navigationController
navigationController?.si.present(modalNavigationController)
```
- UITabBarController
```swift
let modalNavigationController = storyboard!.instantiateViewController(withIdentifier: "ModalNavigationController") as! ShariNavigationController
modalNavigationController.parentTabBarController = tabBarController
tabBarController?.si.present(modalNavigationController)
```
You can change background color using following code:
```swift
ShariSettings.backgroundColorOfOverlayView = UIColor.redColor()
```
You can change with following code whether view should transform scale down:
```swift
ShariSettings.shouldTransformScaleDown = true
```
## ModalViewController
- Create NavigationController and ViewController in storyboards.
- Input `Shari.NavigationController` in Custom Class for NavigationController.

### Closing a window
You can close using the following code in viewController:
```swift
let currentNavigationController = navigationController
currentNavigationController?.si.dismiss {
// something
}
```
## Author
nakajijapan, pp.kupepo.gattyanmo@gmail.com
## License
Shari is available under the MIT license. See the LICENSE file for more info.