Show relevant, glanceable content from your app as widgets in iOS and macOS, and as watch complications.
WidgetKit gives users ready access to content in your app by putting widgets on the iOS Home Screen and Today View, the macOS Notification Center, and by putting accessory widgets on the Lock Screen on iPhone and as complications in watchOS. Your widgets stay up to date so users always have the latest information at a glance. When they need more details, your widget takes them directly to the appropriate place in your app.
WidgetKit
을 사용하면 iOS
홈 화면과 오늘 보기, macOS
알림 센터에 위젯을 배치하고 iPhone
의 잠금 화면에 액세서리 위젯을 배치하고 watchOS
의 컴플리케이션으로 액세서리 위젯을 배치하여 사용자가 앱의 콘텐츠에 바로 액세스할 수 있습니다. 위젯은 최신 상태를 유지하므로 사용자는 항상 최신 정보를 한 눈에 볼 수 있습니다. 더 자세한 정보가 필요하면 위젯이 앱의 적절한 위치로 직접 이동합니다.With different sizes (small, medium, large, extra large) and accessory styles (circular, rectangular, flat, and corner in watchOS), widgets can display a wide range of information. Users can personalize widgets to see details specific to their needs, and arrange their widgets in whatever way works best for them. When users stack widgets on the Home Screen and enable Smart Rotate, WidgetKit automatically rotates the most relevant widget to the top, making sure users see the most important details at exactly the right time.
watchOS
의 경우 원형, 직사각형, 평면 및 모서리)로 위젯은 광범위한 정보를 표시할 수 있습니다. 사용자는 위젯을 개인화하여 필요에 따른 세부 정보를 확인하고 가장 적합한 방식으로 위젯을 정렬할 수 있습니다. 사용자가 홈 화면에 위젯을 쌓고 스마트 회전을 활성화하면 WidgetKit
이 자동으로 가장 관련성이 높은 위젯을 맨 위로 회전시켜 사용자가 정확한 시간에 가장 중요한 세부 정보를 볼 수 있도록 합니다.Starting with iOS 16 and watchOS 9, WidgetKit allows you to create accessory widgets that appear as complications in watchOS and as widgets on the Lock Screen on iPhone. Accessory widgets are a great opportunity to bring your iOS app content to Apple Watch and your watchOS app content to iPhone.
iOS 16
및 watchOS 9
부터 WidgetKit
을 사용하면 watchOS
에서 컴플리케이션으로 표시되고 iPhone
의 잠금 화면에서 위젯으로 나타나는 액세서리 위젯을 만들 수 있습니다. 액세서리 위젯은 iOS 앱 콘텐츠를 Apple Watch
로, watchOS
앱 콘텐츠를 iPhone
으로 가져올 수 있는 좋은 기회입니다.To implement a widget, add a widget extension to your app. Configure the widget with a timeline provider, and use SwiftUI views to display the widget’s content. The timeline provider tells WidgetKit when to update your widget’s content.
SwiftUI View
를 사용하여 위젯의 콘텐츠를 표시합니다. 타임라인 제공자는 위젯 콘텐츠를 업데이트할 시기를 WidgetKit
에 알려줍니다.To make a widget user-configurable, add a custom SiriKit intent definition to your extension. In iOS, WidgetKit automatically provides a customization interface to let users personalize their widgets. Apple Watch doesn’t come with a dedicated user interface to configure widgets. To recommend preconfigured watch complications that use IntentConfiguration
in the list of available complications, use IntentRecommendation
. If you configure a accessory widget with StaticConfiguration
, watchOS automatically includes the complication in the list.
iOS
에서 WidgetKit
은 사용자가 위젯을 개인화할 수 있도록 사용자 정의 인터페이스를 자동으로 제공합니다. Apple Watch
에는 위젯 구성을 위한 전용 사용자 인터페이스가 제공되지 않습니다. 사용 가능한 정보 목록에서 IntentConfiguration
을 사용하는 사전 구성된 시계 정보를 추천하려면 IntentRecommendation
을 사용하세요. StaticConfiguration
으로 액세서리 위젯을 구성하면 watchOS
는 목록에 정보를 자동으로 포함합니다.