Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
100 changes: 100 additions & 0 deletions FindTown/FindTown.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "B74C263A-C711-4B2F-8BDD-48F8BDDFE8C1"
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>FindTown.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
<key>Rx (Playground) 1.xcscheme</key>
<dict>
Expand All @@ -30,6 +30,27 @@
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>SnapKitPlayground (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>5</integer>
</dict>
<key>SnapKitPlayground (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>6</integer>
</dict>
<key>SnapKitPlayground (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
</dict>
</dict>
</plist>
49 changes: 49 additions & 0 deletions FindTown/FindTown/Domain/Enumerations/EmptyType.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// EmptyType.swift
// FindTown
//
// Created by 장선영 on 2023/12/17.
//

import Foundation

enum EmptyType {
case emptyFavorite
case emptyPlace

var title: String {
switch self {
case .emptyFavorite:
return "찜한 동네가 아직 없어요."
case .emptyPlace:
return "아직 제보된 장소가 없어요."
}
}

var subTitle: String {
switch self {
case .emptyFavorite:
return "나에게 맞는 동네를 찾아서 찜해보세요!"
case .emptyPlace:
return "우리 동네에서 추천할만한 장소가 있다면 \n알려주세요!"
}
}

var iconImage: UIImage {
switch self {
case .emptyFavorite:
return UIImage(named: "emptyIcon") ?? UIImage()
case .emptyPlace:
return UIImage(named: "ic_no place") ?? UIImage()
}
}

var isButtonHidden: Bool {
switch self {
case .emptyFavorite:
return false
case .emptyPlace:
return true
}
}
}
7 changes: 7 additions & 0 deletions FindTown/FindTown/Domain/Enumerations/ThemaCategory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit

enum ThemaCategory: CaseIterable, Category {
case every
case restaurantForEatingAlone
case cafeForStudy

Expand All @@ -17,6 +18,8 @@ enum ThemaCategory: CaseIterable, Category {
return "혼밥하기 좋은 식당"
case .cafeForStudy:
return "카공하기 좋은 카페"
case .every:
return "전체"
}
}

Expand All @@ -26,6 +29,8 @@ enum ThemaCategory: CaseIterable, Category {
return UIImage(named: "thema.restaurant")
case .cafeForStudy:
return UIImage(named: "thema.notebook")
case .every:
return nil
}
}

Expand All @@ -35,6 +40,8 @@ enum ThemaCategory: CaseIterable, Category {
return "001"
case .restaurantForEatingAlone:
return "002"
case .every:
return ""
}
}
}
47 changes: 39 additions & 8 deletions FindTown/FindTown/Presentation/Common/Flow/TabBarCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,50 @@ final class TabBarCoordinator: FlowCoordinator {
let homeCoordinator = HomeCoordinator(presentationStyle: .none,
appDIContainer: appDIContainer)
homeCoordinator.start()
guard let homeViewController = homeCoordinator.navigationController else { return UIViewController() }
homeViewController.tabBarItem = UITabBarItem(title: "동네 찾기", image: UIImage(named: "homeIcon"), tag: 0)
guard let homeViewController = homeCoordinator.navigationController else {
return UIViewController()
}
homeViewController.tabBarItem = UITabBarItem(
title: "동네 찾기",
image: UIImage(named: "homeIcon"),
tag: 0)

/// 지도 탭
let mapCoordinator = MapCoordinator(presentationStyle: .none,
cityCode: nil,
mapTransition: .tapBar,
appDIContainer: appDIContainer)
mapCoordinator.start()
guard let mapViewController = mapCoordinator.navigationController else { return UIViewController() }
mapViewController.tabBarItem = UITabBarItem(title: "동네 지도", image: UIImage(named: "mapIcon"), tag: 1)
guard let mapViewController = mapCoordinator.navigationController else {
return UIViewController()
}
mapViewController.tabBarItem = UITabBarItem(
title: "동네 지도",
image: UIImage(named: "mapIcon"),
tag: 1)

/// 플레이스 탭
let placeCoordinator = PlaceCoordinator(presentationStyle: .none,
appDIContainer: appDIContainer)
placeCoordinator.start()
guard let placeViewController = placeCoordinator.navigationController else {
return UIViewController()
}
placeViewController.tabBarItem = UITabBarItem(
title: "플레이스",
image: UIImage(named: "placeIcon"),
tag: 2)

/// 찜 탭
let favoriteCoordinator = FavoriteCoordinator(presentationStyle: .none,
appDIContainer: appDIContainer)
favoriteCoordinator.start()
guard let favoriteViewController = favoriteCoordinator.navigationController else { return UIViewController() }
favoriteViewController.tabBarItem = UITabBarItem(title: "찜", image: UIImage(named: "favoriteIcon"), tag: 2)
guard let favoriteViewController = favoriteCoordinator.navigationController else { return UIViewController()
}
favoriteViewController.tabBarItem = UITabBarItem(
title: "찜",
image: UIImage(named: "favoriteIcon"),
tag: 2)

let homeVC = homeViewController.viewControllers.first as? HomeViewController
if let favoriteVC = favoriteViewController.viewControllers.first as? FavoriteViewController {
Expand All @@ -57,12 +83,17 @@ final class TabBarCoordinator: FlowCoordinator {
let myPageCoordinator = MyPageCoordinator(presentationStyle: .none,
appDIContainer: appDIContainer)
myPageCoordinator.start()
guard let myPageViewController = myPageCoordinator.navigationController else { return UIViewController() }
myPageViewController.tabBarItem = UITabBarItem(title: "마이", image: UIImage(named: "myPageIcon"), tag: 3)
guard let myPageViewController = myPageCoordinator.navigationController else {
return UIViewController() }
myPageViewController.tabBarItem = UITabBarItem(
title: "마이",
image: UIImage(named: "myPageIcon"),
tag: 3)

/// 탭 바
tabBarController.viewControllers = [homeViewController,
mapViewController,
placeViewController,
favoriteViewController,
myPageViewController]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class FavoriteViewController: BaseViewController {
// MARK: - Views

fileprivate let anonymousView = AnonymousView()
fileprivate let isEmptyView = EmptyView()
fileprivate let isEmptyView = EmptyView(type: .emptyFavorite)
fileprivate let favoriteTableView = FavoriteTableView()
fileprivate let refreshControl = UIRefreshControl()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ import FindTownUI
final class EmptyView: UIView {

private let iconImageView = UIImageView()
private let titleLabel = FindTownLabel(text: "찜한 동네가 아직 없어요.",
private lazy var titleLabel = FindTownLabel(text: type.title,
font: .body1,
textColor: .grey6,
textAlignment: .center)
private let subLabel = FindTownLabel(text: "나에게 맞는 동네를 찾아서 찜해보세요!",
private lazy var subLabel = FindTownLabel(text: type.subTitle,
font: .body4,
textColor: .grey5,
textAlignment: .center)
let findOutButton = FTButton(style: .mediumFilled)

override init(frame: CGRect) {
super.init(frame: frame)
let type: EmptyType

init(type: EmptyType) {
self.type = type
super.init(frame: .zero)
setupLayout()
setupView()
}
Expand Down Expand Up @@ -67,9 +70,11 @@ private extension EmptyView {
func setupView() {
self.backgroundColor = .clear

iconImageView.image = UIImage(named: "emptyIcon")
iconImageView.image = type.iconImage
titleLabel.setLineHeight(lineHeight: 24.0)
subLabel.setLineHeight(lineHeight: 20.0)
subLabel.numberOfLines = 2
findOutButton.setTitle("나에게 맞는 동네 찾기", for: .normal)
findOutButton.isHidden = type.isButtonHidden
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class MapViewController: BaseViewController {
}()
private let mapToggle = MapSegmentControl(items: ["인프라", "테마"])
fileprivate let detailCategoryView = MapDetailCategoryView()
private let categoryCollectionView = CategoryCollectionView()
private let categoryCollectionView = CategoryCollectionView(type: .map)
fileprivate let storeCollectionView = StoreCollectionView()
private let moveToIntroduceButton: FTButton = {
let button = FTButton(style: .round)
Expand Down Expand Up @@ -249,7 +249,8 @@ final class MapViewController: BaseViewController {
if index == 0 {
self?.viewModel?.output.categoryDataSource.onNext(InfraCategory.allCases)
} else {
self?.viewModel?.output.categoryDataSource.onNext(ThemaCategory.allCases)
self?.viewModel?.output.categoryDataSource
.onNext(ThemaCategory.allCases.filter { $0 != .every })
}
}
.disposed(by: disposeBag)
Expand Down Expand Up @@ -316,6 +317,10 @@ final class MapViewController: BaseViewController {

self.storeCollectionView.delegate = self
self.emptyDataInformLabel.isHidden = true
categoryCollectionView.register(
MapCategoryCollectionViewCell.self,
forCellWithReuseIdentifier: MapCategoryCollectionViewCell.reuseIdentifier
)
setMapZoomLevel()
setMapLayerGrounp()
}
Expand Down Expand Up @@ -343,13 +348,19 @@ private extension MapViewController {
])

NSLayoutConstraint.activate([
addressButton.leadingAnchor.constraint(equalTo: naviBarSubView.leadingAnchor, constant: 16.0),
addressButton.bottomAnchor.constraint(equalTo: naviBarSubView.bottomAnchor, constant: -8.0)
addressButton.leadingAnchor.constraint(
equalTo: naviBarSubView.leadingAnchor,
constant: 16.0),
addressButton.topAnchor.constraint(
equalTo: naviBarSubView.topAnchor,
constant: 24.0)
])

NSLayoutConstraint.activate([
mapToggle.centerYAnchor.constraint(equalTo: naviBarSubView.centerYAnchor),
mapToggle.trailingAnchor.constraint(equalTo: naviBarSubView.trailingAnchor, constant: -16.0)
mapToggle.trailingAnchor.constraint(
equalTo: naviBarSubView.trailingAnchor,
constant: -16.0)
])
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@

import UIKit

enum CategoryCollectionViewType {
case map
case place
}

final class CategoryCollectionView: UICollectionView {

convenience init() {
self.init(frame: .zero, collectionViewLayout: CategoryCollectionViewFlowLayout())
convenience init(type: CategoryCollectionViewType) {
if type == .map {
self.init(frame: .zero, collectionViewLayout: CategoryCollectionViewFlowLayout())
} else {
self.init(frame: .zero, collectionViewLayout: ThemeCollectionViewFlowLayout())
}
}

required init?(coder: NSCoder) {
Expand All @@ -27,8 +36,5 @@ final class CategoryCollectionView: UICollectionView {
backgroundColor = .clear
showsHorizontalScrollIndicator = false
allowsMultipleSelection = false
register(MapCategoryCollectionViewCell.self,
forCellWithReuseIdentifier: MapCategoryCollectionViewCell.reuseIdentifier)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// PlaceCoordinator.swift
// FindTown
//
// Created by 장선영 on 2023/11/08.
//

import UIKit

import FindTownCore

final class PlaceCoordinator: FlowCoordinator {

var presentationStyle: PresentationStyle
weak var navigationController: UINavigationController?
let appDIContainer: AppDIContainer

init(
presentationStyle: PresentationStyle,
appDIContainer: AppDIContainer
) {
self.presentationStyle = presentationStyle
self.appDIContainer = appDIContainer
}

internal func initScene() -> UIViewController {
let searchViewModel = PlaceViewModel(delegate: self)
let searchViewController = PlaceViewController(viewModel: searchViewModel)
return searchViewController
}
}

extension PlaceCoordinator: PlaceViewModelDelegate {
func presentAddressSheet() {
guard let navigationController = navigationController else { return }
AddressSheetCoordinator(
presentationStyle: .present(
navigationController: navigationController,
modalPresentationStyle: .overFullScreen),
parentCoordinator: self
).start()
}
}
Loading