KAKUSAN 0.5.0

KAKUSAN 0.5.0

anzfactory 维护。



KAKUSAN 0.5.0

KAKUSAN

CI Status Version License Platform

ANZSingleImageViewer

自动检测用户进行截图,并共享截图。
(使用 "UIActivityViewController")

示例

要运行示例项目,请克隆仓库,然后首先从 Example 目录中运行 pod install

依赖项

  • Xcode v10.1
  • Swift v4.2
  • iOS v10.0+

安装

KAKUSAN 可通过 CocoaPods 获得。要安装它,只需将以下行添加到您的 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 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。