Automatically sets the network activity indicator for any performed request.

Overview

BigBrother

Version Platform Build Status

BIG BROTHER IS WATCHING YOU.

BigBrother is a Swift library made for iOS that automatically watches for any performed request and sets the network activity indicator.

This is mostly a proof of concept, having several limitations because of how NSURLProtocol works. Some of them are:

It was inspired by this comment by Mattt Thompson.

It also was based on this tutorial for creating an NSURLProtocol and on AFNetworkActivityIndicatorManager from AFNetworking.

Usage

Adding

Adding to NSURLConnection and NSURLSession.sharedSession()

BigBrother.addToSharedSession()

Adding to a custom NSURLSessionConfiguration

var configuration = NSURLSessionConfiguration.defaultSessionConfiguration()

BigBrother.addToSessionConfiguration(configuration)

let session = NSURLSession(configuration: configuration)

Removing

Removing from NSURLConnection and NSURLSession.sharedSession()

BigBrother.removeFromSharedSession()

Removing from a custom NSURLSessionConfiguration

var configuration = NSURLSessionConfiguration.defaultSessionConfiguration()

BigBrother.removeFromSessionConfiguration(configuration)

let newSession = NSURLSession(configuration: configuration)

REMINDER

It is important to configure your NSURLSessionConfiguration object appropriately before using it to initialize a session object. Session objects make a copy of the configuration settings you provide and use those settings to configure the session. Once configured, the session object ignores any changes you make to the NSURLSessionConfiguration object. If you need to modify your transfer policies, you must update the session configuration object and use it to create a new NSURLSession object.

Advanced usage

BigBrother.URLProtocol is an NSURLProtocol subclass that manages the network activity indicator and it's public if you want to add it yourself to an NSURLSessionConfiguration or to the default NSURLProtocol (used by NSURLConnection and NSURLSession.sharedSession()).

BigBrother.Manager is also public, so you can manage the network activity indicator directly:

BigBrother.Manager.sharedInstance.incrementActivityCount()

// do something...

BigBrother.Manager.sharedInstance.decrementActivityCount()

Installation

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

pod 'BigBrother'

Then run pod install with CocoaPods 0.36 or newer.

Unit Tests

Unit testing is done with XCTest and the tests are available under the BigBrotherTests folder.

Collaborating

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request. They're more than welcome!

Contact

Marcelo Fabri

License

BigBrother is available under the MIT license. See the LICENSE file for more info.

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

SPIndicator About Mimicrate to indicator which appear when silent mode turn on / off. Availalbe 2 animated presets: done & error. Also support custom

Recording Indicator Utility lets you turn off the orange microphone recording indicator light for live events and screencasts.
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

NSURLSession network abstraction layer, using Codable and Decodable for response and Encodable for request. โš™๏ธ๐Ÿš€
NSURLSession network abstraction layer, using Codable and Decodable for response and Encodable for request. โš™๏ธ๐Ÿš€

SONetworking NSURLSession network abstraction layer, using Codable and Decodable for response and Encodable for request. Project Folder and File Struc

DBNetworkStack is a network abstraction for fetching request and mapping them to model objects

DBNetworkStack Main Features ๐Ÿ›ก Typed network resources ๐Ÿ  Value oriented architecture ๐Ÿ”€ Exchangeable implementations ๐Ÿš„ Extendable API ๐ŸŽน Composable

MVVM-RXSWIFT-COMBINE- - Demo application populating posts from network request using
MVVM-RXSWIFT-COMBINE- - Demo application populating posts from network request using

MVVM = RXSWIFT + COMBINE Demo application populating posts from network request

DevTool - A simple UI and powerful Mac OS application, Such as JSON-Formatting tool, JSON-to-model tool, AppIcon generator, Network-Request tool...
DevTool - A simple UI and powerful Mac OS application, Such as JSON-Formatting tool, JSON-to-model tool, AppIcon generator, Network-Request tool...

๐Ÿ”ฅ ๐Ÿ”ฅ ๐Ÿ”ฅ A simple UI and powerful Mac OS application. It is a collection of tools commonly used in my development work. Such as JSON-Formatting tool, JSON-to-model tool, AppIcon generator, Network-Request tool...

Simple network activity logger for iOS
Simple network activity logger for iOS

Reqres is a simple library for logging all requests and responses in your app. It supports Alamofire and also requests made via native NSURLSession. โฌ†

An Alamofire network activity logger view
An Alamofire network activity logger view

๐Ÿ“’ AlamofireLogbook An Alamofire network activity logger view Installation AlamofireLogbook is available through CocoaPods. To install it, simply add

