MMModalWebViewController 1.0.2

MMModalWebViewController 1.0.2

Felix Nithammer维护。



MMModalWebViewController 是一个优雅且可定制的 ViewController,用于在 iOS 上展示网站。

Platform: iOS 11.0+ Language: Swift 5 CocoaPods compatible Carthage compatible License: MIT

兼容性

MMModalWebViewController 需要 iOS 11+ 和兼容 Swift 5 项目的功能。

安装

pod 'MMModalWebViewController'
github "mammutmedia/MMModalWebViewController"

用法

MMModalWebViewController 旨在使用起来轻松自如。只需要设置配置并展示 ViewController。

import MMModalWebViewController

let config = MMConfig
present(url: URL(string: "https://github.com")!, configuration: config)

配置

/// Use this property to modify the default icons.
icons = MMIcons()
/// Use this property to modify the tint of the header items. Defaults to .labelColor / .black
tint: UIColor?
/// Use this property to modify the text color of the url in the header. Defaults to .systemGray2 / R:174 G:174 B:178
urlColor: UIColor?
/// Use this property to modify the background color of the controller. Defaults to .systemBackground / .white
backgroundColor: UIColor?
/// Use this property to show or hide the back and forward buttons. Defaults to true
showNavigation: Bool = true
/// Use this property to modify the loading text. Defaults to "Loading..."
loadingText: String = "Loading..."
/// Use this property to modify the progress bar color. Defaults to .blue
progressBarColor: UIColor = .blue
/// Use this property to modify the corner radius. Defaults to 16.0
cornerRadius: CGFloat = 16.0
/// Use this property to modify the top margin. Defaults to 40.0
topMargin: CGFloat = 40.0
/// Use this property to set the delegate
controllerDelegate: MMModalWebViewControllerDelegate?

代表者

extension ViewController: MMModalWebViewControllerDelegate {
    func willAppear(_ webViewController: MMModalWebViewController, webView: WKWebView) {
        print(#function)
    }

    func didAppear(_ webViewController: MMModalWebViewController, webView: WKWebView) {
        print(#function)
    }

    func willDisappear(_ webViewController: MMModalWebViewController, webView: WKWebView) {
        print(#function)
    }

    func didDisappear(_ webViewController: MMModalWebViewController, webView: WKWebView) {
        print(#function)
    }

    func contentDidLoad(_ webViewController: MMModalWebViewController, webView: WKWebView) {
        print(#function)
    }
}

贡献

我们很高兴开源这个库。我们在许多自己的项目中使用了它。

我们将仅修复关键错误,因此,对于任何非关键问题或功能请求,我们希望能够依靠社区使用此库添加他们需要的功能。

作者

Felix Nithammer

许可证

MMModalWebViewController 在 MIT 许可下发布。有关详细信息,请参阅 LICENSE 文件。