SpotlightViewKit
SpotlightViewKit is a framework, which might be considered as part of onboarding process. SpotlightView provides a very simple API to generate spotlight effect, and zoom on different parts of UI, and moves from one to another.
Install / Use
/learn @vovkroman/SpotlightViewKitREADME
SpotlightViewKit
SpotlightViewKit is a framework, which might be considered as part of onboarding process. SpotlightView provides a very simple API to generate spotlight effect, and zoom on different parts of UI, and moves from one to another. Besides, it's customizable (see Functionality).
Requirements (Programming language)
Swift 4.2 and upper.
Support
iOS 10.0 and upper
Functionality
- [x] Usability - there are 2 appraches how to use SpotlightViewKit:
- SpotlightView can be created, implementing delegate methods:
var contentView: UIView? { get } // specific View, which overlay is laid on
func numberOfFocusItem() -> Int // number of parts that should be focused on
func focusRect(at index: Int) -> CGRect // return specific CGRect, that should be focused on (keep in mind, slot is being drawed arround the CGRect)
func spotlightView(_ spotlightView: SpotLightView, performActionForItem item: FocusItem) // invoked in parallel with slot moving (a good method to implement custom animation for description)
func spotlightView(_ spotlightView: SpotLightView, animationDidFinishedForItem item: FocusItem)
func allAnimationsDidFinished() // all animations have been finished and there is nothing to be focused
In this approach, client should manage the view for himself.
<sup><sub>There is a drawback in current approach: user should create the view, when the layout is relevant, otherwise, slots won't match with actual view</sub></sup>
- To use SpotlightManager; it manages when views've been finished layouting for itself. Client should run the following code:
let manager: SpotlightManager = SpotlightManager(...)
manager.start()
Moreover, SpotlightManager presents overlay view in the separated UIWindow.
- [x] Customizability - framework provides 2 ways to configure overlay:
- To setup overlay with Blur, user should configure 5 params (ratio, blurRadius, blendColor, blendMode, iterations). Here is some set of this params and how overlay will look like (listed set is default one):
|ratio, (CGFloat)|blurRadius, (CGFloat) |blendColor, (UIColor) |blendMode, (CGBlendMode)|iterations, (Int)| | --------------------------:|:---------------------------------:|:---------------------------------:|:-----------------------------------:|:------------------------------------:| | 1.0 | 80.0 | gray | destinationOver | 3 |
<p align="center"> <img src="Demo/blur_appearence.gif"> </p>- To setup overlay with Color, user should configure 3 params (color, blendMode, alpha). Here is some set of this params and how overlay will look like:
|color, (UIColor)|blendMode, (CGBlendMode) |alpha, (CGFloat) | | --------------------------- |:------------------------------------:|:----------------------------:| | lightGray | darken | 0.6 |
<p align="center"> <img src="Demo/color_appearance.gif"> </p>Distribution
SpotlightViewKit's available through CocoaPods for iOS:
To integrate SpotlightViewKit into your Xcode project using CocoaPods, specify it in your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
pod 'SpotlightViewKit', git: 'https://github.com/vovkroman/SpotlightViewKit.git'
Then, run the following command:
$ pod install
Related Skills
node-connect
347.6kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.6kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.6kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
