{"id":13778873,"url":"https://github.com/thislooksfun/SwiftlySearch","last_synced_at":"2025-05-11T12:32:12.530Z","repository":{"id":54258401,"uuid":"272052185","full_name":"thislooksfun/SwiftlySearch","owner":"thislooksfun","description":"A small, lightweight UISearchController wrapper for SwiftUI","archived":true,"fork":false,"pushed_at":"2021-06-08T02:53:41.000Z","size":61,"stargazers_count":223,"open_issues_count":0,"forks_count":19,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-03T20:15:49.014Z","etag":null,"topics":["combine","combine-framework","deprecated","deprecated-api","deprecated-library","deprecated-repo","deprecated-repository","ios","ios-14","ios-library","ios13","obsolete","obsoleted","swift","swift-5","swift-library","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/thislooksfun.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":"SECURITY.md","support":null},"funding":{"github":["thislooksfun"]}},"created_at":"2020-06-13T17:09:36.000Z","updated_at":"2024-08-13T13:20:06.000Z","dependencies_parsed_at":"2022-08-13T10:10:51.656Z","dependency_job_id":null,"html_url":"https://github.com/thislooksfun/SwiftlySearch","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thislooksfun%2FSwiftlySearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thislooksfun%2FSwiftlySearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thislooksfun%2FSwiftlySearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thislooksfun%2FSwiftlySearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thislooksfun","download_url":"https://codeload.github.com/thislooksfun/SwiftlySearch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225048999,"owners_count":17412908,"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":["combine","combine-framework","deprecated","deprecated-api","deprecated-library","deprecated-repo","deprecated-repository","ios","ios-14","ios-library","ios13","obsolete","obsoleted","swift","swift-5","swift-library","swiftui"],"created_at":"2024-08-03T18:00:58.404Z","updated_at":"2024-11-17T14:31:01.918Z","avatar_url":"https://github.com/thislooksfun.png","language":"Swift","funding_links":["https://github.com/sponsors/thislooksfun"],"categories":["Swift","Search"],"sub_categories":["Content"],"readme":"# THIS PROJECT IS OBSOLETE\n\niOS 15 introduced [`.searchable()`][searchable], which is an official search bar\nimplementation for SwiftUI. As such this project is now obsolete. I will\ncontinue to keep it around as a polyfill for apps targeting \\\u003ciOS 15, but it\nwill no longer be actively developed and you should switch to the new system as\nsoon as you can. Thank you all for your support, and happy coding!\n\n# SwiftlySearch\n\nA small, lightweight UISearchController wrapper for SwiftUI\n\n## Installation\n\n### Manual:\n\nUpdate your `Package.swift` file:\n\n```swift\nlet package = Package(\n  ...,\n\n  dependencies: [\n    .package(\n      url: \"https://github.com/thislooksfun/SwiftlySearch.git\",\n      from: \"1.0.0\"),\n\n    ...\n  ],\n\n  ...\n)\n```\n\n### In Xcode:\n\n1. Go to File \u003e Swift Packages \u003e Add Package Depencency...\n2. Enter `https://github.com/thislooksfun/SwiftlySearch` as the URL\n3. Select your desired versioning constraint\n4. Click Next\n5. Click Finish\n\n## Usage\n\n```swift\nimport SwiftlySearch\n\nstruct MRE: View {\n  let items: [String]\n\n  @State\n  var searchText = \"\"\n\n  var body: some View {\n    NavigationView {\n      List(items.filter { $0.localizedStandardContains(searchText) }) { item in\n        Text(item)\n      }.navigationBarSearch(self.$searchText)\n    }\n  }\n}\n```\n\n## Known issues:\n\n([#12](https://github.com/thislooksfun/SwiftlySearch/issues/12)) `NavigationLink`s inside the `resultContent` don't work. This is a limitation of the UIKit/SwiftUI interaction, and thus out of my hands. If you require a seperate view for displaying search results you can use a workaround like shown below:\n\n```swift\nstruct ContentView: View {\n    @State\n    var searchText: String = \"\"\n\n    var body: some View {\n        NavigationView {\n            ZStack {\n                if searchText.isEmpty {\n                    NormalView()\n                } else {\n                    SearchResultsView(text: searchText)\n                }\n            }\n            .navigationBarSearch($searchText)\n        }\n    }\n}\n\nstruct NormalView: View {\n    var body: some View {\n        Text(\"Some view\")\n    }\n}\n\nstruct SearchResultsView: View {\n    var text: String\n\n    var body: some View {\n        VStack {\n            Text(\"You searched for \\(text)\")\n            NavigationLink(destination: Text(text)) {\n                Text(\"Let's go!\")\n            }\n        }\n    }\n}\n```\n\n\u003c!-- Links --\u003e\n\n[searchable]: https://developer.apple.com/documentation/swiftui/form/searchable(text:placement:)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthislooksfun%2FSwiftlySearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthislooksfun%2FSwiftlySearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthislooksfun%2FSwiftlySearch/lists"}