Latest 0.1.0
Homepage https://github.com/DeliveLee/DLDebugView
License MIT
Platforms ios 8.0, requires ARC
Dependencies SDAutoLayout
Frameworks Foundation, UIKit
Authors
  • A in app debug view for iOS
  • 一个iOS APP内的调试窗口

Contents:


Getting Started【开始使用】

Features【能做什么】

  • DLDebugView usually use in when you wanna get debug info but unable connect to Xcode.(Like Testflight or Fabric something, or just when QA testing)

    • Just use less than 5 lines code and almost same NSLog way, you can get a in app debugview and more feature than use NSLog.
  • DLDebugView用于一些无法连接Xcode实时获取debug信息时,使用的In App显示Debug信息窗口。(比如使用Testflight或Fabric下载的版本一类的情况,或者QA在进行测试)
    • 只需要不到5行代码和几乎与NSLog完全相同的使用方式,你就可以获得一个App内的DebugView并且比NSLog支持更多的功能。

Installation【安装】

From CocoaPods【使用CocoaPods】

pod 'DLDebugView'

Examples【示例】

Import In Code【添加引用】

#import "DLDebugView/DlDebugView.h"
  • I suggest add import into *.pch file or Prefix Header file, then you can use DlDebugView in anywhere.
  • 我建议把文件引用添加到pch文件或头引用文件中,这样就可以在任何地方使用它了。

Add To Window【添加窗口】

AppDelegate.m

[self.window setRootViewController:[UIViewController new]];
[self.window makeKeyAndVisible];

DLDebugView *debugView = [DLDebugView sharedManager];
[self.window addSubview:debugView];
  • Note this 【请注意】:
  • You should add DLDebugView code after [self.window makeKeyAndVisible];, and add DLDebugView into self.window, then debugview will always get in front than other UI stuff.
  • 你应该在[self.window makeKeyAndVisible];后加入添加DLDebugView的代码, 并且添加到self.window, 这样debugview会一直保持在最前相比其他UI界面。
Then running your app, you will get a Blue Button on screen left top! Try to click it ^.^
You can click Blue button to open/close debugview, and drag blue button to change debugview position.
You can shake your phone to quick hide/show DebugView right now.
Under the DebugView, will have 2 buttons, one is "Clear", it will clear your all meesages what in debugView, the other is "Lock" button, it will lock/unlock auto scroll in scrollView.
这时候运行你的程序,你会得到一个蓝色的按钮显示在屏幕左上方!点击它试试 ^.^
你可以点击蓝色按钮去打开、关闭debugview,并且拖动蓝色按钮来改变debugview的位置。
你现在可以通过摇动手机来快速隐藏、显示DebugView。
在DebugView下方,有两个按钮,一个为“Clear”,当你点击时会清空所有在DebugView内的信息,另一个按钮“Lock”,当你点击时,它会锁定、解锁在scrollView内的自动滚动。

Limit Messages Count 【设置信息限制】

[[DLDebugView sharedManager] setMessageMaxLimit:100];
  • Note this 【请注意】:
  • Default limit is 100, if you not set this, and when you set up it as 0, it will have no-limit.
  • 如果你不设置它,默认的限制为100条,如果你设置它为0,它会变成无限制。

Print Debug Info 【打印信息】

DLLog(DLDebugViewInfoMessage, @"here is a message");
DLLog(DLDebugViewInfoWarning, @"here is a warning");
DLLog(DLDebugViewInfoError, @"here is a error");
  • Note this 【请注意】:
  • DLDebugViewInfoMessage/DLDebugViewInfoWarning/DLDebugViewInfoError is Enum value, you can use this enum value to make this debuginfo’s text color.
  • DLDebugViewInfoMessage/DLDebugViewInfoWarning/DLDebugViewInfoError 是一个枚举值, 你可以通过指定这个值,来改变调试信息的文字颜色。

ToDo List【将会添加】

  • Done Maybe can use shake phone to showing the Blue button. (Thanks Maail :) 【也许应该支持通过晃动手机显示蓝色按钮】
  • DebugView should support display image 【DebugView应该支持图片显示】
  • Maybe should have some Quick functionality, like running some Foundation or code by inputing? 【也许应该有一些快速方法,通过输入来运行一些方法或者代码?】

Latest podspec

{
    "name": "DLDebugView",
    "version": "0.1.0",
    "summary": "A in app debug view for iOS.",
    "description": "For now just have Log feature, will add more in future!",
    "homepage": "https://github.com/DeliveLee/DLDebugView",
    "license": "MIT",
    "authors": {
        "DeliveLee": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/DeliveLee/DLDebugView.git",
        "tag": "0.1.0"
    },
    "source_files": "DLDebugView/*",
    "public_header_files": "DLDebugView/DLDebugView.h",
    "resources": "DLDebugView/Assets/*.png",
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "requires_arc": true,
    "dependencies": {
        "SDAutoLayout": []
    }
}

Pin It on Pinterest

Share This