Skip to content

Commit

Permalink
[Feat] #360 - didSet 안의 내용 함수로 빼기
Browse files Browse the repository at this point in the history
  • Loading branch information
Heyjooo committed Mar 9, 2024
1 parent 3991562 commit 5d04df0
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions YELLO-iOS/YELLO-iOS/Presentation/Around/View/AroundView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,7 @@ final class AroundView: BaseView {
var scrollCount = 0
var isUserSenderVote = false {
didSet {
if isUserSenderVote {
filterButtonLabel.text = StringLiterals.Around.myYello
filterButtonStackView.spacing = 0
filterButtonStackView.snp.updateConstraints {
$0.leading.equalToSuperview().inset(8.adjustedWidth)
}
aroundEmptyView.emptyDescriptionLabel.setTextWithLineHeight(
text: StringLiterals.Recommending.Empty.timeLineMyTitle,
lineHeight: 24)
} else {
filterButtonLabel.text = StringLiterals.Around.allYello
filterButtonStackView.spacing = 6.adjustedWidth
filterButtonStackView.snp.updateConstraints {
$0.leading.equalToSuperview().inset(20.adjustedWidth)
}
aroundEmptyView.emptyDescriptionLabel.setTextWithLineHeight(
text: StringLiterals.Recommending.Empty.timeLineAllTitle,
lineHeight: 24)
}

self.aroundPage = -1
self.aroundCount = -1
self.isFinishPaging = false
self.fetchingMore = false
self.aroundTableView.reloadData()
self.aroundModelDummy = []
self.around()
self.updateView()
updateAroundView()
}
}

Expand Down Expand Up @@ -221,10 +194,6 @@ final class AroundView: BaseView {
}
}

private func setAroundViewMode() {

}

// MARK: Custom Function
/// 친구가 없을 때 초대 뷰를 띄우는 로직
func updateView() {
Expand All @@ -236,6 +205,37 @@ final class AroundView: BaseView {
}
}

private func updateAroundView() {
if isUserSenderVote {
filterButtonLabel.text = StringLiterals.Around.myYello
filterButtonStackView.spacing = 0
filterButtonStackView.snp.updateConstraints {
$0.leading.equalToSuperview().inset(8.adjustedWidth)
}
aroundEmptyView.emptyDescriptionLabel.setTextWithLineHeight(
text: StringLiterals.Recommending.Empty.timeLineMyTitle,
lineHeight: 24)
} else {
filterButtonLabel.text = StringLiterals.Around.allYello
filterButtonStackView.spacing = 6.adjustedWidth
filterButtonStackView.snp.updateConstraints {
$0.leading.equalToSuperview().inset(20.adjustedWidth)
}
aroundEmptyView.emptyDescriptionLabel.setTextWithLineHeight(
text: StringLiterals.Recommending.Empty.timeLineAllTitle,
lineHeight: 24)
}

self.aroundPage = -1
self.aroundCount = -1
self.isFinishPaging = false
self.fetchingMore = false
self.aroundTableView.reloadData()
self.aroundModelDummy = []
self.around()
self.updateView()
}

// MARK: Objc Function
@objc func refreshTable(refresh: UIRefreshControl) {
self.isRefreshing = true
Expand Down

0 comments on commit 5d04df0

Please sign in to comment.