BisKit is an iOS library to generate beautiful popups as the one featured when Apple Pencil is attached to the new iPad Pro.
...but you can also add other elements, that will be shown after the first animation. We call them toppings!
- Xcode 10 and later
- iOS 12 and later
- Swift 4.2 and later
To install BisKit through Carthage, simply add this line to your Cartfile
:
github "ho0t/BisKit"
To install BisKit through CocoaPods, simply add this line to your Podfile
:
pod 'BisKit'
Open your project, select File > Swift Packages > Add Package Depedency
and paste the repository URL into the search bar.
A more detailed guide can be found here: Adding Package Dependencies to Your App
To open a new Biscuit
, create a new instance of BiscuitViewController
and present it as a usual view controller:
let biscuit = BiscuitViewController(title: "My Pencil", timeout: 1.5)
self.present(biscuit, animated: true, completion: nil)
If you want to add one or more toppings, create a new instance of BiscuitViewController
by passing an array of UIView
s into the initializers and present it as a usual view controller.
let label = ToppingLabel(text: "Battery is low.")
let biscuit = BiscuitViewController(title: "My Pencil", timeout: 1.5)
self.present(biscuit, animated: true, completion: nil)
let percentage = ToppingLabel(level: 0.5, batteryState: .charging)
let biscuit = BiscuitViewController(title: "My Pencil", timeout: 1.5)
self.present(biscuit, animated: true, completion: nil)
While the library is working, there are still some tasks to do, like:
- Writing tests
- Fix minor UI issues
- Create other built-in toppings
- etc.
If you would like to contribute to this project, feel free to do it: your help will be really appreciated! 😉
This open source component is released under MIT License.
Nicola Giancecchi (Twitter) and Giovanni Filaferro (Twitter).