{"id":21965431,"url":"https://github.com/hitendradeveloper/hssearchable","last_synced_at":"2025-04-24T02:53:39.785Z","repository":{"id":240724221,"uuid":"101607213","full_name":"hitendradeveloper/HSSearchable","owner":"hitendradeveloper","description":"The easiest way to search from UITableView using UISearchBar or UISearchBarController in the minimum line of code.","archived":false,"fork":false,"pushed_at":"2019-02-15T11:43:48.000Z","size":547,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T02:53:33.050Z","etag":null,"topics":["cocoapods","datamodel","hitendra","hitendra-solanki","hitendra-solanki-ios","hssearchable","modal","pods","protocol","serchable","solanki","swift","swift-protocol","swift5","uisearchbar","uitableview","uiviewcontroller"],"latest_commit_sha":null,"homepage":"https://medium.com/@hitendrahckr","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/hitendradeveloper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-08-28T05:33:04.000Z","updated_at":"2025-02-06T04:50:57.000Z","dependencies_parsed_at":"2024-05-20T18:24:15.083Z","dependency_job_id":null,"html_url":"https://github.com/hitendradeveloper/HSSearchable","commit_stats":null,"previous_names":["hitendradeveloper/hssearchable"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitendradeveloper%2FHSSearchable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitendradeveloper%2FHSSearchable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitendradeveloper%2FHSSearchable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitendradeveloper%2FHSSearchable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hitendradeveloper","download_url":"https://codeload.github.com/hitendradeveloper/HSSearchable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552037,"owners_count":21449162,"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":["cocoapods","datamodel","hitendra","hitendra-solanki","hitendra-solanki-ios","hssearchable","modal","pods","protocol","serchable","solanki","swift","swift-protocol","swift5","uisearchbar","uitableview","uiviewcontroller"],"created_at":"2024-11-29T12:40:26.580Z","updated_at":"2025-04-24T02:53:39.768Z","avatar_url":"https://github.com/hitendradeveloper.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HSSearchable\nEasiest way to search from UITableView using UISearchBar in minimum line of code in UIViewController\n\n![HSSearchable](https://github.com/hitendradeveloper/HSSearchable/blob/master/giphy.gif)\n\n## How to integreat source?\n1. Directly drag and drop the HSSearchable.swift into your xcode project.\n\n2. Most recommanded: install via cocoapods ([How to use cocoapods](https://guides.cocoapods.org/using/getting-started.html \"more info\"))\n\n       pod 'HSSearchable'\n       \n       \n\n## How to use in code ? Just follow the simple steps :)\n    import HSSearchable\n    \n    //Suppose this is your datamodel\n    struct UserDM {\n      var name: String\n      var city: String\n     }\n\n1. extend your class or Structure using the SearchableData delegate\n\n\t   extension UserDM: SearchableData {\n        var searchValue: String{\n          return self.name + \" \" + self.city //this will search from the name and city both\n\n          //return self.name //this will search from the name only\n        }\n       }\n\t\n\n2. Create a variable of 'SearchableWrapper' in the viewController as property\n\n       var usersData = SearchableWrapper()\n       var users: [UserDM] { //use this array as you are using array for your tableview controller\n          return self.usersData.dataArray as! [UserDM]\n       }\n\n3. Set the searchbar delegate and Searching callback\n\n       override func viewDidLoad() {\n          super.viewDidLoad()\n          self.searchbar.delegate = self.usersData\n          self.usersData.searchingCallBack = { isSearching, searchText in\n              print(\"searching Text:= \\(searchText)\")\n              self.tableView.reloadData()\n          }\n          self.loadDummyData()\n       }\n\n4. Set the local array or load data from the server usign API|Webservice call\n\n        func loadDummyData(){\n              //This is just an example data\n              let user1 = UserDM(name: \"Hitendra Solanki\", city: \"Ahmedabad\")\n              let user2 = UserDM(name: \"Justina Flores\", city: \"Arizona\")\n              let user3 = UserDM(name: \"Lisa Minick\", city: \"Casper\")\n              let user4 = UserDM(name: \"Moises Patrick\", city: \"Reno\")\n              let user5 = UserDM(name: \"Martha Fisher\", city: \"Tacoma\")\n              let user6 = UserDM(name: \"Martha McDaniel\", city: \"Irvine\")\n              let array : Array\u003cUserDM = [\n                  user1,\n                  user2,\n                  user3,\n                  user4,\n                  user5,\n                  user6\n              ]\n              //In most of the cases, this data will come from the server side\n              self.usersData.serverArray = array;\n              self.tableView.reloadData()\n        }\n\t\n5. Optional Setps: \nHSSearchable also supports the optional customDelegate, using this you can handle default  UISearchabarDelegate methods in your own viewControllers.\n\n          self.usersData.customDelegate = self //implement UISearchbarDelegate in your class       \n\n\t\n# It's Done\n![It's Done](https://github.com/hitendradeveloper/HSSearchable/blob/master/2ah3x6.jpg)\n\n##\n\nContact:\n\ntwitter: @hitendrahckr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitendradeveloper%2Fhssearchable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhitendradeveloper%2Fhssearchable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitendradeveloper%2Fhssearchable/lists"}