{"id":2252,"url":"https://github.com/marcelofabri/BigBrother","last_synced_at":"2025-08-02T23:32:20.158Z","repository":{"id":25278357,"uuid":"28704015","full_name":"marcelofabri/BigBrother","owner":"marcelofabri","description":"Automatically sets the network activity indicator for any performed request.","archived":true,"fork":false,"pushed_at":"2022-09-25T18:35:38.000Z","size":30,"stargazers_count":443,"open_issues_count":2,"forks_count":19,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-28T11:39:44.354Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcelofabri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-02T04:59:46.000Z","updated_at":"2024-09-02T17:17:36.000Z","dependencies_parsed_at":"2022-08-20T18:50:30.221Z","dependency_job_id":null,"html_url":"https://github.com/marcelofabri/BigBrother","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelofabri%2FBigBrother","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelofabri%2FBigBrother/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelofabri%2FBigBrother/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelofabri%2FBigBrother/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcelofabri","download_url":"https://codeload.github.com/marcelofabri/BigBrother/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503145,"owners_count":17930520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:08.915Z","updated_at":"2024-12-06T17:30:51.800Z","avatar_url":"https://github.com/marcelofabri.png","language":"Swift","funding_links":[],"categories":["UI","Libs","Swift"],"sub_categories":["Activity Indicator","Other free courses","Network"],"readme":"# BigBrother\n\n[![Version](https://cocoapod-badges.herokuapp.com/v/BigBrother/badge.png)](http://cocoadocs.org/docsets/BigBrother) [![Platform](https://cocoapod-badges.herokuapp.com/p/BigBrother/badge.png)](http://cocoadocs.org/docsets/BigBrother)\n[![Build Status](https://travis-ci.org/marcelofabri/BigBrother.svg)](https://travis-ci.org/marcelofabri/BigBrother)\n\n\u003e **[BIG BROTHER](http://en.wikipedia.org/wiki/Big_Brother_(Nineteen_Eighty-Four)) IS WATCHING YOU**. \n\nBigBrother is a Swift library made for iOS that automatically watches for any performed request and sets the [network activity indicator](https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Controls.html#//apple_ref/doc/uid/TP40006556-CH15-SW44).\n\nThis is mostly a proof of concept, having several limitations because of how `NSURLProtocol` works. Some of them are:\n\n- `NSURLProtocol` doesn't inherit `NSURLSession`'s configured headers (see https://github.com/Alamofire/Alamofire/issues/473)\n- `NSURLProtocol` isn't compatible with authentication APIs (see https://github.com/marcelofabri/BigBrother/issues/2)\n\n\nIt was inspired by [this comment](https://github.com/Alamofire/Alamofire/issues/185#issuecomment-64955006) by [Mattt Thompson](https://github.com/mattt).\n\nIt also was based on [this tutorial](http://www.raywenderlich.com/76735/using-nsurlprotocol-swift) for creating an `NSURLProtocol` and on [`AFNetworkActivityIndicatorManager`](https://github.com/AFNetworking/AFNetworking/blob/master/UIKit%2BAFNetworking/AFNetworkActivityIndicatorManager.h) from [AFNetworking](https://github.com/AFNetworking/AFNetworking).\n\n## Usage\n\n### Adding\n\n#### Adding to `NSURLConnection` and `NSURLSession.sharedSession()`\n```swift\nBigBrother.addToSharedSession()\n```\n\n#### Adding to a custom `NSURLSessionConfiguration`\n```swift\nvar configuration = NSURLSessionConfiguration.defaultSessionConfiguration()\n\nBigBrother.addToSessionConfiguration(configuration)\n\nlet session = NSURLSession(configuration: configuration)\n```\n\n### Removing\n\n#### Removing from `NSURLConnection` and `NSURLSession.sharedSession()`\n```swift\nBigBrother.removeFromSharedSession()\n```\n\n#### Removing from a custom `NSURLSessionConfiguration`\n```swift\nvar configuration = NSURLSessionConfiguration.defaultSessionConfiguration()\n\nBigBrother.removeFromSessionConfiguration(configuration)\n\nlet newSession = NSURLSession(configuration: configuration)\n```\n\n\u003e [**REMINDER**](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSessionConfiguration_class/)\n\u003e \n\u003e 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.\n\n### Advanced usage\n\n`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()`).\n\n`BigBrother.Manager` is also public, so you can manage the network activity indicator directly:\n\n```swift\nBigBrother.Manager.sharedInstance.incrementActivityCount()\n\n// do something...\n\nBigBrother.Manager.sharedInstance.decrementActivityCount()\n```\n\n## Installation\n\nBigBrother is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'BigBrother'\n```\t\n\nThen run `pod install` with CocoaPods 0.36 or newer.\n\n## Unit Tests\n\nUnit testing is done with `XCTest` and the tests are available under the [BigBrotherTests](/BigBrotherTests) folder.\n\n## Collaborating \n\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request. They're more than welcome!\n\n\n## License\n\nBigBrother is available under the MIT license. See the LICENSE file for more info.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelofabri%2FBigBrother","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelofabri%2FBigBrother","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelofabri%2FBigBrother/lists"}