Shari is the alternative to the library of UIPickerView(drum roll) in Swift. You can select a item using UITableView.
Clone or download
Pull request Compare This branch is 86 commits behind nakajijapan:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Shari-Demo.xcodeproj
Shari-Demo
Shari-DemoUITests
Shari.xcodeproj
Shari.xcworkspace
Shari
ShariTests
Sources
.gitignore
.swift-version
.travis.yml
LICENSE
README.md
Rakefile
Shari.podspec
demo.gif
hoge.txt
shari01.png

README.md

Shari for Swift

Carthage Version License Platform

Shari is the alternative to the library of UIPickerView (drum roll) in Swift. You can select a item using UITableView.

Shari

Requirements

  • iOS 8.0+
  • Xcode 8+
  • Swift 2.3

CocoaPods

Shari is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Shari"

Then, run the following code:

$ pod install

Carthage

Carthage is a decentralized dependency manager for Cocoa applications.

$ brew update
$ brew install carthage

To integrate Shari into your Xcode project using Carthage, specify it in your Cartfile:

github "nakajijapan/Shari"

Then, run the following command to build the Shari framework:

$ carthage update

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

ViewController

  • UINavigationController
let modalNavigationController = self.storyboard!.instantiateViewControllerWithIdentifier("ModalNavigationController") as! Shari.NavigationController
modalNavigationController.parentNavigationController = self.navigationController
self.navigationController?.addChildViewController(modalNavigationController)
self.navigationController?.si_presentViewController(modalNavigationController)
  • UITabBarController
let modalNavigationController = storyboard!.instantiateViewControllerWithIdentifier("ModalNavigationController") as! Shari.NavigationController
modalNavigationController.parentTabBarController = tabBarController
tabBarController?.addChildViewController(modalNavigationController)
tabBarController?.si_presentViewController(modalNavigationController)

You can change background color using following code:

Shari.BackgroundColorOfOverlayView = UIColor.redColor()

You can change with following code whether view should transform scale down:

Shari.ShouldTransformScaleDown = true

ModalViewController

  • Create NavigationController and ViewController in storyboards.
  • Input Shari.NavigationController in Custom Class for NavigationController.

Shari

Closing a window

You can close using the following code in viewController:

let currentNavigationController = self.navigationController as! Shari.NavigationController
currentNavigationController.parentNavigationController!.si_dismissModalView({ () -> Void in
// something
})

Author

nakajijapan, pp.kupepo.gattyanmo@gmail.com

License

Shari is available under the MIT license. See the LICENSE file for more info.