How do you do println () in swift 2

I don't seem to know how to do println() in Swift 2.

I tried to do println(helloworld)

This does not work

helloworld is a variable

+7
ios swift swift2
source share
4 answers

it print("hello world") . it has changed in swift 2.0 and you need to see the Apple website. put print() instead of println()

+12
source share

More More println() According to the apple documentation :

In Swift 2.0 there is

 print("Hello") 

for a new line you can set a flag

 print("Hello", appendNewline: false) 

Statement

func print (_ value: T, appendNewline appendNewline: Bool)

Discussion

The textual representation is obtained from the value using its protocols in the following order of preference: Streamable, CustomStringConvertible, CustomDebugStringConvertible. If none of these matches are found, the default text representation is constructed in a specific way, based on the type and structure.

+18
source share

Use quotation marks:

 println("helloworld") 

and in swift 2.0 use the print () function:

 print("helloworld") 
+4
source share

Using Xcode 7.0 Beta 6, a solution at my end, including getting rid of the annoying new line character:

enter image description here

+4
source share

All Articles