NetGuard 2.3

NetGuard 2.3

Batikan 维护。



预览

NetGuard NetGuard NetGuard NetGuard

简介

  • NetGuard 是一款轻量级的原生 iOS 网络调试器。
  • NetGuard 会监视和捕获网络请求。
  • NetGuard 会以可读的、详细的安全形式存储和列出所捕获的内容。
  • NetGuard 使调试快速且可靠。
  • 只需摇一摇 iPhone,NetGuard 就会显示。

要求

  • iOS 10.0+
  • Xcode 10+
  • Swift 4, 4.1, 4.2 和 Swift 5

安装

CocoaPods

target 'YourTargetName' do
    use_frameworks!
    pod 'NetGuard', :git => 'https://github.com/batikansosun/NetGuard.git', :tag => '2.0'
end

使用方法

您只需要在 "AppDelegate" 中的 "didFinishLaunchingWithOptions" 方法中调用 "loadNetGuard" 方法。就这样

//import NetGuard
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
      NetGuard().loadNetGuard()
      return true
  }
//@import NetGuard;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[NetGuard new] loadNetGuard];
}

参数

'enabled' 的默认值是 true。您无需将其设置为 'true'。'false' 值将禁用网络监控。

NetGuard.enabled = false

'shakeEnabled' 的默认值是 true。您无需将其设置为 'true' 以显示请求列表界面。

NetGuard.shakeEnabled = false

您可以通过将其设置为 'false' 来禁用摇动,并且您可以在任何地方调用 'showNetGuard()'。

NetGuard().showNetGuard()

使用 'blackListHosts',您可以排除您定义的请求。

NetGuard.blackListHosts = ["example.com"]

贡献

  • 如果您 发现了错误,请提交问题。
  • 如果您 有功能请求,请开始一个新的 讨论
  • 如果您 想做出贡献,请提交一个 pull request。

对所有问题的提问,请开始一个新的 讨论

制作❤️通过 Batikan Sosun

更多关注 Twitter Batikan Sosun

MIT许可证

NetGuard 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件