Skip to content

Commit 884da07

Browse files
Prepare release v1.0.11 for iOS (#225)
* Add error handling to Mac app * Log fatal crashes and present alert on next launch * Update crash alert copy and navigate to help forum * Refactor logging into reuseable methods * Refactor class to use protocol * Add environment object to settings window * Improve deactivation of app when miniaturizing * Chagne dispatch type when creating new post * Bump version and build number * Remove unnecessary TODO comment * Update change log * Log fatal crashes and present alert on next launch * Update crash alert copy and navigate to help forum * Refactor logging into reuseable methods * Add environment object to settings window * Improve deactivation of app when miniaturizing * Chagne dispatch type when creating new post * Improve default window size (#220) * Clean up unnecessary import * Set idealWidth property on sidebars * Unset selected post on collection change (#218) * Unset selected post when changing collection * Update change log * Bump build number and update change log
1 parent 0d43cb0 commit 884da07

File tree

6 files changed

+32
-18
lines changed

6 files changed

+32
-18
lines changed

CHANGELOG.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3737
- [Mac] Fixed a potential crash if the system keychain wasn't available at app launch.
3838
- [Mac] Cleaned up some straggling project warnings.
3939
- [Mac] Improved error-handling under the hood for better app stability.
40-
- [iOS/Mac] Fixed a bug where the new-post button doesn't appear in the iOS 16 beta.
41-
- [iOS/Mac] Fixed a bug where alerts weren't presented for login errors.
40+
- [Mac] Selecting another collection while a blank draft is in the editor now works as expected.
41+
- [Mac] Fixed a bug where the new-post button doesn't appear in the iOS 16 beta.
42+
- [Mac] Fixed a bug where the list of posts published outside of a blog didn't update its title (Drafts/Anonymous).
43+
- [Mac] Fixed a bug where alerts weren't presented for login errors.
44+
- [Mac] Fixed some build warnings in the project.
45+
46+
## [1.0.11-ios] - 2022-09-07
47+
48+
- [iOS] Fixed a bug where the new-post button doesn't appear in the iOS 16 beta.
49+
- [iOS] Fixed a bug where the list of posts published outside of a blog didn't update its title (Drafts/Anonymous).
50+
- [iOS] Fixed a bug where alerts weren't presented for login errors.
51+
- [iOS] Fixed some build warnings in the project.
4252

4353
## [1.0.10-ios] - 2022-07-28
4454

@@ -277,7 +287,8 @@ suffixes to differentiate between platforms, until both are at feature parity.
277287
- Contributing guide
278288
- This changelog
279289

280-
[Unreleased]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.10-ios...HEAD
290+
[Unreleased]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.11-ios...HEAD
291+
[1.0.11-ios]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.10-ios...v1.0.11-ios
281292
[1.0.10-ios]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.9-ios...v1.0.10-ios
282293
[1.0.9-ios]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.8-ios...v1.0.9-ios
283294
[1.0.8-ios]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.7-ios...v1.0.8-ios

Shared/Navigation/ContentView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ struct ContentView: View {
2828
// Create the new-post managed object
2929
let managedPost = model.editor.generateNewLocalPost(withFont: model.preferences.font)
3030
withAnimation {
31-
DispatchQueue.main.asyncAfter(deadline: .now()) {
31+
DispatchQueue.main.async {
3232
// Load the new post in the editor
3333
self.model.selectedPost = managedPost
3434
}
3535
}
3636
}, label: { Image(systemName: "square.and.pencil") })
3737
.help("Create a new local draft.")
3838
}
39+
.frame(idealWidth: 200)
3940
#else
4041
CollectionListView()
4142
.withErrorHandling()
@@ -45,6 +46,7 @@ struct ContentView: View {
4546
ZStack {
4647
PostListView(selectedCollection: model.selectedCollection, showAllPosts: model.showAllPosts)
4748
.withErrorHandling()
49+
.frame(idealWidth: 300)
4850
if model.isProcessingRequest {
4951
ZStack {
5052
Color(NSColor.controlBackgroundColor).opacity(0.75)

Shared/PostCollection/CollectionListView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ struct CollectionListView: View {
3333
)
3434
.listStyle(SidebarListStyle())
3535
.onChange(of: model.selectedCollection) { collection in
36+
model.selectedPost = nil
3637
if collection != model.editor.fetchSelectedCollectionFromAppStorage() {
3738
self.model.editor.selectedCollectionURL = collection?.objectID.uriRepresentation()
3839
}
3940
}
4041
.onChange(of: model.showAllPosts) { value in
42+
model.selectedPost = nil
4143
if value != model.editor.showAllPostsFlag {
4244
self.model.editor.showAllPostsFlag = model.showAllPosts
4345
}

Shared/WriteFreely_MultiPlatformApp.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ struct WriteFreely_MultiPlatformApp: App {
135135
}
136136
.tag(2)
137137
}
138+
.environmentObject(model)
138139
.withErrorHandling()
139140
.frame(minWidth: 500, maxWidth: 500, minHeight: 200)
140141
.padding()

WriteFreely-MultiPlatform.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@
10541054
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
10551055
CODE_SIGN_ENTITLEMENTS = "ActionExtension-iOS/ActionExtension-iOS.entitlements";
10561056
CODE_SIGN_STYLE = Automatic;
1057-
CURRENT_PROJECT_VERSION = 674;
1057+
CURRENT_PROJECT_VERSION = 676;
10581058
DEVELOPMENT_TEAM = TPPAB4YBA6;
10591059
GENERATE_INFOPLIST_FILE = YES;
10601060
INFOPLIST_FILE = "ActionExtension-iOS/Info.plist";
@@ -1085,7 +1085,7 @@
10851085
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
10861086
CODE_SIGN_ENTITLEMENTS = "ActionExtension-iOS/ActionExtension-iOS.entitlements";
10871087
CODE_SIGN_STYLE = Automatic;
1088-
CURRENT_PROJECT_VERSION = 674;
1088+
CURRENT_PROJECT_VERSION = 676;
10891089
DEVELOPMENT_TEAM = TPPAB4YBA6;
10901090
GENERATE_INFOPLIST_FILE = YES;
10911091
INFOPLIST_FILE = "ActionExtension-iOS/Info.plist";
@@ -1228,7 +1228,7 @@
12281228
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
12291229
CODE_SIGN_ENTITLEMENTS = "WriteFreely-MultiPlatform (iOS).entitlements";
12301230
CODE_SIGN_STYLE = Automatic;
1231-
CURRENT_PROJECT_VERSION = 674;
1231+
CURRENT_PROJECT_VERSION = 676;
12321232
DEVELOPMENT_TEAM = TPPAB4YBA6;
12331233
ENABLE_PREVIEWS = YES;
12341234
INFOPLIST_FILE = iOS/Info.plist;
@@ -1254,7 +1254,7 @@
12541254
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
12551255
CODE_SIGN_ENTITLEMENTS = "WriteFreely-MultiPlatform (iOS).entitlements";
12561256
CODE_SIGN_STYLE = Automatic;
1257-
CURRENT_PROJECT_VERSION = 674;
1257+
CURRENT_PROJECT_VERSION = 676;
12581258
DEVELOPMENT_TEAM = TPPAB4YBA6;
12591259
ENABLE_PREVIEWS = YES;
12601260
INFOPLIST_FILE = iOS/Info.plist;
@@ -1282,7 +1282,7 @@
12821282
CODE_SIGN_IDENTITY = "Apple Development";
12831283
CODE_SIGN_STYLE = Automatic;
12841284
COMBINE_HIDPI_IMAGES = YES;
1285-
CURRENT_PROJECT_VERSION = 620;
1285+
CURRENT_PROJECT_VERSION = 676;
12861286
DEVELOPMENT_TEAM = TPPAB4YBA6;
12871287
ENABLE_HARDENED_RUNTIME = YES;
12881288
ENABLE_PREVIEWS = YES;
@@ -1292,7 +1292,7 @@
12921292
"@executable_path/../Frameworks",
12931293
);
12941294
MACOSX_DEPLOYMENT_TARGET = 11.0;
1295-
MARKETING_VERSION = 0.6.0;
1295+
MARKETING_VERSION = 0.7.0;
12961296
PRODUCT_BUNDLE_IDENTIFIER = "com.abunchtell.WriteFreely-MultiPlatform";
12971297
PRODUCT_NAME = "WriteFreely for Mac";
12981298
SDKROOT = macosx;
@@ -1309,7 +1309,7 @@
13091309
CODE_SIGN_IDENTITY = "Apple Development";
13101310
CODE_SIGN_STYLE = Automatic;
13111311
COMBINE_HIDPI_IMAGES = YES;
1312-
CURRENT_PROJECT_VERSION = 620;
1312+
CURRENT_PROJECT_VERSION = 676;
13131313
DEVELOPMENT_TEAM = TPPAB4YBA6;
13141314
ENABLE_HARDENED_RUNTIME = YES;
13151315
ENABLE_PREVIEWS = YES;
@@ -1319,7 +1319,7 @@
13191319
"@executable_path/../Frameworks",
13201320
);
13211321
MACOSX_DEPLOYMENT_TARGET = 11.0;
1322-
MARKETING_VERSION = 0.6.0;
1322+
MARKETING_VERSION = 0.7.0;
13231323
PRODUCT_BUNDLE_IDENTIFIER = "com.abunchtell.WriteFreely-MultiPlatform";
13241324
PRODUCT_NAME = "WriteFreely for Mac";
13251325
SDKROOT = macosx;

macOS/AppDelegate.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Cocoa
2-
import Sparkle
32

43
class AppDelegate: NSObject, NSApplicationDelegate {
54

@@ -15,13 +14,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
1514
}
1615
}
1716

18-
// If we're miniaturizing the window, deactivate it as well by activating Finder.app (note that
19-
// this will bring any Finder windows that are behind other apps to the foreground).
17+
// If we're miniaturizing the window, deactivate it as well.
18+
// Credit to KHKnobl on GitHub:
19+
// https://github.com/writefreely/writefreely-swiftui-multiplatform/issues/135#issuecomment-1101713817
2020
func applicationDidChangeOcclusionState(_ notification: Notification) {
2121
if let window = NSApp.windows.first, window.isMiniaturized {
22-
NSWorkspace.shared.runningApplications.first(where: {
23-
$0.activationPolicy == .regular
24-
})?.activate(options: .activateAllWindows)
22+
NSApp.hide(self)
2523
}
2624
}
2725

0 commit comments

Comments
 (0)