SpotlightSearch
Spotlight Search UI written in SwiftUI and Combine.
SpotlightSearch aims to provide macOS spotlight search UI/UX and beyond.
Screenshots
Youtube video URL Link for how it works in dark mode:
link0
Youtube video URL Link for how it works in normal mode:
link0
At a Glance
Features
- [x] Written in SwiftUI and Combine 100%
- [x] It aims to provide quick and beautiful search UI/UX out of box like macOS Spotlight Search in iOS and beyond.
- [x] full geared toward SwiftUI, Combine and MVVM.
- [x] easy and simple to use API.
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
It includes examples for UIKit as well as SwiftUI.
Requirements
- iOS 13.0 or later
- Swift 5.0 or later
- Xcode 11.0 or later
Getting Started
- SwiftUI Simplified version. just copy and paste below code. It will work.
- clone repository
- Switch and select 'QuickExample' target.
- Build and run.
In 'QuickExample' directory, there are sample codes.
- SwiftUI MVVM example code with basic networking operation using Combine.
You need to set your own logic.
- clone repository
- Switch and Select 'SwiftUIExample' target
- build and run.
In SwiftExample directory, there are sample codes.
One Caveat
Currently, SpotlightSearch uses GLOBAL API to change UITableViewCell and UITableView property GLOBALLY like below
since SwiftUI is in the very early stage of development and there are plenty of lack APIs out there and
not possible to implement such UI Change while using SwiftUI 100%.
Take special care when applying SpotlightSearch into your app which might cause unexpected UI/UX change in your app.
I will keep my eyes on the SwiftUI API change and when possible, I will fix this workaround as soon as released.
Note that SpotlightSearch uses these implementation in the initializer as below at the latest version.
Installation
There are two ways officially to use SpotlightSearch in your project:
- using CocoaPods
- using Swift Package Manager
Installation with CocoaPods
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the Get Started section for more details.
Podfile
First,
then in your root project,
Installation with Swift Package Manager (Xcode 11+)
Swift Package Manager (SwiftPM) is a tool for managing the distribution of Swift code as well as C-family dependency. From Xcode 11, SwiftPM got natively integrated with Xcode.
SpotlightSearch support SwiftPM from version 5.1.0. To use SwiftPM, you should use Xcode 11 to open your project. Click File
-> Swift Packages
-> Add Package Dependency
, enter SpotlightSearch repo's URL. Or you can login Xcode with your GitHub account and just type SpotlightSearch
to search.
After select the package, you can choose the dependency type (tagged version, branch or commit). Then Xcode will setup all the stuff for you.
If you're a framework author and use SpotlightSearch as a dependency, update your Package.swift
file:
Author
License
SpotlightSearch is available under the MIT license. See the LICENSE file for more info.
References
PhotoCell :
Time and Location-based photo browsing iOS app where you can download the photos and edit as you like for free.


