{"id":26201611,"url":"https://github.com/honzachalupa/swiftwebview","last_synced_at":"2025-07-06T22:39:08.093Z","repository":{"id":281837125,"uuid":"946281043","full_name":"honzachalupa/SwiftWebView","owner":"honzachalupa","description":"SwiftWebView is a Swift Package that provides an easy-to-use WebView implementation for SwiftUI. It wraps WKWebView functionality in a SwiftUI-friendly way, with built-in navigation controls and customization options.","archived":false,"fork":false,"pushed_at":"2025-03-11T11:29:49.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T12:27:32.834Z","etag":null,"topics":["library","swift","swiftui","web","webview"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/honzachalupa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-03-10T22:35:07.000Z","updated_at":"2025-03-11T11:28:55.000Z","dependencies_parsed_at":"2025-03-11T12:38:24.600Z","dependency_job_id":null,"html_url":"https://github.com/honzachalupa/SwiftWebView","commit_stats":null,"previous_names":["honzachalupa/swiftwebview"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/honzachalupa/SwiftWebView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzachalupa%2FSwiftWebView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzachalupa%2FSwiftWebView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzachalupa%2FSwiftWebView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzachalupa%2FSwiftWebView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/honzachalupa","download_url":"https://codeload.github.com/honzachalupa/SwiftWebView/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzachalupa%2FSwiftWebView/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263984989,"owners_count":23539769,"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":["library","swift","swiftui","web","webview"],"created_at":"2025-03-12T03:22:39.002Z","updated_at":"2025-07-06T22:39:08.065Z","avatar_url":"https://github.com/honzachalupa.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftWebView\n\nA lightweight, customizable WebView component for SwiftUI applications.\n\n## Overview\n\nSwiftWebView is a Swift Package that provides an easy-to-use WebView implementation for SwiftUI. It wraps WKWebView functionality in a SwiftUI-friendly way, with built-in navigation controls and customization options.\n\n## Requirements\n\n- iOS 17.0+\n- watchOS 10.0+\n- tvOS 17.0+\n- visionOS 1.0+\n- macOS 14.0+\n- Swift 6.0+\n\n## Installation\n\n### Swift Package Manager\n\n1. In Xcode, select File \u003e Add Packages...\n2. Enter the repository URL: `https://github.com/honzachalupa/SwiftWebView.git`\n3. Select the version or branch you want to use\n4. Click \"Add Package\"\n\n## Usage\n\n### Basic Implementation\n\n```swift\nimport SwiftUI\nimport SwiftWebView\n\nstruct ContentView: View {\n    @State private var urlString = \"https://apple.com\"\n\n    var body: some View {\n        SwiftWebView(\n            urlString: $urlString\n        )\n    }\n}\n```\n\n### Control Variants\n\nSwiftWebView offers three control variants:\n\n- `.fixed`: Shows controls fixed at the top of the view\n- `.closable`: Shows controls that can be collapsed/expanded with a button\n- `.hidden`: Hides all controls (default)\n\n```swift\n// With fixed controls\nSwiftWebView(\n    urlString: $urlString,\n    controls: .fixed\n)\n\n// With closable controls\nSwiftWebView(\n    urlString: $urlString,\n    controls: .closable\n)\n\n// With hidden controls (default)\nSwiftWebView(\n    urlString: $urlString,\n    controls: .hidden\n)\n```\n\n### Custom Submit Button Label\n\nYou can customize the label of the submit button in the controls:\n\n```swift\nSwiftWebView(\n    urlString: $urlString,\n    controls: .fixed,\n    submitButtonLabel: \"Search\"\n)\n```\n\n### Programmatic Navigation\n\nYou can programmatically navigate to URLs by changing the `urlString` binding:\n\n```swift\nstruct ContentView: View {\n    @State private var urlString = \"https://apple.com\"\n\n    var body: some View {\n        VStack {\n            SwiftWebView(\n                urlString: $urlString,\n                controls: .fixed\n            )\n\n            Button(\"Go to Google\") {\n                urlString = \"https://google.com\"\n            }\n        }\n    }\n}\n```\n\n### Full-Screen Implementation\n\nFor a full-screen implementation, you can ignore safe areas:\n\n```swift\nSwiftWebView(\n    urlString: $urlString,\n    controls: .closable\n)\n.ignoresSafeArea(SafeAreaRegions.all, edges: [.bottom])\n```\n\n## Features\n\n- Automatic handling of URL prefixes (adds https:// if missing)\n- Built-in navigation controls (back, forward, reload)\n- URL input field with submit functionality\n- Synchronization of displayed URL with the address bar\n- Support for collapsible controls to maximize screen space\n\n## License\n\nThis library is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonzachalupa%2Fswiftwebview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhonzachalupa%2Fswiftwebview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonzachalupa%2Fswiftwebview/lists"}