From 0d43cb0bd8e90a00f09853bc919c97ed36cecff2 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Wed, 7 Sep 2022 08:29:13 -0400 Subject: [PATCH] Prep for iOS 16 (#223) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Don’t render spacer in iOS 16+ * Bump version and build for TestFlight * Bump version and build of action extension * Run SwiftLint on all files for each build This prevents a build warning in Xcode 14 because SwiftLint doesn’t yet support input/output files for these script execution build phases. It’s fast enough, so running it on all files isn’t an issue. * Add missing error handling on login view * Clean up line_length warning * Update change log --- CHANGELOG.md | 2 ++ Shared/Account/AccountLoginView.swift | 10 ++++++++++ Shared/PostList/PostListView.swift | 8 +++++--- .../project.pbxproj | 20 ++++++++++--------- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e583c8..b5d8730 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Mac] Fixed a potential crash if the system keychain wasn't available at app launch. - [Mac] Cleaned up some straggling project warnings. - [Mac] Improved error-handling under the hood for better app stability. +- [iOS/Mac] Fixed a bug where the new-post button doesn't appear in the iOS 16 beta. +- [iOS/Mac] Fixed a bug where alerts weren't presented for login errors. ## [1.0.10-ios] - 2022-07-28 diff --git a/Shared/Account/AccountLoginView.swift b/Shared/Account/AccountLoginView.swift index 64e7971..de0390b 100644 --- a/Shared/Account/AccountLoginView.swift +++ b/Shared/Account/AccountLoginView.swift @@ -88,6 +88,16 @@ struct AccountLoginView: View { .padding() } } + .onChange(of: model.hasError) { value in + if value { + if let error = model.currentError { + self.errorHandling.handle(error: error) + } else { + self.errorHandling.handle(error: AppError.genericError()) + } + model.hasError = false + } + } } } diff --git a/Shared/PostList/PostListView.swift b/Shared/PostList/PostListView.swift index c1bb662..dbeb16b 100644 --- a/Shared/PostList/PostListView.swift +++ b/Shared/PostList/PostListView.swift @@ -37,10 +37,12 @@ struct PostListView: View { ) .toolbar { ToolbarItem(placement: .primaryAction) { - // We have to add a Spacer as a sibling view to the Button in some kind of Stack, so that any - // a11y modifiers are applied as expected: bug report filed as FB8956392. ZStack { - Spacer() + // We have to add a Spacer as a sibling view to the Button in some kind of Stack so that any + // a11y modifiers are applied as expected: bug report filed as FB8956392. + if #unavailable(iOS 16) { + Spacer() + } Button(action: { let managedPost = model.editor.generateNewLocalPost(withFont: model.preferences.font) withAnimation { diff --git a/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj b/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj index 16f3fd8..796445f 100644 --- a/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj +++ b/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -849,6 +849,7 @@ /* Begin PBXShellScriptBuildPhase section */ 17DF32C424C87E6700BCE2E3 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -866,6 +867,7 @@ }; 17DF32C524C87FDB00BCE2E3 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -1052,7 +1054,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_ENTITLEMENTS = "ActionExtension-iOS/ActionExtension-iOS.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 673; + CURRENT_PROJECT_VERSION = 674; DEVELOPMENT_TEAM = TPPAB4YBA6; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "ActionExtension-iOS/Info.plist"; @@ -1064,7 +1066,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.10; + MARKETING_VERSION = 1.0.11; PRODUCT_BUNDLE_IDENTIFIER = "com.abunchtell.WriteFreely-MultiPlatform.ActionExtension-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1083,7 +1085,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_ENTITLEMENTS = "ActionExtension-iOS/ActionExtension-iOS.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 673; + CURRENT_PROJECT_VERSION = 674; DEVELOPMENT_TEAM = TPPAB4YBA6; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "ActionExtension-iOS/Info.plist"; @@ -1095,7 +1097,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.10; + MARKETING_VERSION = 1.0.11; PRODUCT_BUNDLE_IDENTIFIER = "com.abunchtell.WriteFreely-MultiPlatform.ActionExtension-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1226,7 +1228,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "WriteFreely-MultiPlatform (iOS).entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 673; + CURRENT_PROJECT_VERSION = 674; DEVELOPMENT_TEAM = TPPAB4YBA6; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iOS/Info.plist; @@ -1235,7 +1237,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.10; + MARKETING_VERSION = 1.0.11; PRODUCT_BUNDLE_IDENTIFIER = "com.abunchtell.WriteFreely-MultiPlatform"; PRODUCT_NAME = "WriteFreely-MultiPlatform"; SDKROOT = iphoneos; @@ -1252,7 +1254,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "WriteFreely-MultiPlatform (iOS).entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 673; + CURRENT_PROJECT_VERSION = 674; DEVELOPMENT_TEAM = TPPAB4YBA6; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = iOS/Info.plist; @@ -1261,7 +1263,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.10; + MARKETING_VERSION = 1.0.11; PRODUCT_BUNDLE_IDENTIFIER = "com.abunchtell.WriteFreely-MultiPlatform"; PRODUCT_NAME = "WriteFreely-MultiPlatform"; SDKROOT = iphoneos;