boots patched iBoot then sets apnonce on s8000/s8003

a9-checkm8-nonce-setter boots patched iBoot then sets apnonce on s8000/s8003 Compatibility Works on iPhone 6s/6s Plus and SE (2016). macOS version 10.

Android/iOS Apps created to practice with different iOS/Android Tech. These apps were built to have similar feature sets using native Android/iOS.

AgilityFitTodayApp Android/iOS Apps created to practice with different iOS/Android Tech. These apps were built to have similar feature sets using nati

Dash-iOS - Dash gives your iPad and iPhone instant offline access to 200+ API documentation sets

Discontinued Dash for iOS was discontinued. Please check out Dash for macOS instead. Dash for iOS Dash gives your iPad and iPhone instant offline acce

Swift-cuckoo-collections - Cross-platform Swift dictionaries & sets that use a cuckoo hashing algorithm

CuckooCollections A Swift package for open-addressed sets and dictionaries that

AREK is a clean and easy way to request any kind of iOS permission (with some nifty features ๐Ÿค–)
AREK is a clean and easy way to request any kind of iOS permission (with some nifty features ๐Ÿค–)

AREK is a clean and easy to use wrapper over any kind of iOS permission written in Swift. Why AREK could help you building a better app is well descri

An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!

OHHTTPStubs OHHTTPStubs is a library designed to stub your network requests very easily. It can help you: test your apps with fake network data (stubb

Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application.
Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application.

Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application. Install Carthage

Network debugging made easy๏ผŒThis network debugging tool is developed based on the swift version of Wormholy.
Network debugging made easy๏ผŒThis network debugging tool is developed based on the swift version of Wormholy.

Start debugging iOS network calls like a wizard, without extra code! Wormholy makes debugging quick and reliable. What you can do: No code to write an

A network extension app to block a user input URI. Meant as a network extension filter proof of concept.
A network extension app to block a user input URI. Meant as a network extension filter proof of concept.

URIBlockNE A network extension app to block a user input URI. Meant as a network extension filter proof of concept. This is just a research effort to

Owner
Marcelo Fabri
Marcelo Fabri
A lightweight and awesome loading Activity Indicator for your iOS app.

BPCircleActivityIndicator BPCircleActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on

Ben.Park 46 Aug 12, 2022
A simple and awesome loading Activity Indicator(with block moving animation) for your iOS app.

BPBlockActivityIndicator BPBlockActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on iO

Ben.Park 43 Nov 6, 2021
Yet another task indicator

SendIndicator Yet another task indicator Requirements Installation Usage License Requirements iOS 8.0+ Swift 3.0+ Xcode 8.0+ Installation CocoaPods Co

Leonardo Cardoso 64 Aug 17, 2022
StatusBarOverlay will automatically show a "No Internet Connection" bar when your app loses connection, and hide it again

StatusBarOverlay will automatically show a "No Internet Connection" bar when your app loses connection, and hide it again. It supports apps which hide the status bar and The Notch

Idle Hands Apps 160 Nov 2, 2022
A beautiful activity indicator and modal alert written in Swift (originally developed for my app DoodleDoodle) Using blur effects, translucency, flat and bold design - all iOS 8 latest and greatest

SwiftSpinner SwiftSpinner is an extra beautiful activity indicator with plain and bold style. It uses dynamic blur and translucency to overlay the cur

Marin Todorov 2.1k Dec 19, 2022
The easiest way to handle a simple full screen activity indicator in iOS. Written in Swift.

LLSpinner An easy way to handle full screen activity indicator. Easy to use Get Started // Show spinner LLSpinner.spin() // Hide spinner LLSpinner.st

Aleph Retamal 36 Dec 9, 2021
A lightweight and awesome loading Activity Indicator for your iOS app.

BPCircleActivityIndicator BPCircleActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on

Ben.Park 46 Aug 12, 2022
A simple and awesome loading Activity Indicator(with block moving animation) for your iOS app.

BPBlockActivityIndicator BPBlockActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on iO

Ben.Park 43 Nov 6, 2021
SwiftUI view that download and display image from URL and displaying Activity Indicator while loading .

ViewWithActivityIndicator ViewWithActivityIndicator is a SwiftUI view that download and display image from URL and displaying Activity Indicator while

Ali Adam 28 Feb 3, 2022
A simple and customizable activity indicator.

ๆ—ฅๆœฌ่ชž KRActivityIndicatorView KRActivityIndicatorView is a simple and customizable activity indicator written in Swift. You can add KRActivityIndicatorV

K.R.Impedance 47 Jul 11, 2022