Cricket is an Swift iOS library for reporting bugs or sending feedback from within your app.
// Configure a handler
Cricket.handler = CricketEmailHandler(emailAddress: "[email protected]", subjectPrefix: "[iOS]", defaultSubject: "Cricket bug report")
// Show Cricket
Cricket.show()
One convenient way of using Cricket is to show it when the user shakes their phone.
For example, in your view controller:
override func motionEnded(_ motion: UIEventSubtype, with event: UIEvent?) {
if motion == .motionShake {
Cricket.show()
}
}
Cricket relies on handlers to submit the data. A handler is any class that conforms to the CricketHandler
protocol. Included in this project is a convenient CricketEmailHandler
class which will use the built-in email client for sending the feedback.
You can of course build your own handlers, for example if you wanted to report the feedback directly to your server via an API.
Simply assign your handler to Cricket before showing it, like so: Cricket.handler = MyCoolHandler()
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 9.3
Cricket is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Cricket'
Nebojsa Petrovic, [email protected]
Cricket is available under the MIT license. See the LICENSE file for more info.