Skip to content

Commit

Permalink
fix: 키보드 appear에 따른 transform 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
taipaise committed Dec 2, 2024
1 parent b10a0de commit bfc892a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,16 @@ public final class WhiteboardViewController: UIViewController {

@objc private func keyBoardWillAppear(_ sender: Notification) {
guard
let keyBoardFrame = sender.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue
let keyBoardFrame = sender.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue,
let selectedObjectView
else { return }

let keyboardHeight = keyBoardFrame.cgRectValue.height
let selectedObjectViewFrame = selectedObjectView.convert(selectedObjectView.bounds, to: view)

canvasView.transform = CGAffineTransform(translationX: 0, y: -keyboardHeight)
if selectedObjectViewFrame.midY > view.bounds.midY {
canvasView.transform = CGAffineTransform(translationX: 0, y: -keyboardHeight)
}
}

@objc private func keyBoardWillDisappear(_ sender: Notification) {
Expand Down

0 comments on commit bfc892a

Please sign in to comment.