swift中 類似OC的宏定義

來源:互聯網
上載者:User

標籤:

OC 中調試列印

/**

 *  自訂Log

 */

#ifdef DEBUG

#define JYLog(...)        NSLog(__VA_ARGS__)

#else

#define JYLog(...)

#endif

 

 

// swift中我寫了這麼一個類,進行調試輸出 調用方法  Debug.Log(error)

 

import UIKit

 

class Debug: NSObject{

   // TODO: 為調試修改

   private static let debug = true

   class  func Log (value: Any ){

        if debug {

            print("調試資訊:\(value)  ============================================")

        }

    }

    

}

 

 

// swift中 類似OC的宏定義

 

 /// 提示資訊

let JYNetError = SVProgressHUD.showInfoWithStatus("您的網路不給力或伺服器拒絕訪問") as Any

let JYdisMiss = SVProgressHUD.dismiss() as Any

let JYShow = SVProgressHUD.show() as Any

swift中 類似OC的宏定義

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.