Automatically detect when a user takes a screenshot, and share that screenshot.
MIT License
Automatically detect when a user takes a screenshot, and share that screenshot. (with "UIActivityViewController")
To run the example project, clone the repo, and run pod install
from the Example directory first.
KAKUSAN is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'KAKUSAN'
KAKUSAN.shared.start()
var config = KAKUSAN.Config(text: "Share Text", url: URL(string: "https://example.com/"))
config.alert.title = "Share!"
config.alert.message = "Would you like to share screenshot?"
config.alert.style = .actionSheet
config.alert.delay = 2.0
config.alert.action.positiveText = "Done"
config.alert.action.negativeText = "Cancel"
config.watermark = KAKUSAN.Watermark(
image: UIImage(named: "watermark")!,
alpha: 0.4,
position: .bottomRight(padding: 16.0)
)
KAKUSAN.shared.configure(config)
KAKUSAN.shared.confirmationDelegate = self
// ConfirmationDelegate
extension ViewController: KAKUSANConfirmationDelegate {
func kakusanConfirmation(screenshot: UIImage, handler: @escaping KAKUSANHandler) {
// show custom dialog
}
}
anzfactory, [email protected]
KAKUSAN is available under the MIT license. See the LICENSE file for more info.