Swift Playgrounds: Replacement for captureValue(_:withIdentifier:)

╄→尐↘猪︶ㄣ 提交于 2019-11-29 18:04:22

问题


Xcode 7.3 has deprecated XCPlaygroundPage.currentPage.captureValue(_:withIdentifier:). Its predecessor, XCPCaptureValue(), was deprecated in Xcode 7.1.

I'm wondering if there is any replacement, apart from implicit capture of collections and in loops? Apart from being more flexible using the explicit approach, the ability to add captions to graphs seems to be gone with the deprecation/removal (although the symbols are found, the aforementioned deprecated methods don't do anything, or at least not what you'd expect).


回答1:


There is currently no alternative or replacement. Graphs are only displayed implicitly. I have verified this in the Swift/Xcode labs at WWDC 2016. I have filed a radar and will update this questions, should there be any progress.




回答2:


Use the currentPage property:

XCPlaygroundPage.currentPage.captureValue(_, withIdentifier:)



来源:https://stackoverflow.com/questions/36305877/swift-playgrounds-replacement-for-capturevalue-withidentifier

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