{"id":20571473,"url":"https://github.com/kf99916/progresswebviewcontroller","last_synced_at":"2025-04-06T06:09:54.018Z","repository":{"id":45514966,"uuid":"106895689","full_name":"kf99916/ProgressWebViewController","owner":"kf99916","description":"A webViewController implemented by WKWebView with a progress bar in the navigation bar","archived":false,"fork":false,"pushed_at":"2025-01-14T15:33:20.000Z","size":770,"stargazers_count":86,"open_issues_count":2,"forks_count":26,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-30T05:06:21.919Z","etag":null,"topics":["assigned-cookies","blank-target","bypass-ssl","cocoapods","in-app-browser","navigation","navigationbar","progress-bar","self-signed-certificate","swift","toolbar","webview","webviewcontroller","wkwebview"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kf99916.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-14T03:42:15.000Z","updated_at":"2025-01-14T15:33:24.000Z","dependencies_parsed_at":"2022-07-17T14:19:19.575Z","dependency_job_id":"a4464647-f645-4b28-a010-bf513abb7927","html_url":"https://github.com/kf99916/ProgressWebViewController","commit_stats":{"total_commits":136,"total_committers":2,"mean_commits":68.0,"dds":"0.20588235294117652","last_synced_commit":"8224ae79eded2215776d00c036304b871582be7e"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kf99916%2FProgressWebViewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kf99916%2FProgressWebViewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kf99916%2FProgressWebViewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kf99916%2FProgressWebViewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kf99916","download_url":"https://codeload.github.com/kf99916/ProgressWebViewController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441053,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assigned-cookies","blank-target","bypass-ssl","cocoapods","in-app-browser","navigation","navigationbar","progress-bar","self-signed-certificate","swift","toolbar","webview","webviewcontroller","wkwebview"],"created_at":"2024-11-16T05:16:19.943Z","updated_at":"2025-04-06T06:09:53.994Z","avatar_url":"https://github.com/kf99916.png","language":"Swift","readme":"# ProgressWebViewController\n\nA WebViewController implemented by WKWebView with a progress bar in the navigation bar. The WebViewController is safari-like web browser.\n\n[![CocoaPods](https://img.shields.io/cocoapods/dt/ProgressWebViewController.svg)](https://cocoapods.org/pods/ProgressWebViewController)\n[![GitHub stars](https://img.shields.io/github/stars/kf99916/ProgressWebViewController.svg)](https://github.com/kf99916/ProgressWebViewController/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/kf99916/ProgressWebViewController.svg)](https://github.com/kf99916/ProgressWebViewController/network)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/ProgressWebViewController.svg)](https://cocoapods.org/pods/ProgressWebViewController)\n[![Platform](https://img.shields.io/cocoapods/p/ProgressWebViewController.svg)](https://github.com/kf99916/ProgressWebViewController)\n[![GitHub license](https://img.shields.io/github/license/kf99916/ProgressWebViewController.svg)](https://github.com/kf99916/ProgressWebViewController/blob/master/LICENSE)\n\n![ProgressWebViewController](/screenshots/progressWebViewController.png 'ProgressWebViewController') ![ProgressWebViewController](/screenshots/progressWebViewController2.png 'ProgressWebViewController')\n\n## Features\n\n- :white_check_mark: Progress bar in navigation bar\n- :white_check_mark: Bypass SSL according to the assigned hosts.( i.e., you can access the self-signed certificate websites with ProgressWebViewController)\n- :white_check_mark: Customize bar button items\n- :white_check_mark: Assign cookies to the web view\n- :white_check_mark: Browse the local html files\n- :white_check_mark: Support large titles for navigation bars in iOS 11\n- :white_check_mark: Support custom headers\n- :white_check_mark: Support custom user agent\n- :white_check_mark: Open the special urls including the app store, tel, mailto, sms, and \\_blank with other apps\n- :white_check_mark: Support the pull-to-refresh\n- :white_check_mark: Support the push navigation way\n\n## Requirements\n\n- iOS 13.0+\n\n## Installation\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.\n\nOnce you have your Swift package set up, adding ProgressWebViewController as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/kf99916/ProgressWebViewController.git\")\n]\n```\n\n### CocoaPods\n\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate ProgressWebViewController into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'ProgressWebViewController'\n```\n\n## Usage\n\n### Import\n\n```swift\nimport ProgressWebViewController\n```\n\n### Integration\n\n### ProgressWebViewController\n\nA view controller with WKWebView and a progress bar in the navigation bar\n\n`var url: URL?` the url to request  \n`var tintColor: UIColor?` the tint color for the progress bar, navigation bar, and tool bar  \n`var delegate: ProgressWebViewControllerDelegate?` the delegate for ProgressWebViewController  \n`var scrollViewDelegate: ProgressWebViewControllerScrollViewDelegate?` the delegate for scroll view\n`var bypassedSSLHosts: [String]?` the bypassed SSL hosts. The hosts must also be disabled in the App Transport Security.  \n`var cookies: [HTTPCookie]?` the assigned cookies  \n`var headers: [String: String]?` the custom headers  \n`var userAgent: String?` the custom user agent  \n`var urlsHandledByApp: [String: Any]` configure the urls handled by other apps (default `[ \"hosts\": [\"itunes.apple.com\"], \"schemes\": [\"tel\", \"mailto\", \"sms\"], \"_blank\": true ]`)  \n`var websiteTitleInNavigationBar = true` show the website title in the navigation bar  \n`var doneBarButtonItemPosition: NavigationBarPosition` the position for the done bar button item. the done barbutton item is added automatically if the view controller is presented.(default `.left`)  \n`var leftNavigaionBarItemTypes: [BarButtonItemType]` configure the bar button items in the left navigation bar (default `[]`)  \n`var rightNavigaionBarItemTypes: [BarButtonItemType]` configure the bar button items in the right navigation bar (default `[]`)  \n`var toolbarItemTypes: [BarButtonItemType]` configure the bar button items in the toolbar of navigation controller (default `[.back, .forward, .reload, .activity]`)  \n`var navigationWay: [NavigationWay]` configure the navigation way for clicking links (default `.browser`)  \n`var pullToRefresh: Bool` enable/disable the pull-to-refresh (default `false`)\n\n#### Subclassing\n\nYou should set up the webview in `loadView()` and set up others in `viewDidLoad()`\n\n```swift\nclass MyWebViewController: ProgressWebViewController {\n    override open func loadView() {\n        super.loadView()\n\n        // set up webview, including cookies, headers, user agent, and so on.\n    }\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        // Do any additional setup after loading the view.\n    }\n\n    // Other methods\n}\n```\n\n### ProgressWebViewControllerDelegate\n\nThe delegate for ProgressWebViwController\n\n`optional func progressWebViewController(_ controller: ProgressWebViewController, canDismiss url: URL) -\u003e Bool`  \n`optional func progressWebViewController(_ controller: ProgressWebViewController, didStart url: URL)`  \n`optional func progressWebViewController(_ controller: ProgressWebViewController, didFinish url: URL)`  \n`optional func progressWebViewController(_ controller: ProgressWebViewController, didFail url: URL, withError error: Error)`  \n`optional func progressWebViewController(_ controller: ProgressWebViewController, decidePolicy url: URL) -\u003e Bool`\n`optional func initPushedProgressWebViewController(url: URL) -\u003e ProgressWebViewController`\n\n### ProgressWebViewControllerScrollViewDelegate\n\nThe delegate for scroll view\n\n`optional func scrollViewDidScroll(_ scrollView: UIScrollView)`\n\n### BarButtonItemType\n\nThe enum for bar button item\n\n```swift\nenum BarButtonItemType {\n    case back\n    case forward\n    case reload\n    case stop\n    case activity\n    case done\n    case flexibleSpace\n}\n```\n\n### NavigationBarPosition\n\nThe enum for position of bar button item in the navigation bar\n\n```swift\nenum NavigationBarPosition {\n    case none\n    case left\n    case right\n}\n```\n\n### NavigationWay\n\nThe enum for navigation way\n\n```swift\nenum NavigationWay {\n    case browser\n    case push\n}\n```\n\n## Apps using ProgressWebViewController\n\nIf you are using ProgressWebViewController in your app and want to be listed here, simply create a pull request.\n\nI am always curious who is using my projects :)\n\n[Hikingbook](https://itunes.apple.com/app/id1067838748) - by Zheng-Xiang Ke\n\n![Hikingbook](apps/Hikingbook.png)\n\n## Demo\n\nProgressWebViewControllerDemo is a simple demo app which browse the Apple website with ProgressWebViewController.\n\n## Author\n\nZheng-Xiang Ke, kf99916@gmail.com\n\n## License\n\nProgressWebViewController is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkf99916%2Fprogresswebviewcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkf99916%2Fprogresswebviewcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkf99916%2Fprogresswebviewcontroller/lists"}