Swiftpack.co -  futuretap/FTLinearActivityIndicator as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
futuretap/FTLinearActivityIndicator
Add the missing network activity indicator on notched iPhones
.package(url: "https://github.com/futuretap/FTLinearActivityIndicator.git", from: "1.4.2")

FTLinearActivityIndicator

Version Swift Package Manager compatible License Platform Sponsor Twitter

iPhones with a notch 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

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.

Example

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

Requirements

Written in Swift 5. Should run under any iOS (obviously, the iPhone X requires iOS 11 or higher).

Installation

FTLinearActivityIndicator is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'FTLinearActivityIndicator'

Author

Ortwin Gentz, FutureTap GmbH, Twitter: @ortwingentz 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 FTLinearActivityIndicator and other community projects. Thank you!

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.

GitHub

link
Stars: 679
Last commit: 3 days ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

device-specific position and width
18 weeks ago

depending on the device corner radius and notch width; keeping clear the camera/mic indicator;

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API