From b660d50c4d96873a5b8ed58e886e276b0ba5026f Mon Sep 17 00:00:00 2001 From: Brais Moure Date: Wed, 16 Feb 2022 18:27:43 +0100 Subject: [PATCH 1/6] Error de pintado en iOS 14 --- Twitimer/UseCases/Home/HomeViewModel.swift | 2 +- Twitimer/Util/Extension/ViewExtension.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Twitimer/UseCases/Home/HomeViewModel.swift b/Twitimer/UseCases/Home/HomeViewModel.swift index a7929cf..9d95bb6 100644 --- a/Twitimer/UseCases/Home/HomeViewModel.swift +++ b/Twitimer/UseCases/Home/HomeViewModel.swift @@ -63,7 +63,7 @@ final class HomeViewModel: ObservableObject { return router.menuView() } - func tabView(type: HomeViewTabType, delegate: CountdownViewModelDelegate? = nil) -> AnyView { + func tabView(type: HomeViewTabType, delegate: CountdownViewModelDelegate? = nil) -> some View { switch type { case .countdown: diff --git a/Twitimer/Util/Extension/ViewExtension.swift b/Twitimer/Util/Extension/ViewExtension.swift index 7e24de6..81114a4 100644 --- a/Twitimer/Util/Extension/ViewExtension.swift +++ b/Twitimer/Util/Extension/ViewExtension.swift @@ -26,11 +26,11 @@ extension View { // MARK: iOS 15 - func hideTableSeparator() -> AnyView { + func hideTableSeparator() -> some View { if #available(iOS 15.0, *) { - return AnyView(self.listRowSeparator(.hidden).listRowInsets(EdgeInsets())) + return AnyView(listRowSeparator(.hidden).listRowInsets(EdgeInsets())) } - return AnyView(self.listRowInsets(EdgeInsets())) + return AnyView(listRowInsets(EdgeInsets())) } } From 6e46749246d2e56504ed1a93765f2604d5aad0f6 Mon Sep 17 00:00:00 2001 From: Brais Moure Date: Wed, 16 Feb 2022 18:27:56 +0100 Subject: [PATCH 2/6] =?UTF-8?q?Versi=C3=B3n=201.3.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Twitimer.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Twitimer.xcodeproj/project.pbxproj b/Twitimer.xcodeproj/project.pbxproj index 7a64f4b..e509a26 100644 --- a/Twitimer.xcodeproj/project.pbxproj +++ b/Twitimer.xcodeproj/project.pbxproj @@ -1128,7 +1128,7 @@ "@executable_path/Frameworks", ); MACH_O_TYPE = mh_execute; - MARKETING_VERSION = 1.3; + MARKETING_VERSION = 1.3.1; PRODUCT_BUNDLE_IDENTIFIER = com.mouredev.Twitimer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -1154,7 +1154,7 @@ "@executable_path/Frameworks", ); MACH_O_TYPE = mh_execute; - MARKETING_VERSION = 1.3; + MARKETING_VERSION = 1.3.1; PRODUCT_BUNDLE_IDENTIFIER = com.mouredev.Twitimer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; From 021d019fea467c955709bacfa976b21af66022ad Mon Sep 17 00:00:00 2001 From: Brais Moure Date: Wed, 16 Feb 2022 22:36:11 +0100 Subject: [PATCH 3/6] Error modo vacaciones --- .../Launch/Account/User/UserViewModel.swift | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Twitimer/UseCases/Launch/Account/User/UserViewModel.swift b/Twitimer/UseCases/Launch/Account/User/UserViewModel.swift index 0dcc307..682ddbf 100644 --- a/Twitimer/UseCases/Launch/Account/User/UserViewModel.swift +++ b/Twitimer/UseCases/Launch/Account/User/UserViewModel.swift @@ -19,7 +19,7 @@ final class UserViewModel: ObservableObject { var isStreamer: Bool { get { - return user?.streamer ?? Session.shared.user?.streamer ?? false + return getUser()?.streamer ?? false } } @@ -46,15 +46,15 @@ final class UserViewModel: ObservableObject { self.user = user self.onClose = onClose self.readOnly = user != nil - - self.schedule = filterSchedule(schedules: user?.schedule ?? Session.shared.user?.schedule ?? []) - self.onHolidays = user?.settings?.onHolidays ?? Session.shared.user?.settings?.onHolidays ?? false + + self.onHolidays = getUser()?.settings?.onHolidays ?? false + self.schedule = filterSchedule(schedules: getUser()?.schedule ?? []) } // Public func userView(isStreamer: Bool) -> UserHeaderView? { - if let user = user ?? Session.shared.user { + if let user = getUser() { if user.login != nil { return router.userHeaderView(user: user, readOnly: readOnly, isStreamer: isStreamer, onClose: onClose, updateHolidays: { self.onHolidays = Session.shared.user?.settings?.onHolidays ?? false @@ -77,7 +77,7 @@ final class UserViewModel: ObservableObject { } func hasUser() -> Bool { - return (user ?? Session.shared.user) != nil + return getUser() != nil } func save(streamer: Bool) { @@ -113,6 +113,10 @@ final class UserViewModel: ObservableObject { // Private + private func getUser() -> User? { + return user ?? Session.shared.user + } + private func filterSchedule(schedules: [UserSchedule]) -> [UserSchedule] { return schedules.filter { schedule in // Si estamos en modo lectura no se muestran los no habilitados o eventos puntuales pasados From 6c6138838f296eb932f5dc0c98a8e6272e870c45 Mon Sep 17 00:00:00 2001 From: Brais Moure Date: Wed, 16 Feb 2022 22:36:22 +0100 Subject: [PATCH 4/6] =?UTF-8?q?Versi=C3=B3n=201.3.1(2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Twitimer.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Twitimer.xcodeproj/project.pbxproj b/Twitimer.xcodeproj/project.pbxproj index e509a26..aff24d4 100644 --- a/Twitimer.xcodeproj/project.pbxproj +++ b/Twitimer.xcodeproj/project.pbxproj @@ -1117,7 +1117,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Twitimer/Twitimer.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"Twitimer/Preview Content\""; DEVELOPMENT_TEAM = SJGR47U9J5; ENABLE_PREVIEWS = YES; @@ -1143,7 +1143,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Twitimer/Twitimer.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"Twitimer/Preview Content\""; DEVELOPMENT_TEAM = SJGR47U9J5; ENABLE_PREVIEWS = YES; From ed9164a81bdbf8a19ac305b05f254e59fcbe6650 Mon Sep 17 00:00:00 2001 From: Brais Moure Date: Thu, 17 Feb 2022 17:03:10 +0100 Subject: [PATCH 5/6] Error de pintado en iOS 14 --- Twitimer/AppDelegate.swift | 2 +- Twitimer/UseCases/Countdown/CountdownView.swift | 2 +- Twitimer/UseCases/Search/SearchView.swift | 5 ++--- Twitimer/Util/Extension/ViewExtension.swift | 7 ++++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Twitimer/AppDelegate.swift b/Twitimer/AppDelegate.swift index 0090faf..d081739 100644 --- a/Twitimer/AppDelegate.swift +++ b/Twitimer/AppDelegate.swift @@ -72,7 +72,7 @@ class AppDelegate: NSObject, UIApplicationDelegate { UITabBar.appearance().isTranslucent = false UITabBar.appearance().clipsToBounds = true // Remove top line UITabBar.appearance().standardAppearance = tabBarAppearance - if #available(iOS 15.0, *) { + if #available(iOS 15, *) { UITabBar.appearance().scrollEdgeAppearance = tabBarAppearance } diff --git a/Twitimer/UseCases/Countdown/CountdownView.swift b/Twitimer/UseCases/Countdown/CountdownView.swift index 2e4b53d..c32f699 100644 --- a/Twitimer/UseCases/Countdown/CountdownView.swift +++ b/Twitimer/UseCases/Countdown/CountdownView.swift @@ -44,8 +44,8 @@ struct CountdownView: View { TimerRowView(streaming: streaming, endDate: streaming.schedule.date) } - .hideTableSeparator() .background(Color.backgroundColor) + .hideTableSeparator() } }.listStyle(.plain) .pullToRefresh(isShowing: $isShowingRefresh) { diff --git a/Twitimer/UseCases/Search/SearchView.swift b/Twitimer/UseCases/Search/SearchView.swift index a305c8e..be00a4d 100644 --- a/Twitimer/UseCases/Search/SearchView.swift +++ b/Twitimer/UseCases/Search/SearchView.swift @@ -85,13 +85,12 @@ struct SearchView: View { if let search = viewModel.search, !search.isEmpty { ForEach(search, id: \.id) { user in SearchRowView(user: nil, userSearch: user, addAction: nil) - .hideTableSeparator() .background(Color.backgroundColor) .onTapGesture { if let user = user.broadcasterLogin { viewModel.search(user: user) } - } + }.hideTableSeparator() } } else { ForEach(viewModel.users, id: \.id) { user in @@ -102,8 +101,8 @@ struct SearchView: View { viewModel.updateCount() }) } - .hideTableSeparator() .background(Color.backgroundColor) + .hideTableSeparator() } } }.listStyle(.plain) diff --git a/Twitimer/Util/Extension/ViewExtension.swift b/Twitimer/Util/Extension/ViewExtension.swift index 81114a4..42be820 100644 --- a/Twitimer/Util/Extension/ViewExtension.swift +++ b/Twitimer/Util/Extension/ViewExtension.swift @@ -23,14 +23,15 @@ extension View { if condition { transform(self) } else { self } } - + // MARK: iOS 15 func hideTableSeparator() -> some View { - if #available(iOS 15.0, *) { + if #available(iOS 15, *) { return AnyView(listRowSeparator(.hidden).listRowInsets(EdgeInsets())) + } else { + return AnyView(listRowInsets(EdgeInsets())) } - return AnyView(listRowInsets(EdgeInsets())) } } From e6463ae9fbdab953d38ce3385d3a0a4424da0297 Mon Sep 17 00:00:00 2001 From: Brais Moure Date: Thu, 17 Feb 2022 17:03:42 +0100 Subject: [PATCH 6/6] =?UTF-8?q?Versi=C3=B3n=201.3.2(2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Twitimer.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Twitimer.xcodeproj/project.pbxproj b/Twitimer.xcodeproj/project.pbxproj index aff24d4..9ce1317 100644 --- a/Twitimer.xcodeproj/project.pbxproj +++ b/Twitimer.xcodeproj/project.pbxproj @@ -1128,7 +1128,7 @@ "@executable_path/Frameworks", ); MACH_O_TYPE = mh_execute; - MARKETING_VERSION = 1.3.1; + MARKETING_VERSION = 1.3.2; PRODUCT_BUNDLE_IDENTIFIER = com.mouredev.Twitimer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -1154,7 +1154,7 @@ "@executable_path/Frameworks", ); MACH_O_TYPE = mh_execute; - MARKETING_VERSION = 1.3.1; + MARKETING_VERSION = 1.3.2; PRODUCT_BUNDLE_IDENTIFIER = com.mouredev.Twitimer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0;