Search code examples
iosswiftswift-playground

Unable to see console output in assistant editor using swift playground


Can any one explain me , why console output is not visible in assistant editor. the bar on the right is only showing "Hello, playground" and the assistant editor is showing blank.

// Playground - noun: a place where people can play

   import UIKit

   var str = "Hello, playground"

   println("Hello")

   NSLog("Hello, world")

Solution

  • You need to import the cocoa library :

    import Cocoa
    

    This Sample working fine for me:

    import Cocoa
    
    var str = "Hello, playground"
    println("Hello")
    
    NSLog("Hello, world")