[swift-users] get input from playground
Rick Ballard
rballard at apple.com
Mon Dec 7 12:55:16 CST 2015
Hi Bee,
Swift.org downloadable toolchains don't work with Xcode Playgrounds; Playgrounds use the copy of Swift that ships with Xcode. Any questions you have about Playground usage are best asked at https://devforums.apple.com/community/tools/xcode/playgrounds.
Thanks,
- Rick
> On Dec 7, 2015, at 12:41 AM, Bee via swift-users <swift-users at swift.org> wrote:
>
> Hi all,
>
> I'd like to read keyboard input from playground console. Swift doc gives me readLine function. I tried it on Playground but it didn't accept any input I entered from the keyboard. Screenshot attached.
>
> The code:
> // — start code —
> var name: String
> print("What's your name? ", terminator: "")
> name = readLine(stripNewline: true)!
> print("Hello, \(name)... good to see you!")
> // — end code —
>
> Tried it on:
> - Macbook Pro with OS X El Capitan
> - XCode 7 with Swift 2
>
> Any help please? Thank you.
>
> --
> -Bee-
>
> <playground console input.png>_______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151207/530028df/attachment.html>
More information about the swift-users
mailing list