{"id":27751208,"url":"https://github.com/1998code/SwiftGlass","last_synced_at":"2025-04-29T02:02:23.148Z","repository":{"id":288913896,"uuid":"969437302","full_name":"1998code/SwiftGlass","owner":"1998code","description":"Glassy Everything, even Old Devices. [ AI Assistant available below ]","archived":false,"fork":false,"pushed_at":"2025-04-22T10:06:16.000Z","size":115,"stargazers_count":262,"open_issues_count":0,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-23T07:38:15.587Z","etag":null,"topics":["apple","glass","ios","ipados","macos","swift","swiftglass","swiftui","tvos","visionos","watchos"],"latest_commit_sha":null,"homepage":"https://shareby.vercel.app/4zel3m","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/1998code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"github":"1998code"}},"created_at":"2025-04-20T06:22:59.000Z","updated_at":"2025-04-23T02:58:46.000Z","dependencies_parsed_at":"2025-04-20T12:55:09.441Z","dependency_job_id":null,"html_url":"https://github.com/1998code/SwiftGlass","commit_stats":null,"previous_names":["1998code/swiftglass"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1998code%2FSwiftGlass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1998code%2FSwiftGlass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1998code%2FSwiftGlass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1998code%2FSwiftGlass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1998code","download_url":"https://codeload.github.com/1998code/SwiftGlass/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251419988,"owners_count":21586526,"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":["apple","glass","ios","ipados","macos","swift","swiftglass","swiftui","tvos","visionos","watchos"],"created_at":"2025-04-29T02:02:17.416Z","updated_at":"2025-04-29T02:02:23.138Z","avatar_url":"https://github.com/1998code.png","language":"Swift","readme":"\u003cimg width=\"150\" alt=\"GK\" src=\"https://github.com/user-attachments/assets/e8ef2a81-eed4-4b52-a253-1f4563fed631\" /\u003e\n\n# SwiftGlass\n\n![Stable](https://img.shields.io/github/v/release/1998code/swiftglass?color=03A791\u0026label=Stable)\n![Beta](https://img.shields.io/github/v/release/1998code/swiftglass?include_prereleases\u0026color=3A59D1\u0026label=Beta)\n![Build Test](https://img.shields.io/github/actions/workflow/status/1998code/swiftglass/swift.yml?branch=main\u0026style=flat\u0026label=Build\u0026color=%237AE2CF)\n![Swift Version](https://img.shields.io/badge/Swift-5.9/6.1-teal.svg)\n\n![Platforms](https://img.shields.io/badge/Platforms-iOS%2015.0+%20|%20macOS%2014.0+%20|%20tvOS%2015.0+%20|%20watchOS%2010.0+%20|%20visionOS%201.0+-15437D.svg)\n![License](https://img.shields.io/badge/License-MIT-C8ECFE.svg)\n\n![SwiftGlass@3x](https://github.com/user-attachments/assets/7f289182-9717-4f42-a0d9-880d0fedaf86)\n\n## Features\n\n🔄 **Cross-platform**: Works on iOS, macOS, watchOS, tvOS, and visionOS\u003cbr/\u003e\n✨ **Native visionOS support**: Uses native glass effect on visionOS\u003cbr/\u003e\n🎨 **Highly customizable**: Adjust colors, materials, shadows, and more\u003cbr/\u003e\n🧩 **SwiftUI integration**: Simple ViewModifier implementation\n\n## Gallery\n\n| \u003cimg width=\"421\" alt=\"Screenshot 2025-04-20 at 4 16 55 PM\" src=\"https://github.com/user-attachments/assets/062a85c7-6269-4aee-a9b3-b2b336f2c3b0\" /\u003e | ![image](https://github.com/user-attachments/assets/1f5e3ceb-aff1-4f9a-a296-5713fa9164ca) | ![image](https://github.com/user-attachments/assets/f1417fa5-a3de-40f4-abd8-a1de2c9fe59d) |\n| -- | -- | -- |\n| iOS | watchOS I | watchOS II |\n\n| ![image](https://github.com/user-attachments/assets/0a5a65f3-7162-4a3b-aa58-97789803a37a) | ![image](https://github.com/user-attachments/assets/06195623-cf4b-427d-a4ec-17912c00ca10) |\n| -- | -- |\n| macOS (Dark) I | macOS (Dark) II |\n\n| ![image](https://github.com/user-attachments/assets/42febaa1-3ddd-4e04-b811-940e1e099ce4) | ![image](https://github.com/user-attachments/assets/594674a4-391e-46e6-a92f-411e6fbbca70) |\n| -- | -- |\n| tvOS I | tvOS II |\n\n| ![image](https://github.com/user-attachments/assets/23067498-c552-48bc-b80a-e5c51d82dbd1) | ![image](https://github.com/user-attachments/assets/52d0a618-5c06-41ba-9687-dac7bbf34a35) |\n| -- | -- |\n| visionOS | iPadOS |\n\n## Tested Platforms and Environment\n\n| Platform | iOS | macOS | watchOS | tvOS | visionOS |\n| -- | -- | -- | -- | -- | -- |\n| Version | 15.0+ | 14.0+ | 10.0+ | 15.0+ | 1.0+ |\n\n| Xcode Latest | Minimum | SVT |\n| -- | -- | -- |\n| 16.3 | 15.0 | 5.9 |\n\n![image](https://github.com/user-attachments/assets/99794cda-e879-4194-85fb-f6350ddf9db8)\n\n## Project Demo (Quick Starter)\n\n```\nOpen /Demo/Demo.xcodeproj\n```\n\u003e⚠️ To prevent resolving failed, please rename the root folder from SwiftGlass-xxx to SwiftGlass\n\n## Installation (on your project)\n\n### Swift Package Manager\n\nAdd SwiftGlass to your project through Swift Package Manager \n\n\u003ePROJECT \u003e Package Dependencies \u003e +\n```\nhttps://github.com/1998code/SwiftGlass.git\n```\n\n\u003cimg width=\"1248\" alt=\"Screenshot 2025-04-20 at 4 29 46 PM\" src=\"https://github.com/user-attachments/assets/443f3489-c8b2-4d4f-a716-0003ecab5951\" /\u003e\n\n\u003e Or you may add it manually as follows\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/1998code/SwiftGlass.git\", from: \"1.0.0\")\n]\n```\n\n## Usage\n\n### Basic Usage (View / Button / Anywhere)\n\n\u003cimg width=\"328\" alt=\"Screenshot 2025-04-20 at 2 41 51 PM\" src=\"https://github.com/user-attachments/assets/1c64b4a6-7e10-4ee8-8e81-a731891a10fb\" /\u003e\n\n\n```swift\nimport SwiftUI\nimport SwiftGlass\n\nstruct ContentView: View {\n    var body: some View {\n        Text(\"Hello, Glass!\")\n            .padding(40)\n            .glass() // Use default glass effect\n    }\n}\n```\n\n### Custom Glass Effect\n\n\u003cimg width=\"328\" alt=\"Screenshot 2025-04-20 at 2 40 11 PM\" src=\"https://github.com/user-attachments/assets/0c2c234a-2c74-4262-9a54-23d62ba03815\" /\u003e\n\n```swift\nVStack {\n    Text(\"Custom Glass\")\n    Image(systemName: \"sparkles\")\n}\n.padding(30)\n.glass(\n    radius: 20,\n    color: .blue,\n    material: .regularMaterial,\n    gradientOpacity: 0.7,\n    shadowColor: .blue,\n    shadowRadius: 10\n)\n```\n\n## Customization\n\nSwiftGlass offers extensive customization options:\n\n| Parameter | Type | Default | Description |\n|---|---|---|---|\n| `displayMode` | `.always` or `.automatic` | `.always` | Controls when the effect is displayed |\n| `radius` | `CGFloat` | `32` | Corner radius of the glass effect |\n| `color` | `Color` | `.white` | Base color for gradient and highlights |\n| `material` | `Material` | `.ultraThinMaterial` | SwiftUI material style |\n| `gradientOpacity` | `Double` | `0.5` | Opacity level for the gradient overlay |\n| `gradientStyle` | `.normal` or `.reverted` | `.normal` | Direction style of the gradient |\n| `strokeWidth` | `CGFloat` | `1.5` | Width of the border stroke |\n| `shadowColor` | `Color` | `.white` | Color of the drop shadow |\n| `shadowOpacity` | `Double` | `0.5` | Opacity level for the shadow |\n| `shadowRadius` | `CGFloat?` | `nil` | Blur radius for the shadow |\n| `shadowX` | `CGFloat` | `0` | Horizontal offset of the shadow |\n| `shadowY` | `CGFloat` | `5` | Vertical offset of the shadow |\n\n## Platform-Specific Notes\n\n- **visionOS**: On visionOS, SwiftGlass uses the native `.glassBackgroundEffect()` for optimal rendering and system integration\n- **Other platforms**: A custom implementation combines materials, gradients, and shadows to achieve a similar effect\n\n## Contributing\n\nContributions to SwiftGlass are welcome!\n\n- To report bugs or request features, please open an issue on GitHub\n- When submitting a pull request, please follow the coding style of the project\n\n## License\n\nMIT. Read the LICENSE file for details.\n\n## Translation\n\nThis doc is also available in:\n\nEnglish | [繁中](/README/README_tc.md) / [简中](/README/README_zh.md) / [粵語](/README/README_hc.md) | [日本語](/README/README_ja.md) | [한국어](/README/README_ko.md)\n\nPlease feel free to open a pull request and add new language(s) or fix any typos/mistakes.\n","funding_links":["https://github.com/sponsors/1998code"],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1998code%2FSwiftGlass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1998code%2FSwiftGlass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1998code%2FSwiftGlass/lists"}