Build SwiftUI News Widget for iOS 15, iPadOS 15, macOS 12 - Intent Configurable Parameter

Опубликовано: 13 Октябрь 2024
на канале: Xcoding with Alfian
2,801
53

We are going to add Widgets to the SwiftUI News App for iOS, iPadOS, and macOS. We’ll learn to build User Intent Configurable Widget and Composable UI for All system family sizes from small, medium, large, and extra large.
#swiftui #iosdev #widgetkit #ios15 #ipados15 #macos12

Update:
1. Please use prefix(n) instead of prefix(upTo: n) to slice the array. When using upTo on Array with total element count is less than n, it will crash the app with index out of range reception.
2. Xcode 13.1 RC and macOS 12 RC have been released. Please upgrade if you plan on building the macOS 12 Widget. The public version for both will be released at 25th October 2021.

Timeline
00:00 Introduction & Getting Started
02:36 Add Widget Extension Targets
04:49 Add Source Code Shared Target Membership
06:36 Create Custom Intent & Parameter - Intent Definition
11:35 Create Widget Model & Article Timeline Entry
23:22 Add Stubs Data for SwiftUI Live Preview
32:00 Create Article Intent Timeline Provider, Fetch & Refresh News Data.
47:27 SwiftUI View - Article Thumbnail View
58:17 SwiftUI View - Article Group View
01:07:30 SwiftUI View - Composing Views for S, M, L, XL Family Sizes
01:19:50 Integration & Testing using iPadOS Simulator & macOS 12
01:27:36 Widget Deeplink URL Main App Handling
01:39:57 Closing

GitHub Repository Link:
https://github.com/alfianlosari/NewsA...

SwiftUI 3.0 & Swift 5.5 - Building iOS 15, macOS 12, tvOS 15, watchOS 8 News App with NewsAPI   • SwiftUI 3.0 & Swift 5.5 - Building iO...  

Covid19 Stats Intent Configurable Widget with Resolvable Parameter
   • iOS 14 WidgetKit Pt 2 | Building COVI...  

Register Free API Key from NewsAPI Website:
https://newsapi.org