GyozaKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'GyozaKit'
and run
pod install
When building a Gyoza the most basic example is the one shown below. The only property you need to set on the builder is a message.
import GyozaKit
let gyoza = Gyoza { builder in
builder.message = "Don't forget to wash the dishes!"
}
gyoza.show(on: self.view)
Once we're happy with our Gyoza
we can call show(on: self.view)
which will then present the message onto the current view.
import GyozaKit
let gyoza = Gyoza { builder in
builder.message = "Jaded zombies acted quaintly but kept driving their oxen forward."
builder.messageColor = .white
builder.backgroundColor = UIColor(red: 0.20, green: 0.20, blue: 0.20, alpha: 1.00)
builder.actionLabelColor = UIColor(red: 0.16, green: 0.90, blue: 0.40, alpha: 1.00)
builder.action = Gyoza.Action(title: "ACTION", handler: {
# ...
})
}
gyoza.show(on: self.view)
You can now specify where to pin a Gyoza on screen using the following example.
import GyozaKit
let gyoza = Gyoza { builder in
builder.message = "Welcome back, John! 😍"
builder.pinTo = .top // this defaults to bottom if not specified
}
gyoza.show(on: self.view)
GyozaKit is available under the MIT license. See the LICENSE file for more info.