How to reopen Console Output in a Swift Playground?

折月煮酒 提交于 2019-11-30 01:08:46

问题


I was happily printlning to the Console Output in the Assistant Editor of a Swift/Xcode 6 Playground (see this SO thread for more info), until I decided to try clicking the [X] to close the Console Output.

How do I bring the Console Output back??


回答1:


This eluded me for a while, too. You want View menu -> Assistant Editor -> Show Assistant Editor.

Once you see the pane that holds the console output, if you still aren't seeing the right thing, make any change that will cause a println() to fire and the console output should appear.




回答2:


Just hover your mouse pointer over the value evaluation area (pane next to your coding area) and click on the plus sign to open the output pane. If you have closed the console output in the output pane, then click anywhere in the coding area and press enter. You will get your console output back.




回答3:


If the View > Assistant Editor > Show Assistant Editor does not work, simple go to the bottom of the screen and drag the little footer up, so it looks like so:




回答4:


Closing the Playground and reopening did not bring the Console Output back, but quitting Xcode and reopening did. If there's an answer that doesn't require restarting Xcode I'll go for that, but for now this seems to be the answer :/

Yay for beta software!




回答5:


You can bring back the console frame by following the steps below:

  1. Open the assistant editor. In the assistant editor, find the playground timeline screen.

  2. In the playground timeline screen, find the bottom right corner box, where it contains "- 31 +" (In my case it says the time elapsed is 31; it can differ according to your code).

  3. Click the "+" / "-" mark in the "- 31 +" box.

  4. There your result, console frame along with the other frames could have come there.




回答6:


The keyboard shortcut is Cmd + Shift + Y




回答7:


If you've opened the Assistant editor, either by using Cmd+Option+Enter, or selecting the white/plus icon on the left of a line, and then removed the "Console output" there are some alternatives which may help you in getting it back:

  1. Make sure you don't have any errors in your playground, as they stop execution and thusly any output to the Assistant Editor
  2. Make a change so that playground is re-executed
  3. Force a new run of the playground using Editor > Execute Playground
  4. Change the timer in the lower right, as this also triggers a new run of the playground
  5. Restart Xcode as the playground is a little buggy, and you sometimes just need to restart everything... :-(



回答8:


Put a /* at the top line of your code area to comment out everything. The Console Output box will reappear at the top of the right-hand panel (the Assistant editor panel).

Some errors may show in the Console box. Ignore.

Now delete the /* and the Console box will stay put.




回答9:


have just started xcode (version 7.0.1) using swift but had the same problem, to show how the code will appear in console I toggled the little triangle next to the play button on the bottom left of the screen triangle toggle button this then open a view in which I could see the results of the code console opend hope this helps



来源:https://stackoverflow.com/questions/24277848/how-to-reopen-console-output-in-a-swift-playground

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!