Floating indicator, mimicrate to indicator which appear when silent mode turn on / off. Support large texts.

Overview

SPIndicator

About

Mimicrate to indicator which appear when silent mode turn on / off. Availalbe 2 animated presets: done & error. Also support custom images and present from top, center & bottom side.

If you need alert from Apple music, use library SPAlert.

If you like the project, don't forget to put star ★ and follow me on GitHub:

https://github.com/ivanvorobei

Navigate

Installation

Ready for use on iOS 12+, tvOS 12+. Works with Swift 5+. Required Xcode 12.0 and higher.

Swift Package Manager

The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

To integrate SPIndicator into your Xcode project using Xcode 12, specify it in File > Swift Packages > Add Package Dependency...:

https://github.com/ivanvorobei/SPIndicator

CocoaPods:

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate SPIndicator into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'SPIndicator'

Manually

If you prefer not to use any of dependency managers, you can integrate SPIndicator into your project manually. Put Sources/SPIndicator folder in your Xcode project. Make sure to enable Copy items if needed and Create groups.

Quick Start

For best experience, I recommend presenting indicator by calling the class functions SPIndicator. These functions are updated regularly and show the indicator as Apple way:

SPIndicator.present(title: "Error", message: "Try Again", preset: .error)

For using a custom image:

let image = UIImage.init(systemName: "sun.min.fill")!.withTintColor(.systemYellow, renderingMode: .alwaysOriginal)
SPIndicator.present(title: "Custom Image", message: "With tint color", preset: .custom(image)))

For showing a simple text message:

SPIndicator.present(title: "Error", haptic: .error)

You can provide message optional too.

Usage

Duration

For change duration of present time, create indicator view and call present method with custom duration:

let indicatorView = SPIndicatorView(title: "Complete", preset: .done)
indicatorView.present(duration: 3)

Layout

For customise layout and margins, use layout property. You can manage margins for each side, icon size and space between image and titles:

indicatorView.layout.iconSize = .init(width: 24, height: 24)
indicatorView.layout.margins.top = 12

Dismiss by Drag

By default allow drag indicator for hide. While indicator is dragging, dismiss not work. This can be disabled:

indicatorView.dismissByDrag = false

Haptic

For manage haptic, you shoud pass it in present method:

indicatorView.present(duration: 1.5, haptic: .success, completion: nil)

You can remove duration and completion, its have default values.

Present Side

If you need present from special side, use this:

SPIndicator.present(title: "Error", message: "Try Again", preset: .error, from: .bottom)

// or with custom view

indicatorView.presentSide = .bottom

In last cases indicator will appear from bottom and attached to bottom. For manage offset check property offset.

Shared Configuration

Also you can change some default values for alerts. For example you can change default duration for alert with next code:

SPIndicatorConfiguration.duration = 2

It will apply for all alerts. Shoud set configuration before present any alerts. I recomend set it in app delegate.

Other Projects

SPPermissions

Using for request and check state of permissions. Available native UI for request multiple permissions at the same time. Simple integration and usage like 2 lines code.

SPAlert

You can find this alerts in AppStore after feedback or after added song to library in Apple Music. Contains popular Done, Heart presets and many other. Done preset present with draw path animation like original. Also available simple present message without icon. Usage in one line code.

SPPerspective

Animation of widgets from iOS 14. 3D transform with dynamic shadow. Video preview. Available deep customisation 3D and shadow. Also you can use static transform without animation.

SPDiffable

Simplifies working with animated changes in table and collections. Apple's diffable API required models for each object type. If you want use it in many place, you pass time to implement it and get over duplicates codes. This project help do it elegant with shared models and special cell providers. Support side bar iOS14 and already has native cell providers and views.

SparrowKit

Collection of native Swift extensions to boost your development. Support tvOS and watchOS.

Russian Community

В телеграм-канале Код Воробья пишу о iOS разработке. Помощь можно найти в нашем чате. Видео-туториалы выклыдываю на YouTube:

Tutorials on YouTube

