swift - 在 Swift Playgrounds [Xcode] 中链接页面

标签 swift xcode markdown swift-playground xcplayground

我是 swift playground 的新手,在 Xcode 中制作 swift playground 时遇到了一些问题。

这是我的主 Playground 页面

import UIKit
import PlaygroundSupport
import SpriteKit
let secondScene = Index()
let master = FirstScene()
let root = UINavigationController(rootViewController: master)
PlaygroundPage.current.liveView = root

但是当我尝试在 Swift 的源类和 playground 页面本身中添加 Next Topic 时,链接没有出现。

注意:我在 Xcode 中使用 Swift Playgrounds 而不是 iPad 上的 Playgroundbook。

此外,在我的主页的 sources 文件夹中,我将所有 class 声明为 public,这是在源代码中使用 helper swift 文件的正确方法吗?

我尝试创建一个新的 Playground 并添加了具有默认链接但仍然没有输出的页面。
New playground but assistant editor shows no links

最佳答案

看看您的屏幕截图,您的代码是正确的。链接到下一页的语法 [Next Page!](@next)。您现在需要做的就是:
- 在 Xcode 菜单栏中,单击编辑器
- 点击“显示渲染标记”

Editor -> 'Show Rendered Markup' Menu

就是这样。您可以在任何您喜欢的地方放置标记。请记住在链接到 playground 页面时用 %20 替换空格,例如[我的页面 #2](My%20Other%20Page)

关于swift - 在 Swift Playgrounds [Xcode] 中链接页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49584922/

相关文章:

html - Jekyll:在 Markdown 文件中包含 HTML 部分

pdf - Pandoc Markdown 到 Latex PDF : table with alternating row colors?

python - pandas 中的日期时间格式 .to_markdown()

ios - Swift:如何返回类<UITableViewDataSource>?

ios - 存储的属性需要一个初始值或者应该是@NSManaged

ios - 重构swift代码

ios - Riot-iOS 错误 : while run bundle exec pod install

ios - View Controller TDD

iphone - 在 UIimageview 层的边框和内容之间添加空间

objective-c - Xcode 奇怪的 ViewController 命名约定