Skip to content

Commit

Permalink
[Chore/#288] 캐릭터 선톡 뷰 오토레이아웃 코드 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanMinsung committed Nov 17, 2024
1 parent e75aea7 commit 002a8ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ final class ORBCharacterChatView: UIView {

//MARK: - Properties

lazy var characterChatBoxTopConstraint = characterChatBox.topAnchor.constraint(equalTo: topAnchor, constant: 74)
lazy var characterChatBoxBottomConstraint = characterChatBox.bottomAnchor.constraint(equalTo: topAnchor)
lazy var characterChatBoxTopConstraint = characterChatBox.topAnchor.constraint(equalTo: topAnchor)
lazy var userChatViewBottomConstraint = userChatView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: 160)
lazy var userChatInputViewHeightConstraint = userChatInputView.heightAnchor.constraint(equalToConstant: 37)
lazy var userChatDisplayViewHeightConstraint = userChatDisplayView.heightAnchor.constraint(equalToConstant: 24)
Expand Down Expand Up @@ -58,8 +57,8 @@ extension ORBCharacterChatView {
//MARK: - Layout Func

private func setupLayout() {
characterChatBoxTopConstraint.isActive = false
characterChatBoxBottomConstraint.isActive = true
characterChatBoxTopConstraint.constant = -150
characterChatBoxTopConstraint.isActive = true
characterChatBox.snp.makeConstraints { make in
make.horizontalEdges.equalToSuperview().inset(24)
make.height.greaterThanOrEqualTo(58)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ extension ORBCharacterChatViewController {
characterChatBoxPositionAnimator.addAnimations { [weak self] in
guard let self else { return }
self.rootView.characterChatBox.transform = CGAffineTransform.identity
self.rootView.characterChatBoxBottomConstraint.isActive = false
self.rootView.characterChatBoxTopConstraint.isActive = true
self.rootView.characterChatBoxTopConstraint.constant = 74
self.rootView.layoutIfNeeded()
}
characterChatBoxPositionAnimator.startAnimation()
Expand All @@ -206,8 +205,7 @@ extension ORBCharacterChatViewController {
characterChatBoxPositionAnimator.addAnimations { [weak self] in
guard let self else { return }
self.rootView.characterChatBox.transform = CGAffineTransform.identity
self.rootView.characterChatBoxTopConstraint.isActive = false
self.rootView.characterChatBoxBottomConstraint.isActive = true
self.rootView.characterChatBoxTopConstraint.constant = -self.rootView.characterChatBox.frame.height
self.rootView.layoutIfNeeded()
}
characterChatBoxPositionAnimator.startAnimation()
Expand Down

0 comments on commit 002a8ad

Please sign in to comment.