Giter VIP home page Giter VIP logo

futuretap / ftlinearactivityindicator Goto Github PK

View Code? Open in Web Editor NEW
696.0 16.0 46.0 2.04 MB

Add the missing network activity indicator on notched iPhones

Home Page: https://www.futuretap.com/blog/fix-for-the-missing-network-activity-indicator-on-iphone-x

License: Creative Commons Attribution Share Alike 4.0 International

Swift 91.54% Ruby 8.46%
activity-indicator uikit-components ios iphone uikit

ftlinearactivityindicator's Introduction

FTLinearActivityIndicator

Version Swift Package Manager compatible License Platform Sponsor Mastodon

iPhones with a notch or Dynamic Island don't display the network activity indicator anymore. This framework brings it back by placing an activity indicator in the upper right of the screen on top of the regular status bar items on the following devices:

  • iPhone X
  • iPhone Xs
  • iPhone Xs Max
  • iPhone Xʀ
  • iPhone 11
  • iPhone 11 Pro
  • iPhone 11 Pro Max
  • iPhone 12
  • iPhone 12 mini
  • iPhone 12 Pro
  • iPhone 12 Pro Max
  • iPhone 13
  • iPhone 13 mini
  • iPhone 13 Pro
  • iPhone 13 Pro Max
  • iPhone 14
  • iPhone 14 Plus
  • iPhone 14 Pro
  • iPhone 14 Pro Max
  • iPhone 15
  • iPhone 15 Plus
  • iPhone 15 Pro
  • iPhone 15 Pro Max

Since a circular indicator wouldn't fit, a rectangular KITT scanner-like indicator with a gradient is shown. The indicator UI can be used standalone or as a "fix" for the iOS network activity indicator (using the existing API).

Integration

As a fix for the system network activity indicator

In your app delegate's didFinishLaunching method, after initializing the window, just call

UIApplication.configureLinearNetworkActivityIndicatorIfNeeded()

Then, use the standard network activity indicator as usual.

As a standalone view

Include a FTLinearActivityIndicator view in your storyboard or instantiate it from code. The class supports the following methods and properties, using a similar API as the iOS UIActivityIndicatorView:

  • startAnimating()
  • stopAnimating()
  • isAnimating: Bool
  • hidesWhenStopped: Bool

tintColor is supported to colorize the indicator gradient.

Requirements

  • iOS 12 or higher (iOS 11 is supported until version 1.6)
  • compiles for Mac Catalyst or visionOS (without network activity indicator)

Installation

FTLinearActivityIndicator is available through Swift Package Manager or CocoaPods.

Swift Package Manager

To install FTLinearActivityIndicator using Swift Package Manager you can follow the tutorial published by Apple using the URL for the FTLinearActivityIndicator repo with the current version:

  1. In Xcode, select “File” → “Add Packages…”
  2. Enter https://github.com/futuretap/FTLinearActivityIndicator.git

CocoaPods

To install FTLinearActivityIndicator via CocoaPods, add the following line to your Podfile:

pod 'FTLinearActivityIndicator'

Then run pod install.

To open an example project, just call pod try FTLinearActivityIndicator on the command line.

Author

Developed by Ortwin Gentz (Mastodon) and used in FutureTap’s Where To? and Streets apps – we eat our own dog food!

License

FTLinearActivityIndicator is available under the CC-BY-SA 4.0 license. You may copy and redistribute, adapt and build upon the framework for any purpose, even commercially, as long as you give credit to me in the About menu or a similar place in the app. If you need a different license without attribution requirement, please contact me and we can work something out.

Sponsors wanted

If you would like to support my Open Source work, consider joining me as a sponsor! 💪️ Your sponsorship enables me to spend more time on this and other community projects. Thank you!

ftlinearactivityindicator's People

Contributors

awprj avatar futuretap avatar rcasula avatar rolandleth avatar romanpodymov avatar tomlokhorst avatar zandor300 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ftlinearactivityindicator's Issues

Placement conflicts w/ iOS 14 builtin controls

Thanks for this great activity indicator. Since iOS 14, the placement conflicts with the builtin indicators for microphone and camera usage though. Then again, the left side conflicts with the builtin 'Return to <previous app>' label.

It seems there is no good placement left, or is it? How about to the left and/or the right of the home indicator?

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.