The clean and shiny search bar that does what UISearchBar does only with dirty hacks. This view is designed to tackle the customization limits of UISearchBar. The difference here is that this class does not inherit UISearchBar but composes a new UIView object by using a UITextField that is much easier to use. These are the limits of the UISearchBar:
Since I use a UITextField these restrictions do not apply.
In Xcode open your target list and select your project. Click the tab Swift Packages
and there the small +
icon. Enter the URL of this repository,
select the version you want to install - usually the preset is okay - and
confirm.
Since SHSearchBar uses localized resources I dropped CocoaPods support in favor of SPM from version 2.0.0
.
Please integrate the package via SPM (see above).
Since SHSearchBar uses localized resources I dropped Carthage support in favor of SPM from version 2.0.0
.
Please integrate the package via SPM (see above).
The repo includes an example project. It shows shows different use cases of
the search bar. To run it, just open and run ./Example/SHSearchBarExample.xcodeproj
. The following images show some
use cases:
The code documentation is generated and hosted by Swift Package Index (powered by DocC)
To release this Swift package the following steps have to be taken:
release-x.y.z
bash <(curl -H -s https://raw.githubusercontent.com/Blackjacx/Scripts/master/frameworks/bootstrap.sh)
to update to the latest shared development filesbundle update
to update all Ruby gemsbundle exec fastlane release framework:"SHSearchBar" version:"x.y.z"
to release the new versionSHSearchBar release x.y.z 🎉
▸ 🚀 SHSearchBar (x.y.z) successfully published
▸ 📅 September 2nd
▸ 🌎 https://swiftpackageindex.com/Blackjacx/SHSearchBar
▸ 🌎 https://github.com/Blackjacx/SHSearchBar/releases/latest
▸ 👍 Tell your friends!
#spm #search #ios #apple #xcode #uisearchbar #swiftpackagemanager
Stefan Herold • 🐦 @Blackjacxxx
Thanks to all of you who are part of this:
SHSearchBar is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 249 |
Last commit: 1 week ago |
This version is all about making SHSearchBar compatible with SPM and Swift 5.3.
I had to say goodbye to Cocoapods
and Carthage
. Since Apple recommends to not make assumptions about resource locations I have to use Bundle.module
(read more about it here and here) which is not auto-generated by Carthage or Cocoapods at the moment. Apart from that I cannot detect the dependency manager at runtime and therefore would have to fallback to my own resource location algorithm. I don't know if this was intended by Apple 🤷...
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics