View in English

  • Apple Developer
    • 시작하기

    시작하기 탐색

    • 개요
    • 알아보기
    • Apple Developer Program

    알림 받기

    • 최신 뉴스
    • Hello Developer
    • 플랫폼

    플랫폼 탐색

    • Apple 플랫폼
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    피처링

    • 디자인
    • 배포
    • 게임
    • 액세서리
    • 웹
    • 홈
    • CarPlay
    • 기술

    기술 탐색

    • 개요
    • Xcode
    • Swift
    • SwiftUI

    피처링

    • 손쉬운 사용
    • 앱 인텐트
    • Apple Intelligence
    • 게임
    • 머신 러닝 및 AI
    • 보안
    • Xcode Cloud
    • 커뮤니티

    커뮤니티 탐색

    • 개요
    • Apple과의 만남 이벤트
    • 커뮤니티 주도 이벤트
    • 개발자 포럼
    • 오픈 소스

    피처링

    • WWDC
    • Swift Student Challenge
    • 개발자 이야기
    • App Store 어워드
    • Apple 디자인 어워드
    • 문서

    문서 탐색

    • 문서 라이브러리
    • 기술 개요
    • 샘플 코드
    • 휴먼 인터페이스 가이드라인
    • 비디오

    릴리즈 노트

    • 피처링 업데이트
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • 다운로드

    다운로드 탐색

    • 모든 다운로드
    • 운영 체제
    • 애플리케이션
    • 디자인 리소스

    피처링

    • Xcode
    • TestFlight
    • 서체
    • SF Symbols
    • Icon Composer
    • 지원

    지원 탐색

    • 개요
    • 도움말
    • 개발자 포럼
    • 피드백 지원
    • 문의하기

    피처링

    • 계정 도움말
    • 앱 심사 지침
    • App Store Connect 도움말
    • 새로 추가될 요구 사항
    • 계약 및 지침
    • 시스템 상태
  • 빠른 링크

    • 이벤트
    • 뉴스
    • 포럼
    • 샘플 코드
    • 비디오
 

비디오

메뉴 열기 메뉴 닫기
  • 컬렉션
  • 주제
  • 전체 비디오
  • 소개

