Skip to content

Commit

Permalink
Bug Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakr233 committed Apr 2, 2023
1 parent 5cacd9c commit 91e2b74
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Kimis.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@
CODE_SIGN_ENTITLEMENTS = Kimis/Kimis.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 100;
CURRENT_PROJECT_VERSION = 111;
DEVELOPMENT_TEAM = 6CMYQQFFT8;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1879,7 +1879,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.10;
MARKETING_VERSION = 1.11;
PRODUCT_BUNDLE_IDENTIFIER = wiki.qaq.kimis.inhouse;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand All @@ -1900,7 +1900,7 @@
CODE_SIGN_ENTITLEMENTS = Kimis/Kimis.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 100;
CURRENT_PROJECT_VERSION = 111;
DEVELOPMENT_TEAM = 6CMYQQFFT8;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1918,7 +1918,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.10;
MARKETING_VERSION = 1.11;
PRODUCT_BUNDLE_IDENTIFIER = as.wiki.qaq.kimis;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion Kimis/Interface/Component/NoteView/NotePreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class NotePreview: UIView {
// # line 325, reason icon height = text height
static let hintTextLimit = 1 // <- must be 1
static let userTextLimit = 2
static let mainTextLimit = 8
static let mainTextLimit = 12
static let verticalSpacing: CGFloat = 8
static let defaultAvatarSize: CGFloat = 54
static let smallerAvatarSize: CGFloat = 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Combine
import IQKeyboardManagerSwift
import Source
import UIKit
import UniformTypeIdentifiers
Expand Down Expand Up @@ -173,6 +174,19 @@ class PostEditorController: ViewController, UIScrollViewDelegate, UIDropInteract
view.addSubview(toolbar)

updateSendButtonAvailability()

NotificationCenter.default.addObserver(
self,
selector: #selector(keyboardWillShow(notification:)),
name: UIResponder.keyboardWillShowNotification,
object: nil
)
NotificationCenter.default.addObserver(
self,
selector: #selector(keyboardWillHide(notification:)),
name: UIResponder.keyboardWillHideNotification,
object: nil
)
}

override func viewWillLayoutSubviews() {
Expand Down Expand Up @@ -283,7 +297,9 @@ class PostEditorController: ViewController, UIScrollViewDelegate, UIDropInteract
renotePreview.isHidden = true
}

container.contentSize = CGSize(width: 0, height: heightAnchor + 50)
container.contentSize = (keyboardVisible && IQKeyboardManager.shared.keyboardFrame.height > 0)
? CGSize(width: 0, height: heightAnchor + 50 + IQKeyboardManager.shared.keyboardFrame.height)
: CGSize(width: 0, height: heightAnchor + 50)
}

func updateSendButtonAvailability() {
Expand Down Expand Up @@ -314,6 +330,14 @@ class PostEditorController: ViewController, UIScrollViewDelegate, UIDropInteract
}
}

@objc func keyboardWillShow(notification _: NSNotification) {
keyboardVisible = true
}

@objc func keyboardWillHide(notification _: NSNotification) {
keyboardVisible = false
}

@objc func cancelButtonTapped() {
if editor.post == .init() {
dismiss(animated: true)
Expand Down

0 comments on commit 91e2b74

Please sign in to comment.