Giter Site home page Giter Site logo

trendingtechnology / spindicator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ivanvorobei/spindicator

0.0 2.0 0.0 3.59 MB

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

License: MIT License

Swift 98.74% Ruby 1.26%

spindicator's Introduction

SPIndicator

About

Mimicrate to indicator which appear when silent mode turn on / off. Availalbe 2 animated presets: done & error. Also support custom images, you can see how use it in docs.

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.5 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 alerts by calling the class functions SPIndicator. These functions are updated regularly and show the alerts 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 alert 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 alert for hide. While alert is dragging, dismiss not work. This can be disabled:

indicatorView.dismissByDrag = false

Haptic

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

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

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

Other Projects

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.

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.

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.

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.

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

Russian Community

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

Tutorials on YouTube

spindicator's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.