Skip to content

Commit 1b75950

Browse files
Revert "Set the post editor font in the updateUIView method (#237)" (#240)
This reverts commit d46eb63.
1 parent 9b2a849 commit 1b75950

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4646
- [Mac] Fixed a bug where alerts weren't presented for login errors.
4747
- [Mac] Fixed some build warnings in the project.
4848
- [Mac] Bumped WriteFreely package to v0.3.6 to handle decoding of fractional seconds in dates.
49-
- [iOS] Fixed a bug where posts were always shown in serif, even if the post was published with another font.
5049

5150
## [1.0.13-ios] - 2022-11-13
5251

WriteFreely-MultiPlatform.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@
10501050
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
10511051
CODE_SIGN_ENTITLEMENTS = "ActionExtension-iOS/ActionExtension-iOS.entitlements";
10521052
CODE_SIGN_STYLE = Automatic;
1053-
CURRENT_PROJECT_VERSION = 693;
1053+
CURRENT_PROJECT_VERSION = 691;
10541054
DEVELOPMENT_TEAM = TPPAB4YBA6;
10551055
GENERATE_INFOPLIST_FILE = YES;
10561056
INFOPLIST_FILE = "ActionExtension-iOS/Info.plist";
@@ -1081,7 +1081,7 @@
10811081
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
10821082
CODE_SIGN_ENTITLEMENTS = "ActionExtension-iOS/ActionExtension-iOS.entitlements";
10831083
CODE_SIGN_STYLE = Automatic;
1084-
CURRENT_PROJECT_VERSION = 693;
1084+
CURRENT_PROJECT_VERSION = 691;
10851085
DEVELOPMENT_TEAM = TPPAB4YBA6;
10861086
GENERATE_INFOPLIST_FILE = YES;
10871087
INFOPLIST_FILE = "ActionExtension-iOS/Info.plist";
@@ -1224,7 +1224,7 @@
12241224
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
12251225
CODE_SIGN_ENTITLEMENTS = "WriteFreely-MultiPlatform (iOS).entitlements";
12261226
CODE_SIGN_STYLE = Automatic;
1227-
CURRENT_PROJECT_VERSION = 693;
1227+
CURRENT_PROJECT_VERSION = 691;
12281228
DEVELOPMENT_TEAM = TPPAB4YBA6;
12291229
ENABLE_PREVIEWS = YES;
12301230
INFOPLIST_FILE = iOS/Info.plist;
@@ -1250,7 +1250,7 @@
12501250
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
12511251
CODE_SIGN_ENTITLEMENTS = "WriteFreely-MultiPlatform (iOS).entitlements";
12521252
CODE_SIGN_STYLE = Automatic;
1253-
CURRENT_PROJECT_VERSION = 693;
1253+
CURRENT_PROJECT_VERSION = 691;
12541254
DEVELOPMENT_TEAM = TPPAB4YBA6;
12551255
ENABLE_PREVIEWS = YES;
12561256
INFOPLIST_FILE = iOS/Info.plist;

iOS/PostEditor/MultilineTextView.swift

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ private struct UITextViewWrapper: UIViewRepresentable {
1717
textField.delegate = context.coordinator
1818

1919
textField.isEditable = true
20+
textField.font = UIFont.preferredFont(forTextStyle: .body)
2021
textField.isSelectable = true
2122
textField.isUserInteractionEnabled = true
2223
textField.isScrollEnabled = false
2324
textField.backgroundColor = UIColor.clear
2425
textField.smartDashesType = .no
2526

27+
let font = textStyle
28+
let fontMetrics = UIFontMetrics(forTextStyle: .largeTitle)
29+
textField.font = fontMetrics.scaledFont(for: font)
30+
2631
if nil != onDone {
2732
textField.returnKeyType = .next
2833
}
@@ -36,14 +41,8 @@ private struct UITextViewWrapper: UIViewRepresentable {
3641
uiView.text = self.text
3742
}
3843

39-
let font = textStyle
40-
let fontMetrics = UIFontMetrics(forTextStyle: .largeTitle)
41-
uiView.font = fontMetrics.scaledFont(for: font)
42-
43-
if uiView.window != nil && isEditing {
44-
DispatchQueue.main.async {
45-
uiView.becomeFirstResponder()
46-
}
44+
if uiView.window != nil, isEditing {
45+
uiView.becomeFirstResponder()
4746
}
4847

4948
UITextViewWrapper.recalculateHeight(view: uiView, result: $calculatedHeight)

0 commit comments

Comments
 (0)