This is the WKWebView customization that powers the Forem (coming soon) and DEV mobile apps.
The Project supports iOS 13.x but features like Picture in Picture are only available for iPhones on iOS 14.x
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. Once you have your Swift package set up, adding ForemWebView as a dependency is as easy as adding it to the dependencies value of your Package.swift.
dependencies: [
.package(url: "https://github.com/forem/ForemWebView-ios.git", .upToNextMajor(from: "1.0.0"))
]
We've moved to supporting SPM and not Carthage or CocoaPods. If interested in contributing, PRs to support these are welcome!
After importing the framework into your project you can initialize the ForemWebView like you would any other WKWebView (Storyboard, programmatically, etc). This custom WKWebView
implementation will handle it's own WKNavigationDelegate
, so instead of implementing this logic yourself please rely on the provided ForemWebViewDelegate
for callbacks.
We have two deep dive documents:
- ForemWebView deep dive is a walkthrough of the capabilities available when you're using the Framework in your project
- Native Bridge deep dive documents the native interface used to communicate between the Web (DOM + JS) and Swift contexts
- Using SwiftUI? We would appreciate your feedback after trying out the framework.
- If your project requires more detailed access to
WKNavigationDelegate
callbacks please add a feature request.
Bug reports and feature requests are welcome in the issue tracker.
For Pull Requests:
- Fork and clone the project.
- Create a branch, naming it either a feature or bug: git checkout -b feature/that-new-feature or bug/fixing-that-bug
- Code and commit your changes. Bonus points if you write a good commit message: git commit -m 'Add some feature'
- Push to the branch: git push origin feature/that-new-feature
- Create a pull request for your branch 🎉
The tests are run using the Example app bundled in the project. You can use XCode to run the test suite or from a Terminal with the following command:
# Make sure the `destination` param is using an iOS/Simulator available in your local environment
set -o pipefail && xcodebuild -scheme ForemWebView -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=14.2,name=iPhone 12 Pro Max' test | xcpretty
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please see the LICENSE file in our repository for the full text.
Like many open source projects, we require that contributors provide us with a Contributor License Agreement (CLA). By submitting code to the Forem project, you are granting us a right to use that code under the terms of the CLA.
Our version of the CLA was adapted from the Microsoft Contributor License Agreement, which they generously made available to the public domain under Creative Commons CC0 1.0 Universal.
Any questions, please refer to our license FAQ doc or email [email protected]