{"id":16487235,"url":"https://github.com/nerdsupremacist/snap","last_synced_at":"2025-10-04T15:52:35.157Z","repository":{"id":40621483,"uuid":"281512701","full_name":"nerdsupremacist/Snap","owner":"nerdsupremacist","description":"A customizable Snapping Drawer à la Apple Maps.\u2028\u2028 100% in SwiftUI.","archived":false,"fork":false,"pushed_at":"2022-02-20T23:43:01.000Z","size":4321,"stargazers_count":717,"open_issues_count":6,"forks_count":35,"subscribers_count":13,"default_branch":"develop","last_synced_at":"2024-10-12T13:33:06.815Z","etag":null,"topics":["drawer","swiftui"],"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/nerdsupremacist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["nerdsupremacist"]}},"created_at":"2020-07-21T21:57:12.000Z","updated_at":"2024-10-04T15:30:22.000Z","dependencies_parsed_at":"2022-07-14T04:10:33.840Z","dependency_job_id":null,"html_url":"https://github.com/nerdsupremacist/Snap","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdsupremacist%2FSnap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdsupremacist%2FSnap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdsupremacist%2FSnap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdsupremacist%2FSnap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nerdsupremacist","download_url":"https://codeload.github.com/nerdsupremacist/Snap/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256112,"owners_count":20909240,"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":["drawer","swiftui"],"created_at":"2024-10-11T13:33:17.547Z","updated_at":"2025-10-04T15:52:30.093Z","avatar_url":"https://github.com/nerdsupremacist.png","language":"Swift","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg max-width=\"500\" style=\"object-fit: contain; width: 100%;\" src=\"https://github.com/nerdsupremacist/Snap/blob/develop/Images/logo.png?raw=true\"\u003e\n\u003c/p\u003e\n\n# Snap\n\nA customizable Snapping Drawer à la Apple Maps, Apple Music, Stocks, Overcast, etc.. 100% in SwiftUI \n\nThis is heavily inspired by [Rideau](https://github.com/muukii/Rideau) and based on this [Gist](https://gist.github.com/mshafer/7e05d0a120810a9eb49d3589ce1f6f40) by [mshafer](https://github.com/mshafer).\n\nHere's a short demo where I reconstructed the Apple Maps UI:\n\n\u003cimg height=\"450\" src=\"https://github.com/nerdsupremacist/Snap/blob/develop/Images/demo.gif?raw=true\"\u003e\n\n## Installation\n### Swift Package Manager\n\nYou can install Snap via [Swift Package Manager](https://swift.org/package-manager/) by adding the following line to your `Package.swift`:\n\n```swift\nimport PackageDescription\n\nlet package = Package(\n    [...]\n    dependencies: [\n        .package(url: \"https://github.com/nerdsupremacist/Snap.git\", from: \"0.1.0\")\n    ]\n)\n```\n\n## Usage\n\nSnap allows you to set up either 1, 2 or 3 Snapping points and customize your UI depending on where you are.\n\nFor example if we want to recreate the Apple Maps UI we could write the following:\n\n```swift\nimport MapKit\nimport Snap\nimport SwiftUI\n\nstruct ContentView: View {\n    @State private var region = MKCoordinateRegion(...)\n\n    var body: some View {\n        ZStack {\n            Map(coordinateRegion: $region)\n\n            SnapDrawer(large: .paddingToTop(24), medium: .fraction(0.4), tiny: .height(100), allowInvisible: false) { state in\n                VStack(alignment: .leading, spacing: 10) {\n                    SearchBar()\n\n                    if state != .tiny {\n                        Favorites()\n                            .transition(.scale)\n                    }\n\n                    if state == .large {\n                        Recents()\n                            .transition(.scale)\n                    }\n                }\n            }\n        }\n    }\n}\n```\n\nFeel free to explore the API yourself and play around with it.\n\nOther features include:\n- Listening to state changes via a `@Binding`\n- Setting a background view\n\n## Contributions\nContributions are welcome and encouraged!\n\n## License\nSnap is available under the MIT license. See the LICENSE file for more info.\n","funding_links":["https://github.com/sponsors/nerdsupremacist"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerdsupremacist%2Fsnap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerdsupremacist%2Fsnap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerdsupremacist%2Fsnap/lists"}