Here is the total text from my Swift playground code:
//: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
let age = 13
if age > 18 {
print ("you can play")
} else {
print ("your too young")
}
I am just starting and am following a tutorial but it is giving me the error message:
Playground execution failed: error: MyPlayground 3.playground:5:7: error: expected '{' after 'else' } else ^
- thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.3
- frame #0: 0x00000001008693b0 MyPlayground 3
executePlayground frame #1: 0x000000010137ab5c CoreFoundationCFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 frame #2: 0x000000010135fe54 CoreFoundation__CFRunLoopDoBlocks + 356 frame #3: 0x000000010135f5ee CoreFoundation__CFRunLoopRun + 894 frame #4: 0x000000010135f016 CoreFoundationCFRunLoopRunSpecific + 406 frame #5: 0x0000000106826a24 GraphicsServicesGSEventRunModal + 62 frame #6: 0x0000000101ee10d4 UIKitUIApplicationMain + 159 frame #7: 0x00000001008686d9 MyPlayground 3main + 201 frame #8: 0x000000010491b65d libdyld.dylib`start + 1
- frame #0: 0x00000001008693b0 MyPlayground 3
How can this be?
Aucun commentaire:
Enregistrer un commentaire