1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        DotzuXiOS 調(diào)試小工具

        聯(lián)合創(chuàng)作 · 2023-10-01 21:42

        DotzuX 是一款 iOS 調(diào)試小工具。

        預(yù)覽

        安裝

        CocoaPods

        platform :ios, '8.0'
        use_frameworks!
        
        target 'YourTargetName' do
            pod 'DotzuX', :configurations => ['Debug']
        end

        Carthage

        github "DotzuX/DotzuX"

        警告:不要在正式發(fā)布版中(比如發(fā)布到AppStore)導(dǎo)入DotzuX.framework,因為DotzuX內(nèi)部使用了Apple的私有API,并且DotzuX使用了hook,可能會帶來不可預(yù)知的風(fēng)險。閱讀這篇集成指南,了解如何僅在Debug環(huán)境下導(dǎo)入DotzuX.framework。

        使用

        Swift

        //Step 1.
        #if DEBUG
            import DotzuX
        #endif
        
        //Step 2.
        #if DEBUG
            DotzuX.enable()
        #endif
        
        //Step 3.
        public func print<T>(file: String = #file, function: String = #function, line: Int = #line, _ message: T, color: UIColor = .white) {
        
            #if DEBUG
                swiftLog(file, function, line, message, color)
            #endif
        }

        Objective-C

        //Step 1.
        #ifdef DEBUG
            @import DotzuX;
        #endif
        
        //Step 2.
        #ifdef DEBUG
            [DotzuX enable];
        #endif
        
        //Step 3.
        #ifdef DEBUG
            #define NSLog(fmt, ...) [DotzuX objcLog:[[NSString stringWithUTF8String:__FILE__] lastPathComponent] :NSStringFromSelector(_cmd) :__LINE__ :(fmt, ##__VA_ARGS__) :[UIColor whiteColor]]
        #else
            #define NSLog(fmt, ...) nil
        #endif

        更多高級用法,請查看示例代碼。

        注意:如果項目使用了Swift和Objective-C混編,請小心使用Other Swift FlagsPreprocessor Macros,可以參考這里

        TODO

        • 單元測試 (Unit Testing)

        瀏覽 30
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        評論
        圖片
        表情
        推薦
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            《性/生活3》未删减版 | 日日日日日日bbbbb视频 日本男插女 | 另类 综合 日韩 欧美 亚洲 | 少妇交换做爰3在线看 | 日月俱乐部裸体裸体歌舞 | 天天夜夜干 | 日本大尺度吃奶做爰视频 | 国产婷婷在线视频 | 91麻豆精品 | 免费看国产一级片 |