SWIFT 2 prints (), how to hide?

Before Swift 2, you can hide all your println() with such a helper

func println( object: Any) {

#if DEBUG
Swift.println(object)
#endif

If you change to this

func print(object: Any) {

#if DEBUG
Swift.print(object)
#endif

It works as expected, but print() has a new appendLine function. So in your code you can write

println("Test", appendNewLine: false)< /pre> 

However, doing this means that the assistant mentioned above will no longer work. Any suggestions on how to solve this problem. Thank you very much.

For swift 2.2, this is what I use:

// Disable print for production.< br />func print(items: Any..., separator: String = "", terminator: String = "
") {
#if DEBUG
Swift.print(items[0], separator:separator, terminator: terminator)
#endif
}

Before Swift 2, you can hide all yours with such a helper println()

func println(object: Any) {

#if DEBUG
Swift.println(object)< br />#endif

If you change to this

func print(object: Any) {

#if DEBUG
Swift.print(object )
#endif

It works as expected, but print() has a new appendLine function. So in your code you can write

println("Test", appendNewLine: false)

However, doing so means that the assistant mentioned above will no longer work. Any suggestions on how to solve this problem. Thank you very much.< /p>

For swift 2.2, this is what I use:

// Disable print for production .
func print(items: Any..., separator: String = "", terminator: String = " ") {
#if DEBUG
Swift.print(items[0 ], separator:separator, terminator: terminator)
#endif
}

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 445 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.