Skip to content

A lightweight, one line setup, iOS network debugging library!

License

Notifications You must be signed in to change notification settings

theotherside/netfox

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A lightweight, one line setup, network debugging library that provides a quick look on all executed network requests performed by your app. It grabs all requests - of course yours, requests from 3rd party libraries (such as AFNetworking or else), UIWebViews, and more

Very useful and handy for network related issues and bugs

Implemented in Swift 2.1 - bridged also for Objective-C

Feel free to contribute :)

Overview

Installation

Insert this line in your Podfile

pod 'netfox'

or if you want to do it manually just copy the "netfox" folder in your project (make sure that "Create groups" option is selected)

Then add the following line in didFinishLaunchingWithOptions: method of your AppDelegate

Swift

NFX.sharedInstance().start()

Objective-C

[[NFX sharedInstance] start];

Just simple as that!

Note: Please wrap the above line with

#if DEBUG
. . .
#endif

to prevent library’s execution on your production app.

You can add the DEBUG symbol with the -DDEBUG entry. Set it in the "Swift Compiler - Custom Flags" section -> "Other Swift Flags" line in project’s "Build Settings"

Usage

Just shake your device and check what's going right or wrong! Shake again and go back to your app! fact

Custom gestures

By default the library registers for shake motion. If you want to open the logs with a different gesture, add the following line after the installation one

NFX.sharedInstance().setGesture(.custom)

Then you can use

NFX.sharedInstance().show()

when you want to show the logs and

NFX.sharedInstance().hide()

when you want to hide them.

Features

  • Search: You can easily search among requests via
    • Request url: github.com, .gr, or whatever you want
    • Request method: GET, POST, etc
    • Response type: Like json, xml, html, image and more
  • Sharing: You can share your log via email with backend devs or someone who can help.
    • Simple log option includes only request/response headers and small request/response bodies (when applicable)
    • Full log option includes request/response headers and request/response bodies (as attachments)
  • More to come.. ;)

Other

  • Alamofire users check this
  • Due to the large size of request/response bodies, the library provides disk storage for low memory overhead

Licence

All source code is licensed under MIT License. Which means you could do virtually anything with the code. I will appreciate it very much if you keep an attribution where appropriate.

About

A lightweight, one line setup, iOS network debugging library!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 100.0%