WWDC20 컬렉션으로 돌아가기

  • 소개
  • 자막 전문
  • Visually edit SwiftUI views

    Help your apps be the best versions of themselves: Discover how you can leverage Xcode Previews and SwiftUI to quickly iterate upon and improve your app. Find out how you can use the Previews canvas to build your app from the ground up, and view your interface in different environments like Light or Dark mode or with accessibility features like Dynamic Type enabled.

    To learn more about SwiftUI Previews, check out “Structure your app for SwiftUI previews” and “Add custom views and modifiers to the Xcode Library”.

    리소스

      • HD 비디오
      • SD 비디오

    관련 비디오

    WWDC20

    • Add custom views and modifiers to the Xcode Library
    • Structure your app for SwiftUI previews
  • 비디오 검색…

    Hello and welcome to WWDC.

    Hi, I'm Daisy, and I work on the Xcode Previews team. In this video, I want to show you how you can use Xcode Previews to help you quickly build SwiftUI apps, whether you're new to SwiftUI or not. To do so, I'll be building the row view for our smoothie app. The view has the smoothie's name, ingredients, calorie count, and an image, along with the star count for its popularity. To begin, I'm going to use a library to add a new view to my UI. The library has SwiftUI views and modifiers, allowing you to keep your preview compiling without additional modifications.

    SwiftUI uses structural layouts in order to make your app adaptive. So your app looks great whether it's running on an iMac or an iPhone. Xcode Previews lets you insert your content, and get the right layout container, all in one action.

    Next, I can double-click on my "Hello World" view, which brings focus to the editor, allowing me to quickly modify the key component of my view, whether this is an image or text. The Xcode Previews canvas and the source editor have a tight integration. The canvas and the inspector help you write your Swift code faster, and any changes you do to source are immediately visible in the canvas.

    To help you build your structure even quicker, you can use Command-D to duplicate your views.

    Xcode Previews understands the structure of your code, so if you're duplicating a view that isn't in a container, it would insert one for you.

    Next, we can double-click on our third label to quickly modify it. Double-clicking on a view not only helps with replacing static content, but also makes integrating your model data a breeze.

    To insert my image, I'm going to bring up the library using the keyboard shortcut Command-Shift-L. The Xcode Previews canvas not only works with SwiftUI views and modifiers, but also your media, allowing you to use your images in your asset catalog with ease.

    Our image is larger than expected. This, however, makes sense, since SwiftUI renders your images in their true size. To remedy this, we can use the inspector to locate the appropriate modifier. Clicking on "Add Modifier" brings down a list of recommended suggestions using your current context, allowing you to quickly locate what you're looking for, and learn about modifiers commonly used with the view. The image is now resizing, though its size is not up to spec. In the inspector, I can add and edit common modifiers, allowing you to try various values without having to know the modifier's signature. This immediately updates your code and renders in the canvas.

    Next, I want to add the star view that indicates the smoothie's popularity. Using your project's custom SwiftUI views and modifiers in the canvas is just as easy as using those provided by the library. To see how to do this, see the session "Adding Custom Views and Modifiers to the Xcode Library." To repeat the star horizontally, Xcode Previews provides actions that embed the selected view in various containers. The actions can be brought up by holding Command and clicking on the view. In our case, we click "Embed in HStack" to embed in a horizontal container. To repeat the star view, we can bring up the same menu and click "Repeat." I'd like to make my smoothie title pop. Using the inspector, I can quickly try various font and weight values on my view, and preview the results immediately in the canvas.

    That doesn't look exactly how I want. To clear the modifier, I can click on the circular blue indicator next to the control. Clearing the modifier returns it to its inherited value. In this case, the font returns to the default SwiftUI font.

    Next, I would like to edit the other labels, which, with the inspectors, is only a few clicks. I can use the inspectors not only to edit properties of the modifiers, but also edit those of the view.

    Screen real estate is a hot commodity, so Xcode Previews has an in-canvas inspector allowing you to close your side panel without losing any functionality. To bring up the canvas inspector, hold Control-Option and click on the view you wish to inspect.

    To help you preview across different configurations, in Xcode 12 we have introduced various preview-centric capabilities. For example, we can now duplicate a preview with one click. And since previews are just views, we can inspect them too.

    In summary, some of the ways Xcode Previews helps you visually edit your SwiftUI views is through tight source editor integration, the inspector, and the library. Thanks!

Developer Footer

  • 비디오
  • WWDC20
  • Visually edit SwiftUI views
  • 메뉴 열기 메뉴 닫기
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    메뉴 열기 메뉴 닫기
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    메뉴 열기 메뉴 닫기
    • 손쉬운 사용
    • 액세서리
    • Apple Intelligence
    • 앱 확장 프로그램
    • App Store
    • 오디오 및 비디오(영문)
    • 증강 현실
    • 디자인
    • 배포
    • 교육
    • 서체(영문)
    • 게임
    • 건강 및 피트니스
    • 앱 내 구입
    • 현지화
    • 지도 및 위치
    • 머신 러닝 및 AI
    • 오픈 소스(영문)
    • 보안
    • Safari 및 웹(영문)
    메뉴 열기 메뉴 닫기
    • 문서(영문)
    • 튜토리얼
    • 다운로드
    • 포럼(영문)
    • 비디오
    메뉴 열기 메뉴 닫기
    • 지원 문서
    • 문의하기
    • 버그 보고
    • 시스템 상태(영문)
    메뉴 열기 메뉴 닫기
    • Apple Developer
    • App Store Connect
    • 인증서, 식별자 및 프로파일(영문)
    • 피드백 지원
    메뉴 열기 메뉴 닫기
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program(영문)
    • Mini Apps Partner Program
    • News Partner Program(영문)
    • Video Partner Program(영문)
    • Security Bounty Program(영문)
    • Security Research Device Program(영문)
    메뉴 열기 메뉴 닫기
    • Apple과의 만남
    • Apple Developer Center
    • App Store 어워드(영문)
    • Apple 디자인 어워드
    • Apple Developer Academy(영문)
    • WWDC
    최신 뉴스 읽기 Apple Developer 앱 받기
    Copyright © 2026 Apple Inc. 모든 권리 보유.
    약관 개인정보 처리방침 계약 및 지침