Skip to content

Commit

Permalink
fix: innerView와 viewModel 간의 사이클 없앰
Browse files Browse the repository at this point in the history
  • Loading branch information
JYPjoy committed Mar 5, 2024
1 parent 9fec9f2 commit acea3b2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Waving-iOS/Presentation/Friends/View/FriendsAddView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import UIKit
import Combine

class FriendsAddView: UIView, SnapKitInterface {
final class FriendsAddView: UIView, SnapKitInterface {

var viewModel: FriendsViewModelRepresentable?
weak var viewModel: FriendsViewModelRepresentable?

private let containerView: UIView = {
let view = UIView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import UIKit
import Combine

class FriendsDisconnectView: UIView, SnapKitInterface {
final class FriendsDisconnectView: UIView, SnapKitInterface {

var viewModel: FriendsViewModelRepresentable?
weak var viewModel: FriendsViewModelRepresentable?

private let containerView: UIView = {
let view = UIView()
Expand Down
4 changes: 2 additions & 2 deletions Waving-iOS/Presentation/Friends/View/FriendsIntroView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import UIKit
import Combine

class FriendsIntroView: UIView, SnapKitInterface {
final class FriendsIntroView: UIView, SnapKitInterface {

var viewModel: FriendsViewModelRepresentable?
weak var viewModel: FriendsViewModelRepresentable?

private let containerView: UIView = {
let view = UIView()
Expand Down
2 changes: 1 addition & 1 deletion Waving-iOS/Presentation/Friends/View/FriendsListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Combine

final class FriendsListView: UIView, SnapKitInterface {

var viewModel: FriendsViewModelRepresentable?
weak var viewModel: FriendsViewModelRepresentable?
private var friendsList = [GetFriendsEntity]()

let scrollView = UIScrollView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protocol FriendViewRepresentable where Self: UIView {
func setup(with viewModel: FriendsViewModelRepresentable, with friendsList: [GetFriendsEntity])
}

protocol FriendsViewModelRepresentable {
protocol FriendsViewModelRepresentable: AnyObject {
func addFriends()
func didTapBackButton()
func didTapProfile()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final class FriendsViewController: UIViewController, SnapKitInterface {
return view
}()

private var innerView: FriendViewRepresentable?
private weak var innerView: FriendViewRepresentable?

override func viewDidLoad() {
addComponents()
Expand All @@ -59,7 +59,7 @@ final class FriendsViewController: UIViewController, SnapKitInterface {
binding()
}

deinit {
override func viewDidDisappear(_ animated: Bool) {
innerView?.removeFromSuperview()
}

Expand Down

0 comments on commit acea3b2

Please sign in to comment.