Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions SOOUM/SOOUM.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3942,7 +3942,7 @@
CODE_SIGN_ENTITLEMENTS = "SOOUM/Resources/SOOUM-Dev.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 201020;
CURRENT_PROJECT_VERSION = 201030;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 99FRG743RX;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -3966,7 +3966,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.1.2;
MARKETING_VERSION = 2.1.3;
OTHER_SWIFT_FLAGS = "$(inherited) -D DEVELOP";
PRODUCT_BUNDLE_IDENTIFIER = com.sooum.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -3995,7 +3995,7 @@
CODE_SIGN_ENTITLEMENTS = "SOOUM/Resources/SOOUM-Dev.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 201020;
CURRENT_PROJECT_VERSION = 201030;
DEVELOPMENT_TEAM = 99FRG743RX;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "SOOUM/Resources/Develop/Info-dev.plist";
Expand All @@ -4018,7 +4018,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.1.2;
MARKETING_VERSION = 2.1.3;
OTHER_SWIFT_FLAGS = "$(inherited) -D DEVELOP";
PRODUCT_BUNDLE_IDENTIFIER = com.sooum.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -4234,7 +4234,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "SOOUM/Resources//SOOUM.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 201020;
CURRENT_PROJECT_VERSION = 201030;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 99FRG743RX;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -4257,7 +4257,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.1.2;
MARKETING_VERSION = 2.1.3;
OTHER_SWIFT_FLAGS = "$(inherited) -D PRODUCTION";
PRODUCT_BUNDLE_IDENTIFIER = com.sooum.prod;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -4284,7 +4284,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "SOOUM/Resources//SOOUM.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 201020;
CURRENT_PROJECT_VERSION = 201030;
DEVELOPMENT_TEAM = 99FRG743RX;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "SOOUM/Resources/Production/Info-prod.plist";
Expand All @@ -4306,7 +4306,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.1.2;
MARKETING_VERSION = 2.1.3;
OTHER_SWIFT_FLAGS = "$(inherited) -D PRODUCTION";
PRODUCT_BUNDLE_IDENTIFIER = com.sooum.prod;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,17 @@ class SOMPageViews: UIView {
func setModels(_ models: [SOMPageModel]) {

self.indicatorContainer.arrangedSubviews.forEach { $0.removeFromSuperview() }
for index in 0..<models.count {
let indicator = UIView().then {
$0.backgroundColor = index == 0 ? .som.v2.gray600 : .som.v2.gray300
$0.layer.cornerRadius = 4 * 0.5
}
self.indicatorContainer.addArrangedSubview(indicator)
indicator.snp.makeConstraints {
$0.width.equalTo(index == 0 ? 8 : 4)
$0.height.equalTo(4)
if models.count > 1 {
for index in 0..<models.count {
let indicator = UIView().then {
$0.backgroundColor = index == 0 ? .som.v2.gray600 : .som.v2.gray300
$0.layer.cornerRadius = 4 * 0.5
}
self.indicatorContainer.addArrangedSubview(indicator)
indicator.snp.makeConstraints {
$0.width.equalTo(index == 0 ? 8 : 4)
$0.height.equalTo(4)
}
}
}

Expand Down Expand Up @@ -310,6 +312,8 @@ extension SOMPageViews: UICollectionViewDelegateFlowLayout {

private func infiniteScroll(_ scrollView: UIScrollView) {

guard self.models.count > 1 else { return }

let cellWidth: CGFloat = scrollView.bounds.width
let currentIndex: Int = Int(round(scrollView.contentOffset.x / cellWidth))

Expand Down
13 changes: 1 addition & 12 deletions SOOUM/SOOUM/Domain/Models/NoticeInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

struct NoticeInfo {
struct NoticeInfo: Hashable {

let id: String
let noticeType: NoticeType
Expand Down Expand Up @@ -69,17 +69,6 @@ extension NoticeInfo {
)
}

extension NoticeInfo: Hashable {

static func == (lhs: NoticeInfo, rhs: NoticeInfo) -> Bool {
return lhs.id == rhs.id
}

func hash(into hasher: inout Hasher) {
hasher.combine(self.id)
}
}

extension NoticeInfo: Decodable {

enum CodingKeys: String, CodingKey {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,17 +634,18 @@ extension DetailViewController: UICollectionViewDataSource {

cell.tags.tagDidTap
.throttle(.seconds(3), scheduler: MainScheduler.instance)
.do(onNext: {
GAHelper.shared.logEvent(
event: GAEvent.DetailView.cardDetailTag_btnClick(tag_name: $0.text)
)
})
.subscribe(with: self) { object, tagInfo in
let tagCollectViewController = TagCollectViewController()
tagCollectViewController.reactor = reactor.reactorForTagCollect(
with: tagInfo.id,
title: tagInfo.text
)
object.navigationPush(tagCollectViewController, animated: true) { _ in
GAHelper.shared.logEvent(
event: GAEvent.DetailView.cardDetailTag_btnClick(tag_name: tagInfo.text)
)
}
object.navigationPush(tagCollectViewController, animated: true)
}
.disposed(by: cell.disposeBag)

Expand Down Expand Up @@ -675,20 +676,20 @@ extension DetailViewController: UICollectionViewDataSource {
} else {

if prevCardInfo.isPrevCardDeleted {
reactor.action.onNext(.cleanup)

GAHelper.shared.logEvent(
event: GAEvent.DetailView.cardDetail_tracePathClick(
previous_path: .detail
)
)

let detailViewController = DetailViewController()
detailViewController.reactor = reactor.reactorForPush(
prevCardInfo.prevCardId,
hasDeleted: true
)
object.navigationPush(detailViewController, animated: true) { _ in
reactor.action.onNext(.cleanup)

GAHelper.shared.logEvent(
event: GAEvent.DetailView.cardDetail_tracePathClick(
previous_path: .detail
)
)
}
object.navigationPush(detailViewController, animated: true)
} else {
reactor.action.onNext(.willPushToDetail(prevCardInfo.prevCardId))
}
Expand Down Expand Up @@ -718,6 +719,7 @@ extension DetailViewController: UICollectionViewDataSource {
guard let reactor = self.reactor else { return footer }

footer.didTap
.throttle(.seconds(3), scheduler: MainScheduler.instance)
.subscribe(with: self) { object, selectedId in
let viewController = DetailViewController()
viewController.reactor = reactor.reactorForPush(selectedId)
Expand Down
88 changes: 46 additions & 42 deletions SOOUM/SOOUM/Presentations/Main/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,24 @@ class HomeViewController: BaseNavigationViewController, View {
#endif
}

override func setupConstraints() {
super.setupConstraints()

self.view.addSubview(self.tableView)
self.tableView.snp.makeConstraints {
$0.top.equalTo(self.view.safeAreaLayoutGuide.snp.top)
$0.bottom.horizontalEdges.equalToSuperview()
}

self.view.addSubview(self.headerContainer)
self.headerContainer.snp.makeConstraints {
self.headerViewContainerTopConstraint = $0.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).priority(.high).constraint
$0.horizontalEdges.equalToSuperview()
}
self.headerContainer.addArrangedSubview(self.stickyTabBar)
self.headerContainer.addArrangedSubview(self.distanceFilterView)
}

override func setupNaviBar() {
super.setupNaviBar()

Expand All @@ -277,22 +295,10 @@ class HomeViewController: BaseNavigationViewController, View {
self.navigationBar.setRightButtons([self.rightAlamButton])
}

override func setupConstraints() {
super.setupConstraints()

self.view.addSubview(self.tableView)
self.tableView.snp.makeConstraints {
$0.top.equalTo(self.view.safeAreaLayoutGuide.snp.top)
$0.bottom.horizontalEdges.equalToSuperview()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

self.view.addSubview(self.headerContainer)
self.headerContainer.snp.makeConstraints {
self.headerViewContainerTopConstraint = $0.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).priority(.high).constraint
$0.horizontalEdges.equalToSuperview()
}
self.headerContainer.addArrangedSubview(self.stickyTabBar)
self.headerContainer.addArrangedSubview(self.distanceFilterView)
self.view.isUserInteractionEnabled = true
}


Expand Down Expand Up @@ -670,6 +676,8 @@ private extension HomeViewController {
style: .primary,
action: {
SOMDialogViewController.dismiss {
self.view.isUserInteractionEnabled = true

reactor.action.onNext(.cleanup)

reactor.action.onNext(
Expand Down Expand Up @@ -765,55 +773,51 @@ extension HomeViewController: UITableViewDelegate {
let reactor = self.reactor
else { return }

var isPunged: Bool {
switch item {
case let .latest(selectedCard):
guard let expireAt = selectedCard.storyExpirationTime else { return false }
return expireAt < Date()
case let .popular(selectedCard):
guard let expireAt = selectedCard.storyExpirationTime else { return false }
return expireAt < Date()
case let .distance(selectedCard):
guard let expireAt = selectedCard.storyExpirationTime else { return false }
return expireAt < Date()
case .empty:
return false
}
}

var selectedId: String? {
switch item {
case let .latest(selectedCard):
return selectedCard.id
case let .popular(selectedCard):
return selectedCard.id
case let .distance(selectedCard):
case let .latest(selectedCard),
let .popular(selectedCard),
let .distance(selectedCard):

return selectedCard.id
case .empty:
return nil
}
}

guard let selectedId = selectedId else { return }

var isPunged: Bool {
switch item {
case let .latest(selectedCard),
let .popular(selectedCard),
let .distance(selectedCard):

guard let expireAt = selectedCard.storyExpirationTime else { return false }
return expireAt < Date()
case .empty:
return false
}
}
guard isPunged == false else {
self.showPungedCardDialog(reactor, with: selectedId)
return
}

var isEventCard: Bool {
switch item {
case let .latest(selectedCard):
return selectedCard.cardImgName.contains(Text.eventCardTitle)
case let .popular(selectedCard):
return selectedCard.cardImgName.contains(Text.eventCardTitle)
case let .distance(selectedCard):
case let .latest(selectedCard),
let .popular(selectedCard),
let .distance(selectedCard):

return selectedCard.cardImgName.contains(Text.eventCardTitle)
case .empty:
return false
}
}

// 화면 전환 전 사용자 행동 방지
self.view.isUserInteractionEnabled = false

reactor.action.onNext(.hasDetailCard(selectedId, isEventCard))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ class NotificationViewController: BaseNavigationViewController, View {
self.navigationBar.title = Text.navigationTitle
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

self.view.isUserInteractionEnabled = true
}

override func setupConstraints() {
super.setupConstraints()

Expand Down Expand Up @@ -327,6 +333,8 @@ private extension NotificationViewController {
style: .primary,
action: {
SOMDialogViewController.dismiss {
self.view.isUserInteractionEnabled = true

reactor.action.onNext(.cleanup)

reactor.action.onNext(.updateNotifications)
Expand Down Expand Up @@ -366,6 +374,8 @@ extension NotificationViewController: UITableViewDelegate {
switch notification {
case let .default(notification):

self.view.isUserInteractionEnabled = false

reactor.action.onNext(
.hasDetailCard(
selectedId: notification.targetCardId,
Expand All @@ -374,6 +384,8 @@ extension NotificationViewController: UITableViewDelegate {
)
case let .tag(notification):

self.view.isUserInteractionEnabled = false

reactor.action.onNext(
.hasDetailCard(
selectedId: notification.targetCardId,
Expand All @@ -395,6 +407,8 @@ extension NotificationViewController: UITableViewDelegate {
switch notification {
case let .default(notification):

self.view.isUserInteractionEnabled = false

reactor.action.onNext(
.hasDetailCard(
selectedId: notification.targetCardId,
Expand All @@ -403,6 +417,8 @@ extension NotificationViewController: UITableViewDelegate {
)
case let .tag(notification):

self.view.isUserInteractionEnabled = false

reactor.action.onNext(
.hasDetailCard(
selectedId: notification.targetCardId,
Expand Down
Loading