Sniffer 1.0.2

Sniffer 1.0.2

DocsDocumented
TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Feb 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by KofktuSDK.


Downloads

Total18
Week18
Month18

Installs

Apps4
Apps WeekApps This Week 4
Test Targets1
Test WeekTests This week 1
powered by Segment

GitHub

Stars3
Watchers2
Forks0
Issues0
Contributors1
Pull Requests0

Code

Files2
SizeIntegration Size 24 kb
LOCLines of Code 234


Sniffer 1.0.2

  • By
  • Kofktu

Sniffer

  • Automatic networking activity logger
  • intercepting any outgoing requests and incoming responses for debugging purposes.

alt tag

Requirements

  • iOS 8.0+
  • Swift 3.0

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

for any requests you make via ‘URLSession’

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
  Sniffer.register() // Register Sniffer to log all requests
  return true
}

for URLSessionConfiguration

let configuration = URLSessionConfiguration.default
Sniffer.enable(in: configuration)

for Custom Deserializer

public protocol BodyDeserializer {
    func deserialize(body: Data) -> String?
}

public final class CustomTextBodyDeserializer: BodyDeserializer {
    public func deserialize(body: Data) -> String? {
        // customization
        return String?
    }
}

Sniffer.register(deserializer: CustomTextBodyDeserializer(), for: ["text/plain"])

References

Authors

Taeun Kim (kofktu), [email protected]

License

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