Comments
  • didn't present

    didn't present

    Describe the bug didn't present the indicatorView To Reproduce

    import SPIndicator
    
    class ViewController: UIViewController {
    
        let indicatorView = SPIndicatorView(title: "wow", message: "succ")
    
        override func viewDidLoad() {
            super.viewDidLoad()
            indicatorView.layout.iconSize = .init(width: 24, height: 24)
            indicatorView.layout.margins.top = 20
            indicatorView.dismissByDrag = true
            indicatorView.present()
        }
    

    Smartphone (please complete the following information):

    • iOS Version = 14
    • SPIndicator` version = 1.1.5
    • Installed via [e.g. SPM, Cocoapods, Manually] = cocapods
    bug 
    opened by AMJ-7 5
  • Easily adjust top & bottom offsets of the indicator view

    Easily adjust top & bottom offsets of the indicator view

    Hey 👋

    Thanks for this amazing library. 🔥

    Goal

    The goal is to easily change the top and bottom offset. From my point of view, on iPhones <= 8, the indicator is too close to the status bar so therefore I implemented an easy way to adjust the offset of the indicator.

    Checklist

    • [x] Testing in iOS, tvOS
    • [x] Installed correct via Swift Package Manager and Cocoapods
    opened by AngCosmin 5
  • Feature: Corner Radius

    Feature: Corner Radius

    Goal

    I wanted to add the option for adding the corner radius for the background view of the indicator. Also, I wanted to improve the description of the pod and I improved the English translation.

    Checklist

    This was not tested very much, because it was not a big change. I did not test for SwiftUI at all.

    opened by olegtatarciuc 4
  • Using on macCatalyst

    Using on macCatalyst

    First of all, thank you so much for this library. It really is super helpful and awesome. I can't wait to fully integrate it into my project.

    One thing I noticed is that on macCatalyst, the display position and animation can be a bit wonky. For example, it seems that when displayed at the top of the screen, there is no padding and so it is against the top toolbar of the Mac application. Furthermore, the animation is choppy on Mac for some reason and the SPIndicator tends to flicker. I don't have this issue at all with SPAlert.

    Can you have a look? Thank you. :)

    bug 
    opened by isaranjha 4
  • Example project provided is not running

    Example project provided is not running

    Details

    • iOS Version [15.3]
    • Xcode version [13.2]
    • Downloaded from github

    Screenshot 2022-02-02 at 6 12 53 PM

    Describe the Bug Example project provided is not running, giving compile time errors as shown in the screen shot

    bug 
    opened by rahulvermaJW 2
  •  'shared' is unavailable in application extensions for iOS

    'shared' is unavailable in application extensions for iOS

    Describe the bug SPIndicator doesn't compile on XCode 13b3 7 Points of failure.

    To Reproduce Build / Run Project with SPIndicator SPM.

    Expected behavior Build successfully.

    Screenshots Screen Shot 2021-07-22 at 11 32 53 AM

    Smartphone (please complete the following information):

    • iOS Version: 15.0 B3
    • SPIndicator version: 1.2.3
    • Installed via SPM

    Additional context XCode 13b3 no longer supports shared in application extensions Possible fix: https://twitter.com/twannl/status/1415643870512226307

    bug 
    opened by aritropaul 2
  • Dynamic island

    Dynamic island

    Hi, very beautiful library! Great job! I've a question: is possible to add the support with the new iPhone 14 Pro dynamic island when present the indicator from the top?

    enhancement 
    opened by furiosFast 1
  • Drag functionality is broken.

    Drag functionality is broken.

    Details

    • iOS Version 15.2.1
    • Framework Version 1.6.3
    • Installed via SPM

    Describe the Bug The drag & drop functionality is broken. The indicator view in not being dragged. It just jumps and it is not following the finger around.

    bug 
    opened by olegtatarciuc 1
  • Add SwiftUI compatibility

    Add SwiftUI compatibility

    Goal

    Added SwiftUI compatibility. Update README.md.

    Please see the Extensions/SwiftUIExtension for details.

    And thanks for this awesome library!

    Checklist

    • [X] Testing in compatibility platforms
    • [X] Installed correctly via Swift Package Manager and Cocoapods
    opened by SNNafi 1
  • Custom corner radius.

    Custom corner radius.

    Hi. I must say, this is a very cool Toast pod, but it lacks more customization options. The one thing I am missing right now is the custom corner radius for the background view. I hope you can add it as soon as possible.

    Cheers! 👋

    enhancement 
    opened by olegtatarciuc 0
  • Issue #20 fix

    Issue #20 fix

    Goal

    Fix issue #20

    Checklist

    • [x] Testing in compability platforms
    • [x] Installed correct via Swift Package Manager and Cocoapods

    NOTE:

    Only the second to last contains changes, all the other commits changes were discarded in the last commit

    opened by PedroCavaleiro 0
  • Problem when the view has a AVPlayerViewController

    Problem when the view has a AVPlayerViewController

    Details

    • iOS Version: 16.1.1
    • Framework Version: Branch Main
    • Installed via SPM

    I'm trying to create a list of videos, each entry has a video player but using the library AZVideoPlayer for fullscreen and PiP support

    There's a issue where the HUD goes under the notch

    I was able to find out that the problem probably lies in the AVPlayerViewController, I tried to implement a simpler version of the video player with the AVPlayerViewController and got the same result, no issues when using the native VideoPlayer

    https://user-images.githubusercontent.com/1993871/202064081-de4fd802-98e1-4d4b-b459-348af696a40c.mov

    It's a bit hard to get a idea with the screen grab but the toast should cover the "Feed" word completely

    I added the SPIndicator on the topmost view to see if it would helped but it doesn't

    bug 
    opened by PedroCavaleiro 0
  • Warning Preset

    Warning Preset

    Feature Description It would be great to also have a predefined Warning Preset next to Success and Error. The color should probably be yellow and you could use the "exclamationmark" SF Symbol as its Image.

    It's difficult to implement it by myself, since there is no API for animating the Image like with the other two Presets I suppose.

    enhancement 
    opened by christophriepe 0
  • Indicator is showing up many more times than one

    Indicator is showing up many more times than one

    Details

    • iOS Version 16.0 beta 3
    • Framework Version 1.6.4
    • Installed via Manually

    Describe the Bug As soon as the Indicator got fired one time, anything you do on the UI triggers many more times.

    https://user-images.githubusercontent.com/65811753/179282708-feb0afec-913a-4f5c-8848-5736778dbb6c.mov

    bug 
    opened by blockiyt 1
  • [Feature Request] Progress Indicator

    [Feature Request] Progress Indicator

    Is it possible to make it a progress indicator?

    Put a UIActivityIndicatorView at the icon and provide a call back like

    SPIndicator.presentProgress(message: "Hello") { completion in
        // do some work
        Backend.shared.load()
        // when done
        completion.send()
    }
    
    enhancement 
    opened by Lakr233 2
Owner
Ivan Vorobei
iOS Developer
Ivan Vorobei
A Floating Action Button just like Google inbox for iOS

VCFloatingActionButton A Floating Action Button inspired from Google inbox for iOS. Using this in your project Import the VCFloatingActionButton to yo

Giridhar 298 May 16, 2022
zekunyan 608 Dec 30, 2022
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets. Support SwiftUI.

SPAlert Popup from Apple Music & Feedback in AppStore. Contains Done, Heart, Error and other presets. Supports Dark Mode. I tried to recreate Apple's

Ivan Vorobei 1.4k Dec 10, 2021
It is a highly configurable iOS library which allows easy styling with built in styles as well as extra header and footer views so that you can make extremely unique alerts and action sheets.

 CFAlertViewController CFAlertViewController is a library that helps you display and customise Alerts, Action Sheets, and Notifications on iPad and i

Crowdfire Inc. 1.1k Dec 18, 2022
Simple Alert View written in Swift, which can be used as a UIAlertController. (AlertController/AlertView/ActionSheet)

DOAlertController Simple Alert View written in Swift, which can be used as a UIAlertController replacement. It supports from iOS7! It is simple and ea

Daiki Okumura 406 Sep 5, 2022
Recording Indicator Utility lets you turn off the orange microphone recording indicator light for live events and screencasts.

Recording Indicator Utility Recording Indicator Utility lets you turn off the orange microphone recording indicator light, making it ideal for profess

Tyshawn Cormier 121 Jan 1, 2023
Silent Rock app: to notify users when approaching silent rock

silent-rock Silent Rock app - to notify users when approaching silent rock. Capstone Concept - Michelle Bodart Team members none Problem Statement #1

null 0 Jan 4, 2022
📴 SoundModeManager 📳 Detect silent / ring mode on iOS device

?? SoundModeManager ?? Detect silent / ring mode on the device. Installation CocoaPods Usage Documentation License ?? Installation CocoaPods For usage

Yurii Lysytsia 4 Oct 4, 2022
Floating-textfield-swiftui - Floating textfield swiftui: Floating field with multiple icons

floating_textfield-swiftui Hey, Guys welcome to this tutorial. In this complete

Patrick 0 Jan 2, 2022
🔥 🔥 🔥Support for ORM operation,Customize the PQL syntax for quick queries,Support dynamic query,Secure thread protection mechanism,Support native operation,Support for XML configuration operations,Support compression, backup, porting MySQL, SQL Server operation,Support transaction operations.

?? ?? ??Support for ORM operation,Customize the PQL syntax for quick queries,Support dynamic query,Secure thread protection mechanism,Support native operation,Support for XML configuration operations,Support compression, backup, porting MySQL, SQL Server operation,Support transaction operations.

null 60 Dec 12, 2022
Mimicrate to native UIPageViewController. Each page is new controller, it can be even navigation controller.

Mimicrate to native UIPageViewController. Each page is new controller, it can be even navigation controller. Support parent layout margins, paging and scroll by index. Don't have bug with tranlation when rotate.

Ivan Vorobei 47 Dec 19, 2022
Floating-textfield-swiftui - Floating textfield With SwiftUI

floating_textfield-swiftui Hey, Guys welcome to this tutorial. In this complete

null 1 Feb 11, 2022
Sharkconnect: a large iOS project which serves as a centralized platform for high schools

Sharkconnect Demo Sharkconnect is a content crowdsourcing platform in a high sch

Yuzhi (Paul) Tang 0 Jan 11, 2022
null 1 Jan 24, 2022
BPStatusBarAlert is a library that allows you to easily make text-based alert that appear on the status bar and below navigation bar.

BPStatusBarAlert BPStatusBarAlert is a library that allows you to easily make text-based alert that appear on the status bar and below navigation bar.

Ben.Park 131 Aug 12, 2022
A realistic reflective shimmer to SwiftUI Views that uses device orientation. Position any View relative to device orientation to appear as if through a window or reflected by the screen.

A 3d rotation effect that uses Core Motion to allow SwiftUI views to appear projected in a specific direction and distance relative to the device in r

Ryan Lintott 235 Dec 30, 2022
UILabel replacement with fine-grain appear/disappear animation

ZCAnimatedLabel UILabel-like view with easy to extend appear/disappear animation Features Rich text support (with NSAttributedString) Group aniamtion

Chen 2.3k Dec 5, 2022
An executable that can be called from a Run Script Build Phase that makes comments such as // TODO: or // SERIOUS: appear in Xcode's Issue Navigator giving them project-wide visibility.

XcodeIssueGenerator An executable that can be called from a Run Script Build Phase that makes comments such as // TODO: or // SERIOUS: appear in Xcode

Wunderman Thompson Apps 143 Oct 11, 2022
A simple project which shows how to pull off custom view controller transitions.

Custom View Controller Transitions This project explains and shows how to make custom view controller transitions in the most simple way possible. Eac

Jordan Morgan 91 Oct 23, 2022