Skip to content

[fix] addAction 순환참조#168

Open
H0sungKim wants to merge 2 commits intodevelopfrom
fix/#166-add-action
Open

[fix] addAction 순환참조#168
H0sungKim wants to merge 2 commits intodevelopfrom
fix/#166-add-action

Conversation

@H0sungKim
Copy link
Copy Markdown
Contributor

🎯 Related Issues

📋 Description

extension UIAction {
    public convenience init<T: AnyObject>(
        weak target: T,
        handler: @escaping @Sendable (T) -> @Sendable (UIAction) -> Void
    ) {
        self.init { [weak target] action in
            guard let target else { return }
            handler(target)(action)
        }
    }
}
  • function에서도 self capture되는데 그걸 그냥 클로저 인자로 전달해버려서 순환참조 생기는 것 위 코드로 해결했습니다.

💬 To Reviewers

@H0sungKim H0sungKim requested review from rosejinse and soeun11 April 21, 2026 13:30
@H0sungKim H0sungKim self-assigned this Apr 21, 2026
@H0sungKim H0sungKim added the 호성 🐙 김호성 label Apr 21, 2026
@H0sungKim H0sungKim linked an issue Apr 21, 2026 that may be closed by this pull request
1 task
Copy link
Copy Markdown
Contributor

@soeun11 soeun11 left a comment

Choose a reason for hiding this comment

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

무한 .. 위크셀프 .. 수고햇어요~~

// UIAction+.swift
// Presentation
//
// Created by 루미씨티 on 4/14/26.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

누군데 회사에서햇짘ㅋㅋㅋㅋ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] addAction 메모리 순환참조

2 participants