Skip to content

Conversation

@yurim830
Copy link
Collaborator

@yurim830 yurim830 commented Jun 5, 2025

🐿️ Pull Requests

🪵 작업 브랜치

🥔 작업 내용

  • addGlassBorder 메소드 오류 해결
    borderView가 user interaction을 가로채는 문제를 해결했습니다.

  • ACTextField 글래스모피즘용 이니셜라이저를 구현
    -> 업로드뷰 SearchTextField, 프로필편집뷰 TextField에 적용

  • 프로필 편집 관련

    • UI 변경사항을 반영했습니다.
    • 닉네임 유효성 검증 로직을 수정했습니다.
    • API 변경사항 반영했습니다.
      • PATCH patchProfile: 프로필이미지 필드 required -> optional
      • GET nicknameValidit: 엔드포인트 변경

📸 스크린샷

기능 스크린샷
아이폰 16 Pro

💥 To be sure

  • 모든 뷰가 잘 실행되는지 다시 한 번 체크해주세요 !

🌰 Resolve issue

@yurim830 yurim830 requested a review from cirtuare June 5, 2025 17:02
@yurim830 yurim830 self-assigned this Jun 5, 2025
@yurim830 yurim830 added 🍋‍🟩 chore 기타 작업들 🥑 유림 유림 labels Jun 5, 2025
@yurim830 yurim830 added this to the Sprint - 3 milestone Jun 5, 2025
@yurim830 yurim830 changed the title [CHORE] 프로필 편집 2.0 UI 반영 및 닉네임 유효성 검증 로직 수정 [CHORE] 프로필 편집 2.0 UI 반영 및 닉네임 유효성 검증 로직 수정 (#164) Jun 6, 2025
@yurim830 yurim830 added the ⚪️ network 네트워크 연결 label Jun 6, 2025
Copy link
Contributor

@cirtuare cirtuare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

논의가 길어져서 복잡했을 텐데 고생했어요💗!!!!!

// MARK: - UI Properties

private let firstIcon = UIImageView()
private let icon = UIImageView()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐿️
컨벤션에 따라 뒤에 -ImageView 붙여주시면 조금 더 보기 편할 것 같아요 !

Comment on lines 129 to 135
override func layoutSubviews() {
super.layoutSubviews()

if let glassBorderAttribute = glassBorderAttribute {
self.addGlassBorder(glassBorderAttribute)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐿️
여기서 글모 백그라운드 뷰 리프레시는 필요없었나요?!

yurim830 added 2 commits June 7, 2025 02:10
static으로 선언되어, 한 뷰에서 glassBorder를 사용하는 뷰가 2개 이상 있을 때 remove, refresh가 제대로 적용 안 되었음
Copy link
Collaborator Author

@yurim830 yurim830 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 반영했습니다~ @cirtuare
glassBorder도 새로고침이 필요한 걸 발견했는데,
기존 코드로는 한계가 있어서 UIView+ 메소드를 수정했습니다!

Comment on lines +50 to 104
//MARK: - GlassBorder 설정

extension UIView {

private struct AssociatedKeys {
static var glassBorderView: UInt8 = 0
}

private var glassBorderView: GlassmorphismView? {
get {
return objc_getAssociatedObject(self, &AssociatedKeys.glassBorderView) as? GlassmorphismView
}
set {
objc_setAssociatedObject(self, &AssociatedKeys.glassBorderView, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
}

/// 주의: bounds가 0이면 적용 안 됨
func addGlassBorder(_ attributes: GlassBorderAttributes) {
self.layer.borderWidth = 0

glassBorderView?.removeFromSuperview()

let outerPath = UIBezierPath(roundedRect: bounds, cornerRadius: attributes.cornerRadius)
let innerRect = bounds.insetBy(dx: attributes.width, dy: attributes.width)
let innerPath = UIBezierPath(roundedRect: innerRect, cornerRadius: max(0, attributes.cornerRadius - attributes.width/2))
outerPath.append(innerPath.reversing())

UIView.glassBorderView = GlassmorphismView(attributes.glassmorphismType)

self.addSubview(UIView.glassBorderView)
UIView.glassBorderView.snp.makeConstraints {

let newGlassBorderView = GlassmorphismView(attributes.glassmorphismType)
self.glassBorderView = newGlassBorderView

self.addSubview(newGlassBorderView)

newGlassBorderView.snp.makeConstraints {
$0.edges.equalToSuperview()
}

let maskLayer = CAShapeLayer()
maskLayer.path = outerPath.cgPath
maskLayer.fillRule = .evenOdd

let maskView = UIView(frame: bounds)
maskView.layer.addSublayer(maskLayer)
UIView.glassBorderView.mask = maskView
newGlassBorderView.mask = maskView

newGlassBorderView.isUserInteractionEnabled = false
}


func refreshGlassBorder() {
glassBorderView?.refreshBlurEffect()
}

func removeGlassBorder() {
UIView.glassBorderView.removeFromSuperview()
glassBorderView?.removeFromSuperview()
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cirtuare UIView+ GlassBorder 관련 추가 수정 사항 생겼습니다!

기존 코드에서는 glassBorder가 static으로 선언되어서 모든 뷰가 하나의 glassBorderView 인스턴스를 공유했습니다.
따라서 한 뷰에서 2개 이상의 glassBorder가 있을 때 UI 업데이트가 정상적으로 안 되는 문제가 있었습니다.
이에, Associated Object를 활용하여 각 뷰마다 고유한 glassBorderView 인스턴스를 가질 수 있도록 했습니다.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

최고 !!!

@yurim830 yurim830 added the 🍀 refactor 리팩토링 label Jun 6, 2025
@yurim830 yurim830 changed the title [CHORE] 프로필 편집 2.0 UI 반영 및 닉네임 유효성 검증 로직 수정 (#164) [FEAT] 프로필 편집 UI, 닉네임 유효성 로직 수정 / GlassBorder 리팩토링 (#164) Jun 6, 2025
@yurim830 yurim830 merged commit 88199d7 into develop Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍋‍🟩 chore 기타 작업들 ⚪️ network 네트워크 연결 🍀 refactor 리팩토링 🥑 유림 유림

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 프로필 편집 UI, 닉네임 유효성 로직 수정 / GlassBorder 리팩토링

3 participants