<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>1.3 Xcode 中的预览 on 编程那些事儿</title><link>https://before80.github.io/prgms/Swift/SwiftUI/views/1.3-PreviewsInXcode/</link><description>Recent content in 1.3 Xcode 中的预览 on 编程那些事儿</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sun, 13 Sep 2026 18:20:56 +0800</lastBuildDate><atom:link href="https://before80.github.io/prgms/Swift/SwiftUI/views/1.3-PreviewsInXcode/index.xml" rel="self" type="application/rss+xml"/><item><title>1.3.1 已弃用</title><link>https://before80.github.io/prgms/Swift/SwiftUI/views/1.3-PreviewsInXcode/1.3.1-PreviewsDeprecated/</link><pubDate>Sat, 12 Sep 2026 12:47:47 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/SwiftUI/views/1.3-PreviewsInXcode/1.3.1-PreviewsDeprecated/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://developer.apple.com/documentation/swiftui/previews-deprecated"&gt;https://developer.apple.com/documentation/swiftui/previews-deprecated&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="131-已弃用"&gt;1.3.1 已弃用&lt;/h1&gt;
&lt;p&gt;查阅已弃用的预览符号及其替代方案。&lt;/p&gt;
&lt;h2 id="Defining-a-preview"&gt;定义预览&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/previewprovider"&gt;PreviewProvider&lt;/a&gt; —— 在 Xcode 中产生视图预览的类型。&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/previewplatform"&gt;PreviewPlatform&lt;/a&gt; —— 可以运行预览的平台。&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/view/previewdisplayname(_:)"&gt;previewDisplayName(_:)&lt;/a&gt; —— 设置一个用户可见的名称，显示在画布中用于该预览。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="Customizing-a-preview"&gt;自定义预览&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/view/previewdevice(_:)"&gt;previewDevice(_:)&lt;/a&gt; —— 覆盖预览所使用的设备。&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/previewdevice"&gt;PreviewDevice&lt;/a&gt; —— 运行预览的模拟器设备。&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/view/previewlayout(_:)"&gt;previewLayout(_:)&lt;/a&gt; —— 覆盖预览容器的大小。&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/view/previewinterfaceorientation(_:)"&gt;previewInterfaceOrientation(_:)&lt;/a&gt; —— 覆盖预览的方向。&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/interfaceorientation"&gt;InterfaceOrientation&lt;/a&gt; —— 从用户视角看到的界面方向。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="Setting-a-context"&gt;设置上下文&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/view/previewcontext(_:)"&gt;previewContext(_:)&lt;/a&gt; —— 为预览声明一个上下文。&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/previewcontext"&gt;PreviewContext&lt;/a&gt; —— 与预览配合使用的上下文类型。&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/swiftui/previewcontextkey"&gt;PreviewContextKey&lt;/a&gt; —— 预览上下文的键类型。&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>