From 375ea665b4ea4253e12c33326999935412bbb8b1 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 12 Jun 2024 20:02:01 +0200 Subject: [PATCH 1/5] Default logout experience to trending timeline + remove cache when logout --- IceCubesApp/App/Tabs/Timeline/TimelineTab.swift | 10 ++++++---- .../Sources/Timeline/View/TimelineViewModel.swift | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift b/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift index 9e9fe8cc..f4b9852b 100644 --- a/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift +++ b/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift @@ -61,7 +61,7 @@ struct TimelineTab: View { if client.isAuth { timeline = lastTimelineFilter } else { - timeline = .federated + timeline = .trending } } Task { @@ -125,8 +125,10 @@ struct TimelineTab: View { private var timelineFilterButton: some View { headerGroup timelineFiltersButtons - listsFiltersButons - tagsFiltersButtons + if client.isAuth { + listsFiltersButons + tagsFiltersButtons + } localTimelinesFiltersButtons tagGroupsFiltersButtons Divider() @@ -325,7 +327,7 @@ struct TimelineTab: View { if client.isAuth, canFilterTimeline { timeline = lastTimelineFilter } else if !client.isAuth { - timeline = .federated + timeline = .trending } } } diff --git a/Packages/Timeline/Sources/Timeline/View/TimelineViewModel.swift b/Packages/Timeline/Sources/Timeline/View/TimelineViewModel.swift index 85c9a4e8..0cbbc660 100644 --- a/Packages/Timeline/Sources/Timeline/View/TimelineViewModel.swift +++ b/Packages/Timeline/Sources/Timeline/View/TimelineViewModel.swift @@ -49,7 +49,7 @@ import SwiftUI private(set) var datasource = TimelineDatasource() private let cache = TimelineCache() private var isCacheEnabled: Bool { - canFilterTimeline && timeline.supportNewestPagination + canFilterTimeline && timeline.supportNewestPagination && client?.isAuth == true } @ObservationIgnored From 02d73de113dc305474b35e99246d01850f0b9277 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 12 Jun 2024 20:37:43 +0200 Subject: [PATCH 2/5] Fix iOS 18 build + performances --- .../xcshareddata/swiftpm/Package.resolved | 12 ++++++------ IceCubesApp/App/Main/AppView.swift | 2 +- IceCubesApp/App/Tabs/Settings/SettingsTab.swift | 12 ++++++++---- Packages/Timeline/Package.swift | 4 ++-- .../Sources/Timeline/View/TimelineView.swift | 2 +- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/IceCubesApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/IceCubesApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6988570f..8afd403c 100644 --- a/IceCubesApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/IceCubesApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -3,10 +3,10 @@ { "identity" : "bodega", "kind" : "remoteSourceControl", - "location" : "https://github.com/mergesort/Bodega", + "location" : "https://github.com/Dimillian/Bodega", "state" : { - "revision" : "f0554077c178088ba11557bbdbb71775cc6a1b84", - "version" : "2.1.0" + "branch" : "main", + "revision" : "a144ed8afdd760b65b6b9a136ba8bb75cd19387e" } }, { @@ -129,10 +129,10 @@ { "identity" : "swiftui-introspect", "kind" : "remoteSourceControl", - "location" : "https://github.com/siteline/SwiftUI-Introspect.git", + "location" : "https://github.com/Dimillian/swiftui-introspect", "state" : { - "revision" : "7dc5b287f8040e4ad5038739850b758e78f77808", - "version" : "1.1.4" + "branch" : "main", + "revision" : "e5d36b00e6e437b552aa76ed6d1eca71d6fd8f8b" } } ], diff --git a/IceCubesApp/App/Main/AppView.swift b/IceCubesApp/App/Main/AppView.swift index 4b090762..95b14d1b 100644 --- a/IceCubesApp/App/Main/AppView.swift +++ b/IceCubesApp/App/Main/AppView.swift @@ -122,7 +122,7 @@ struct AppView: View { .tag(tab) } } - .introspect(.tabView, on: .iOS(.v17)) { (tabview: UITabBarController) in + .introspect(.tabView, on: .iOS(.v18)) { (tabview: UITabBarController) in tabview.tabBar.isHidden = horizontalSizeClass == .regular tabview.customizableViewControllers = [] tabview.moreNavigationController.isNavigationBarHidden = true diff --git a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift index 592f8285..b8849139 100644 --- a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift +++ b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift @@ -264,10 +264,14 @@ struct SettingsTabs: View { Text("settings.app.icon") } icon: { let icon = IconSelectorView.Icon(string: UIApplication.shared.alternateIconName ?? "AppIcon") - Image(uiImage: .init(named: icon.appIconName)!) - .resizable() - .frame(width: 25, height: 25) - .cornerRadius(4) + if let image: UIImage = .init(named: icon.appIconName) { + Image(uiImage: .init(named: icon.appIconName)!) + .resizable() + .frame(width: 25, height: 25) + .cornerRadius(4) + } else { + EmptyView() + } } } #endif diff --git a/Packages/Timeline/Package.swift b/Packages/Timeline/Package.swift index ab9c1c68..dbac639c 100644 --- a/Packages/Timeline/Package.swift +++ b/Packages/Timeline/Package.swift @@ -22,8 +22,8 @@ let package = Package( .package(name: "Env", path: "../Env"), .package(name: "StatusKit", path: "../StatusKit"), .package(name: "DesignSystem", path: "../DesignSystem"), - .package(url: "https://github.com/siteline/SwiftUI-Introspect.git", from: "1.0.0"), - .package(url: "https://github.com/mergesort/Bodega", exact: "2.1.0"), + .package(url: "https://github.com/Dimillian/swiftui-introspect", branch: "main"), + .package(url: "https://github.com/Dimillian/Bodega", branch: "main"), ], targets: [ .target( diff --git a/Packages/Timeline/Sources/Timeline/View/TimelineView.swift b/Packages/Timeline/Sources/Timeline/View/TimelineView.swift index e6469249..8d86ebf8 100644 --- a/Packages/Timeline/Sources/Timeline/View/TimelineView.swift +++ b/Packages/Timeline/Sources/Timeline/View/TimelineView.swift @@ -68,7 +68,7 @@ public struct TimelineView: View { .scrollContentBackground(.hidden) .background(theme.primaryBackgroundColor) #endif - .introspect(.list, on: .iOS(.v17)) { (collectionView: UICollectionView) in + .introspect(.list, on: .iOS(.v18)) { (collectionView: UICollectionView) in DispatchQueue.main.async { self.collectionView = collectionView } From ab99ef9a0a8a392cde124993a71f7c1140d503be Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 12 Jun 2024 20:41:19 +0200 Subject: [PATCH 3/5] Fix --- IceCubesApp/App/Tabs/Settings/SettingsTab.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift index b8849139..7f9a822a 100644 --- a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift +++ b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift @@ -265,7 +265,7 @@ struct SettingsTabs: View { } icon: { let icon = IconSelectorView.Icon(string: UIApplication.shared.alternateIconName ?? "AppIcon") if let image: UIImage = .init(named: icon.appIconName) { - Image(uiImage: .init(named: icon.appIconName)!) + Image(uiImage: image) .resizable() .frame(width: 25, height: 25) .cornerRadius(4) From 551697eb2c0c6f4d04bcf004a70af2bc5286a0ca Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 12 Jun 2024 20:51:08 +0200 Subject: [PATCH 4/5] Refix Introspect --- IceCubesApp/App/Main/AppView.swift | 2 +- Packages/Timeline/Sources/Timeline/View/TimelineView.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/IceCubesApp/App/Main/AppView.swift b/IceCubesApp/App/Main/AppView.swift index 95b14d1b..ff72955c 100644 --- a/IceCubesApp/App/Main/AppView.swift +++ b/IceCubesApp/App/Main/AppView.swift @@ -122,7 +122,7 @@ struct AppView: View { .tag(tab) } } - .introspect(.tabView, on: .iOS(.v18)) { (tabview: UITabBarController) in + .introspect(.tabView, on: .iOS(.v17, .v18)) { (tabview: UITabBarController) in tabview.tabBar.isHidden = horizontalSizeClass == .regular tabview.customizableViewControllers = [] tabview.moreNavigationController.isNavigationBarHidden = true diff --git a/Packages/Timeline/Sources/Timeline/View/TimelineView.swift b/Packages/Timeline/Sources/Timeline/View/TimelineView.swift index 8d86ebf8..ab92f166 100644 --- a/Packages/Timeline/Sources/Timeline/View/TimelineView.swift +++ b/Packages/Timeline/Sources/Timeline/View/TimelineView.swift @@ -68,7 +68,7 @@ public struct TimelineView: View { .scrollContentBackground(.hidden) .background(theme.primaryBackgroundColor) #endif - .introspect(.list, on: .iOS(.v18)) { (collectionView: UICollectionView) in + .introspect(.list, on: .iOS(.v17, .v18)) { (collectionView: UICollectionView) in DispatchQueue.main.async { self.collectionView = collectionView } From 283e537c4461c5eef96d7babecfa926e177eb8c8 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 12 Jun 2024 21:24:55 +0200 Subject: [PATCH 5/5] Bump version to 1.10.43 --- IceCubesApp.xcodeproj/project.pbxproj | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/IceCubesApp.xcodeproj/project.pbxproj b/IceCubesApp.xcodeproj/project.pbxproj index 234cdeb5..7d382ee6 100644 --- a/IceCubesApp.xcodeproj/project.pbxproj +++ b/IceCubesApp.xcodeproj/project.pbxproj @@ -1193,7 +1193,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.10.42; + MARKETING_VERSION = 1.10.43; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesNotifications"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1228,7 +1228,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.10.42; + MARKETING_VERSION = 1.10.43; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesNotifications"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1336,7 +1336,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.10.42; + MARKETING_VERSION = 1.10.43; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1370,7 +1370,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.10.42; + MARKETING_VERSION = 1.10.43; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1552,7 +1552,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 1.10.42; + MARKETING_VERSION = 1.10.43; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp"; PRODUCT_NAME = "Ice Cubes"; SDKROOT = auto; @@ -1608,7 +1608,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 1.10.42; + MARKETING_VERSION = 1.10.43; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp"; PRODUCT_NAME = "Ice Cubes"; SDKROOT = auto; @@ -1643,7 +1643,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.10.42; + MARKETING_VERSION = 1.10.43; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesActionExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1678,7 +1678,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.10.42; + MARKETING_VERSION = 1.10.43; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesActionExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos;