diff --git a/ClientKit/Package.swift b/ClientKit/Package.swift index e268a51..0961e69 100644 --- a/ClientKit/Package.swift +++ b/ClientKit/Package.swift @@ -7,9 +7,7 @@ let package = Package( name: "ClientKit", defaultLocalization: "en", platforms: [ - .iOS(.v16), - .macOS(.v12), - .watchOS(.v8) + .iOS(.v17) ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. diff --git a/EnvironmentKit/Package.swift b/EnvironmentKit/Package.swift index 16c3f73..41e3075 100644 --- a/EnvironmentKit/Package.swift +++ b/EnvironmentKit/Package.swift @@ -7,9 +7,7 @@ let package = Package( name: "EnvironmentKit", defaultLocalization: "en", platforms: [ - .iOS(.v16), - .macOS(.v12), - .watchOS(.v8) + .iOS(.v17) ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. diff --git a/PixelfedKit/Package.swift b/PixelfedKit/Package.swift index ec19ebf..d9dcba5 100644 --- a/PixelfedKit/Package.swift +++ b/PixelfedKit/Package.swift @@ -7,9 +7,7 @@ let package = Package( name: "PixelfedKit", defaultLocalization: "en", platforms: [ - .iOS(.v16), - .macOS(.v12), - .watchOS(.v8) + .iOS(.v17) ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. diff --git a/README.md b/README.md index cddc1a9..87b1c02 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ From time to time you have to come back and translate lines which has been added Things that should be implemented in version 2.0: - [ ] Use auto generated resources (Color/Images) instead static extensions (how to do this in separete Swift Packages?) - - [ ] Move to xcstring (new Xcode transaction system) + - [x] Move to xcstring (new Xcode transaction system) - [ ] Move to new Observable macro (iOS 17) - [ ] Migrate to SwiftData (iOS 17) - [ ] Use ViewModels diff --git a/ServicesKit/Package.swift b/ServicesKit/Package.swift index 9bcd4eb..dfce31e 100644 --- a/ServicesKit/Package.swift +++ b/ServicesKit/Package.swift @@ -7,9 +7,7 @@ let package = Package( name: "ServicesKit", defaultLocalization: "en", platforms: [ - .iOS(.v16), - .macOS(.v12), - .watchOS(.v8) + .iOS(.v17) ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. diff --git a/Vernissage/Modifiers/AnimatePlaceholderModifier.swift b/Vernissage/Modifiers/AnimatePlaceholderModifier.swift index ca9ee30..a39869d 100644 --- a/Vernissage/Modifiers/AnimatePlaceholderModifier.swift +++ b/Vernissage/Modifiers/AnimatePlaceholderModifier.swift @@ -33,7 +33,7 @@ struct AnimatePlaceholderModifier: AnimatableModifier { guard isLoading else { return } isAnim.toggle() } - .onChange(of: isLoading) { _ in + .onChange(of: isLoading) { isAnim.toggle() } } diff --git a/Vernissage/VernissageApp.swift b/Vernissage/VernissageApp.swift index 4517ea8..68a4e2f 100644 --- a/Vernissage/VernissageApp.swift +++ b/Vernissage/VernissageApp.swift @@ -78,24 +78,24 @@ struct VernissageApp: App { await self.calculateNewPhotosInBackground() } } - .onChange(of: applicationState.theme) { newValue in + .onChange(of: applicationState.theme) { oldValue, newValue in self.theme = newValue.colorScheme() } - .onChange(of: applicationState.tintColor) { newValue in + .onChange(of: applicationState.tintColor) { oldValue, newValue in self.tintColor = newValue.color() } - .onChange(of: applicationState.account) { newValue in + .onChange(of: applicationState.account) { oldValue, newValue in if newValue == nil { self.applicationViewMode = .signIn } } - .onChange(of: applicationState.showStatusId) { newValue in + .onChange(of: applicationState.showStatusId) { oldValue, newValue in if let statusId = newValue { self.routerPath.navigate(to: .status(id: statusId)) self.applicationState.showStatusId = nil } } - .onChange(of: applicationState.showAccountId) { newValue in + .onChange(of: applicationState.showAccountId) { oldValue, newValue in if let accountId = newValue { self.routerPath.navigate(to: .userProfile(accountId: accountId, accountDisplayName: nil, accountUserName: "")) self.applicationState.showAccountId = nil diff --git a/Vernissage/Views/EditProfileView.swift b/Vernissage/Views/EditProfileView.swift index 22353c7..68e1d17 100644 --- a/Vernissage/Views/EditProfileView.swift +++ b/Vernissage/Views/EditProfileView.swift @@ -93,7 +93,7 @@ struct EditProfileView: View { } } } - .onChange(of: self.selectedItems) { _ in + .onChange(of: self.selectedItems) { Task { await self.getAvatar() } @@ -168,9 +168,9 @@ struct EditProfileView: View { private func formView() -> some View { Section { TextField("", text: $displayName) - .onChange(of: self.displayName, perform: { _ in + .onChange(of: self.displayName) { self.displayName = String(self.displayName.prefix(self.displayNameMaxLength)) - }) + } } header: { Text("editProfile.title.displayName", comment: "Display name") } footer: { @@ -183,9 +183,9 @@ struct EditProfileView: View { Section { TextField("", text: $bio, axis: .vertical) .lineLimit(5, reservesSpace: true) - .onChange(of: self.bio, perform: { _ in + .onChange(of: self.bio) { self.bio = String(self.bio.prefix(self.bioMaxLength)) - }) + } } header: { Text("editProfile.title.bio", comment: "Bio") } footer: { @@ -200,9 +200,9 @@ struct EditProfileView: View { .autocapitalization(.none) .keyboardType(.URL) .autocorrectionDisabled() - .onChange(of: self.website, perform: { _ in + .onChange(of: self.website) { self.website = String(self.website.prefix(self.websiteMaxLength)) - }) + } } header: { Text("editProfile.title.website", comment: "Website") } footer: { diff --git a/Vernissage/Views/HomeFeedView.swift b/Vernissage/Views/HomeFeedView.swift index 9ce2d74..0907d90 100644 --- a/Vernissage/Views/HomeFeedView.swift +++ b/Vernissage/Views/HomeFeedView.swift @@ -98,7 +98,7 @@ struct HomeFeedView: View { await self.refreshData() HapticService.shared.fireHaptic(of: .dataRefresh(intensity: 0.7)) } - .onChange(of: self.applicationState.amountOfNewStatuses) { _ in + .onChange(of: self.applicationState.amountOfNewStatuses) { self.calculateOffset() }.onAppear { self.calculateOffset() diff --git a/Vernissage/Views/MainView.swift b/Vernissage/Views/MainView.swift index 48d02a9..e2e04a4 100644 --- a/Vernissage/Views/MainView.swift +++ b/Vernissage/Views/MainView.swift @@ -102,8 +102,8 @@ struct MainView: View { self.getTrailingToolbar() } } - .onChange(of: tipsStore.status) { status in - if status == .successful { + .onChange(of: tipsStore.status) { oldStatus, newStatus in + if newStatus == .successful { withAnimation(.spring()) { self.routerPath.presentedOverlay = .successPayment self.tipsStore.reset() diff --git a/Vernissage/Views/SettingsView/SettingsView.swift b/Vernissage/Views/SettingsView/SettingsView.swift index 99a1007..1c62879 100644 --- a/Vernissage/Views/SettingsView/SettingsView.swift +++ b/Vernissage/Views/SettingsView/SettingsView.swift @@ -75,17 +75,17 @@ struct SettingsView: View { .withAppRouteur() .withOverlayDestinations(overlayDestinations: $routerPath.presentedOverlay) } - .onChange(of: self.applicationState.theme) { _ in + .onChange(of: self.applicationState.theme) { // Change theme of current modal screen (unformtunatelly it's not changed autmatically. self.theme = self.applicationState.theme.colorScheme() ?? self.getSystemColorScheme() } - .onChange(of: applicationState.account) { newValue in + .onChange(of: applicationState.account) { oldValue, newValue in if newValue == nil { self.dismiss() } } - .onChange(of: tipsStore.status) { status in - if status == .successful { + .onChange(of: tipsStore.status) { oldStatus, newStatus in + if newStatus == .successful { withAnimation(.spring()) { self.routerPath.presentedOverlay = .successPayment self.tipsStore.reset() diff --git a/Vernissage/Views/SettingsView/Subviews/GeneralSectionView.swift b/Vernissage/Views/SettingsView/Subviews/GeneralSectionView.swift index 78c0a16..96090fb 100644 --- a/Vernissage/Views/SettingsView/Subviews/GeneralSectionView.swift +++ b/Vernissage/Views/SettingsView/Subviews/GeneralSectionView.swift @@ -57,9 +57,9 @@ struct GeneralSectionView: View { Text("settings.title.applicationIcon", comment: "Application icon") } .pickerStyle(.navigationLink) - .onChange(of: self.applicationState.activeIcon) { iconName in - ApplicationSettingsHandler.shared.set(activeIcon: iconName) - UIApplication.shared.setAlternateIconName(iconName == "Default" ? nil : iconName) + .onChange(of: self.applicationState.activeIcon) { oldIncomeName, newIconName in + ApplicationSettingsHandler.shared.set(activeIcon: newIconName) + UIApplication.shared.setAlternateIconName(newIconName == "Default" ? nil : newIconName) } // Application theme. @@ -71,8 +71,8 @@ struct GeneralSectionView: View { } label: { Text("settings.title.theme", comment: "Theme") } - .onChange(of: self.applicationState.theme) { theme in - ApplicationSettingsHandler.shared.set(theme: theme) + .onChange(of: self.applicationState.theme) { oldTheme, newTheme in + ApplicationSettingsHandler.shared.set(theme: newTheme) } // Menu position. @@ -84,8 +84,8 @@ struct GeneralSectionView: View { } label: { Text("settings.title.menuPosition", comment: "Menu position") } - .onChange(of: self.applicationState.menuPosition) { menuPosition in - ApplicationSettingsHandler.shared.set(menuPosition: menuPosition) + .onChange(of: self.applicationState.menuPosition) { oldMenuPosition, newMenuPosition in + ApplicationSettingsHandler.shared.set(menuPosition: newMenuPosition) } } } diff --git a/Vernissage/Views/SettingsView/Subviews/HapticsSectionView.swift b/Vernissage/Views/SettingsView/Subviews/HapticsSectionView.swift index 82baeef..09228fc 100644 --- a/Vernissage/Views/SettingsView/Subviews/HapticsSectionView.swift +++ b/Vernissage/Views/SettingsView/Subviews/HapticsSectionView.swift @@ -21,25 +21,25 @@ struct HapticsSectionView: View { Section("settings.title.haptics") { Toggle("settings.title.hapticsTabSelection", isOn: $hapticTabSelectionEnabled) - .onChange(of: hapticTabSelectionEnabled) { newValue in + .onChange(of: hapticTabSelectionEnabled) { oldValue, newValue in self.applicationState.hapticTabSelectionEnabled = newValue ApplicationSettingsHandler.shared.set(hapticTabSelectionEnabled: newValue) } Toggle("settings.title.hapticsButtonPress", isOn: $hapticButtonPressEnabled) - .onChange(of: hapticButtonPressEnabled) { newValue in + .onChange(of: hapticButtonPressEnabled) { oldValue, newValue in self.applicationState.hapticButtonPressEnabled = newValue ApplicationSettingsHandler.shared.set(hapticButtonPressEnabled: newValue) } Toggle("settings.title.hapticsListRefresh", isOn: $hapticRefreshEnabled) - .onChange(of: hapticRefreshEnabled) { newValue in + .onChange(of: hapticRefreshEnabled) { oldValue, newValue in self.applicationState.hapticRefreshEnabled = newValue ApplicationSettingsHandler.shared.set(hapticRefreshEnabled: newValue) } Toggle("settings.title.hapticsAnimationFinished", isOn: $hapticAnimationEnabled) - .onChange(of: hapticAnimationEnabled) { newValue in + .onChange(of: hapticAnimationEnabled) { oldValue, newValue in self.applicationState.hapticAnimationEnabled = newValue ApplicationSettingsHandler.shared.set(hapticAnimationEnabled: newValue) } diff --git a/Vernissage/Views/SettingsView/Subviews/MediaSettingsView.swift b/Vernissage/Views/SettingsView/Subviews/MediaSettingsView.swift index a777f04..518d3be 100644 --- a/Vernissage/Views/SettingsView/Subviews/MediaSettingsView.swift +++ b/Vernissage/Views/SettingsView/Subviews/MediaSettingsView.swift @@ -22,7 +22,7 @@ struct MediaSettingsView: View { .foregroundColor(.customGrayColor) } } - .onChange(of: self.applicationState.showSensitive) { newValue in + .onChange(of: self.applicationState.showSensitive) { oldValue, newValue in ApplicationSettingsHandler.shared.set(showSensitive: newValue) } @@ -34,7 +34,7 @@ struct MediaSettingsView: View { .foregroundColor(.customGrayColor) } } - .onChange(of: self.applicationState.showPhotoDescription) { newValue in + .onChange(of: self.applicationState.showPhotoDescription) { oldValue, newValue in ApplicationSettingsHandler.shared.set(showPhotoDescription: newValue) } @@ -46,7 +46,7 @@ struct MediaSettingsView: View { .foregroundColor(.customGrayColor) } } - .onChange(of: self.applicationState.showAvatarsOnTimeline) { newValue in + .onChange(of: self.applicationState.showAvatarsOnTimeline) { oldValue, newValue in ApplicationSettingsHandler.shared.set(showAvatarsOnTimeline: newValue) } @@ -58,7 +58,7 @@ struct MediaSettingsView: View { .foregroundColor(.customGrayColor) } } - .onChange(of: self.applicationState.showFavouritesOnTimeline) { newValue in + .onChange(of: self.applicationState.showFavouritesOnTimeline) { oldValue, newValue in ApplicationSettingsHandler.shared.set(showFavouritesOnTimeline: newValue) } @@ -70,7 +70,7 @@ struct MediaSettingsView: View { .foregroundColor(.customGrayColor) } } - .onChange(of: self.applicationState.showAltIconOnTimeline) { newValue in + .onChange(of: self.applicationState.showAltIconOnTimeline) { oldValue, newValue in ApplicationSettingsHandler.shared.set(showAltIconOnTimeline: newValue) } @@ -82,7 +82,7 @@ struct MediaSettingsView: View { .foregroundColor(.customGrayColor) } } - .onChange(of: self.applicationState.warnAboutMissingAlt) { newValue in + .onChange(of: self.applicationState.warnAboutMissingAlt) { oldValue, newValue in ApplicationSettingsHandler.shared.set(warnAboutMissingAlt: newValue) } @@ -94,7 +94,7 @@ struct MediaSettingsView: View { .foregroundColor(.customGrayColor) } } - .onChange(of: self.applicationState.showReboostedStatuses) { newValue in + .onChange(of: self.applicationState.showReboostedStatuses) { oldValue, newValue in ApplicationSettingsHandler.shared.set(showReboostedStatuses: newValue) } @@ -106,7 +106,7 @@ struct MediaSettingsView: View { .foregroundColor(.customGrayColor) } } - .onChange(of: self.applicationState.hideStatusesWithoutAlt) { newValue in + .onChange(of: self.applicationState.hideStatusesWithoutAlt) { oldValue, newValue in ApplicationSettingsHandler.shared.set(hideStatusesWithoutAlt: newValue) } } diff --git a/Vernissage/Views/StatusView/Subviews/CommentsSectionView.swift b/Vernissage/Views/StatusView/Subviews/CommentsSectionView.swift index 2c8eab4..fa8da58 100644 --- a/Vernissage/Views/StatusView/Subviews/CommentsSectionView.swift +++ b/Vernissage/Views/StatusView/Subviews/CommentsSectionView.swift @@ -54,7 +54,7 @@ struct CommentsSectionView: View { } } } - .onChange(of: self.applicationState.newComment) { _ in + .onChange(of: self.applicationState.newComment) { self.commentViewModels = nil Task { await self.loadComments() diff --git a/Vernissage/Views/StatusesView.swift b/Vernissage/Views/StatusesView.swift index f07ef79..912de14 100644 --- a/Vernissage/Views/StatusesView.swift +++ b/Vernissage/Views/StatusesView.swift @@ -143,7 +143,7 @@ struct StatusesView: View { ErrorService.shared.handle(error, message: "statuses.error.loadingStatusesFailed", showToastr: !Task.isCancelled) } } - .onChange(of: self.applicationState.showReboostedStatuses) { _ in + .onChange(of: self.applicationState.showReboostedStatuses) { if self.listType != .home { return } diff --git a/Vernissage/Views/TrendStatusesView.swift b/Vernissage/Views/TrendStatusesView.swift index 907ea91..afed4b6 100644 --- a/Vernissage/Views/TrendStatusesView.swift +++ b/Vernissage/Views/TrendStatusesView.swift @@ -36,7 +36,7 @@ struct TrendStatusesView: View { } .padding() .pickerStyle(SegmentedPickerStyle()) - .onChange(of: tabSelectedValue) { _ in + .onChange(of: tabSelectedValue) { Task { do { self.state = .loading diff --git a/Vernissage/Widgets/ImageRow.swift b/Vernissage/Widgets/ImageRow.swift index afd0ae9..a955f4f 100644 --- a/Vernissage/Widgets/ImageRow.swift +++ b/Vernissage/Widgets/ImageRow.swift @@ -74,8 +74,8 @@ struct ImageRow: View { .onFirstAppear { self.selected = self.attachmentsData.first?.id ?? String.empty() } - .onChange(of: selected, perform: { attachmentId in - if let attachment = attachmentsData.first(where: { item in item.id == attachmentId }) { + .onChange(of: selected) { oldAttachmentId, newAttachmentId in + if let attachment = attachmentsData.first(where: { item in item.id == newAttachmentId }) { let size = ImageSizeService.shared.calculate(width: Double(attachment.metaImageWidth), height: Double(attachment.metaImageHeight), andContainerWidth: UIScreen.main.bounds.size.width) @@ -87,7 +87,7 @@ struct ImageRow: View { } } } - }) + } .frame(width: self.imageWidth, height: self.imageHeight) .tabViewStyle(.page(indexDisplayMode: .never)) .overlay(CustomPageTabViewStyleView(pages: self.attachmentsData, currentId: $selected)) diff --git a/Vernissage/Widgets/ImageRowAsync.swift b/Vernissage/Widgets/ImageRowAsync.swift index 811f78b..a2586eb 100644 --- a/Vernissage/Widgets/ImageRowAsync.swift +++ b/Vernissage/Widgets/ImageRowAsync.swift @@ -77,7 +77,7 @@ struct ImageRowAsync: View { } .frame(width: self.clipToRectangle ? self.containerWidth : self.imageWidth, height: self.clipToRectangle ? self.containerWidth : self.imageHeight) - .onChange(of: self.containerWidth) { newContainerWidth in + .onChange(of: self.containerWidth) { oldContainerWidth, newContainerWidth in let calculatedSize = ImageSizeService.shared.calculate(width: self.imageWidth, height: self.imageHeight, andContainerWidth: newContainerWidth) @@ -109,7 +109,7 @@ struct ImageRowAsync: View { .tag(attachment.id) } } - .onChange(of: self.containerWidth) { newContainerWidth in + .onChange(of: self.containerWidth) { oldContainerWidth, newContainerWidth in let calculatedSize = ImageSizeService.shared.calculate(width: self.imageWidth, height: self.imageHeight, andContainerWidth: newContainerWidth) @@ -119,8 +119,8 @@ struct ImageRowAsync: View { .onFirstAppear { self.selected = self.statusViewModel.mediaAttachments.first?.id ?? String.empty() } - .onChange(of: selected, perform: { attachmentId in - if let attachment = self.statusViewModel.mediaAttachments.first(where: { item in item.id == attachmentId }) { + .onChange(of: selected) { oldAttachmentId, newAttachmentId in + if let attachment = self.statusViewModel.mediaAttachments.first(where: { item in item.id == newAttachmentId }) { if let size = ImageSizeService.shared.get(for: attachment.url) { let calculatedSize = ImageSizeService.shared.calculate(width: size.width, height: size.height, @@ -134,7 +134,7 @@ struct ImageRowAsync: View { } } } - }) + } .frame(width: self.clipToRectangle ? self.containerWidth : self.imageWidth, height: self.clipToRectangle ? self.containerWidth : self.imageHeight) .tabViewStyle(.page(indexDisplayMode: .never)) diff --git a/Vernissage/Widgets/ImagesCarousel.swift b/Vernissage/Widgets/ImagesCarousel.swift index 810bf68..4d881b2 100644 --- a/Vernissage/Widgets/ImagesCarousel.swift +++ b/Vernissage/Widgets/ImagesCarousel.swift @@ -89,8 +89,8 @@ struct ImagesCarousel: View { .padding(0) .frame(height: self.imageHeight) .tabViewStyle(PageTabViewStyle()) - .onChange(of: selected, perform: { index in - if let attachment = attachments.first(where: { item in item.id == index }) { + .onChange(of: selected) { oldIndex, newIndex in + if let attachment = attachments.first(where: { item in item.id == newIndex }) { self.selectedAttachment = attachment self.exifCamera = attachment.exifCamera self.exifExposure = attachment.exifExposure @@ -98,7 +98,7 @@ struct ImagesCarousel: View { self.exifLens = attachment.exifLens self.description = attachment.description } - }) + } Spacer(minLength: 0) } .padding(0) diff --git a/Vernissage/Widgets/WaterfallGrid.swift b/Vernissage/Widgets/WaterfallGrid.swift index d097f90..78df381 100644 --- a/Vernissage/Widgets/WaterfallGrid.swift +++ b/Vernissage/Widgets/WaterfallGrid.swift @@ -48,10 +48,10 @@ struct WaterfallGrid: View where Data: RandomAccessCollection .onFirstAppear { self.recalculateArrays() } - .onChange(of: self.refreshId) { _ in + .onChange(of: self.refreshId) { self.shouldRecalculate = true } - .onChange(of: self.data) { _ in + .onChange(of: self.data) { if self.shouldRecalculate { self.recalculateArrays() self.shouldRecalculate = false @@ -59,7 +59,7 @@ struct WaterfallGrid: View where Data: RandomAccessCollection self.appendToArrays() } } - .onChange(of: self.columns) { _ in + .onChange(of: self.columns) { self.recalculateArrays() } } diff --git a/WidgetsKit/Package.swift b/WidgetsKit/Package.swift index 6582576..c7ba416 100644 --- a/WidgetsKit/Package.swift +++ b/WidgetsKit/Package.swift @@ -7,9 +7,7 @@ let package = Package( name: "WidgetsKit", defaultLocalization: "en", platforms: [ - .iOS(.v16), - .macOS(.v12), - .watchOS(.v8) + .iOS(.v17) ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. diff --git a/WidgetsKit/Sources/WidgetsKit/ViewModifiers/DeviceRotation.swift b/WidgetsKit/Sources/WidgetsKit/ViewModifiers/DeviceRotation.swift index 5013236..143f4e6 100644 --- a/WidgetsKit/Sources/WidgetsKit/ViewModifiers/DeviceRotation.swift +++ b/WidgetsKit/Sources/WidgetsKit/ViewModifiers/DeviceRotation.swift @@ -47,9 +47,9 @@ struct DeviceImageGallery: ViewModifier { self.action(galleryProperties) } } - .onChange(of: self.horizontalSizeClass) { horizontalSize in + .onChange(of: self.horizontalSizeClass) { oldHorizontalSize, newHorizontalSize in asyncAfter(0.1) { - let galleryProperties = self.getGalleryProperties(geometry: geometry, horizontalSize: horizontalSize ?? .compact) + let galleryProperties = self.getGalleryProperties(geometry: geometry, horizontalSize: newHorizontalSize ?? .compact) self.action(galleryProperties) } } diff --git a/WidgetsKit/Sources/WidgetsKit/Views/BaseComposeView.swift b/WidgetsKit/Sources/WidgetsKit/Views/BaseComposeView.swift index 4fa47c5..9519b21 100644 --- a/WidgetsKit/Sources/WidgetsKit/Views/BaseComposeView.swift +++ b/WidgetsKit/Sources/WidgetsKit/Views/BaseComposeView.swift @@ -134,10 +134,10 @@ public struct BaseComposeView: View { await self.loadPhotos() } } - .onChange(of: self.textModel.text) { _ in + .onChange(of: self.textModel.text) { self.refreshScreenState() } - .onChange(of: self.selectedItems) { _ in + .onChange(of: self.selectedItems) { Task { await self.loadPhotos() } diff --git a/WidgetsKit/Sources/WidgetsKit/Widgets/ExpandableText.swift b/WidgetsKit/Sources/WidgetsKit/Widgets/ExpandableText.swift index b7bd809..0d517b9 100644 --- a/WidgetsKit/Sources/WidgetsKit/Widgets/ExpandableText.swift +++ b/WidgetsKit/Sources/WidgetsKit/Widgets/ExpandableText.swift @@ -25,7 +25,9 @@ struct ExpandableText: View { } } // Re-calculate isTruncated for the new text - .onChange(of: text, perform: { _ in isTruncated = nil }) + .onChange(of: text) { + isTruncated = nil + } } func calculateTruncation(text: String) -> some View {