Swift: #warning equivalent

前端 未结 14 1616
無奈伤痛
無奈伤痛 2020-11-28 18:52

Does Swift have a #warning equivalent? It\'s simply used to show a warning in Xcode\'s own GUI

I\'m also interested in whether there\'s a #error equivalent.

14条回答
  •  失恋的感觉
    2020-11-28 18:56

    Edit

    As of Swift 4.2, language level support is available for both build warnings and errors.

    #warning("Warning description")
    #error("Throws a build error")
    

    Original Answer

    Quick, dirty, and oh so elegantly simple all at the same time.

    // Description of what you need to fix
    
    var FIX_ME__

提交回复
热议问题