Skip to content

Commit

Permalink
Merge branch 'feat/#41-MainMapFindLoad' into feat/#43-ShareLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
dami0806 committed Dec 27, 2023
2 parents bdfdf24 + a47ccaa commit 1b6d328
Show file tree
Hide file tree
Showing 205 changed files with 4,890 additions and 452 deletions.
751 changes: 731 additions & 20 deletions TWTW/TWTW.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ final class DefaultChangeLocationCoordinator: ChangeLocationCoordinator {
}

func start() {
let changeLocationVC = ChangeLocationViewController()
let modalNavigationController = UINavigationController(rootViewController: changeLocationVC)
navigationController.present(modalNavigationController, animated: true, completion: nil)

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Created by 박다미 on 2023/12/01.
//

import Foundation
import UIKit

final class ChangeLocationViewController: UIViewController {
Expand Down
14 changes: 13 additions & 1 deletion TWTW/TWTW/Constants/API/EndPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,25 @@ enum RoutePath: String {
}

enum GroupPath: String {
case group = "/group"
case group = "/group" // 그룹생성
case invite = "/group/invite"
case join = "/group/join"
case lookUpGroup = "/group/GROUPID" // 그룹 단건조회
}

enum FriendPath: String {
case all = "/friends/all"
case search = "/friends/search?nickname=NAME"
case request = "/friends/request"
}

enum ParticipantsPath: String {
case all = "/plans/PLANID" // 그룹 모든 친구, 그룹 + plan
case not = "/plans/"// 그룹 + !plan 조회
case request = "/plans/yet" // 그룹 + !plan 요청
}

enum PlanPath: String {
case all = "/plans/PLANID" // Plan 단건 조회
case save = "/plans" //plan 저장
}
6 changes: 3 additions & 3 deletions TWTW/TWTW/Constants/EncodedQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import Foundation

enum EncodedQueryConfig {
case encodedQuery(searchText: String?)
case encodedQuery(encodeRequest: String?)

func getEncodedQuery() -> String {
switch self {
case .encodedQuery(let searchText):
return searchText?.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? ""
case .encodedQuery(let encodeRequest):
return encodeRequest?.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? ""
}
}
}
3 changes: 3 additions & 0 deletions TWTW/TWTW/Constants/Map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

import Foundation
import KakaoMapsSDK
import CoreLocation

struct Map {
static let DEFAULTPOSITION = MapPoint(longitude: 127.029148, latitude: 37.576568) // 초기 지도의 기본 위치 : 서울
static let DEFAULTCLLOCATION = CLLocationCoordinate2D(latitude: 37.576568, longitude: 127.029148)// 초기 지도의 기본 위치 : 서울

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class MainMapCustomTabButtonViewModel {
func bind(input: Input) {
input.participantsButtonTapped
.subscribe(onNext: { [weak self] in
self?.participantsButtonTapped()
self?.plansButtonTapped()
})
.disposed(by: disposeBag)

Expand All @@ -39,7 +39,7 @@ final class MainMapCustomTabButtonViewModel {
}

/// 친구화면으로 이동
private func participantsButtonTapped() {
private func plansButtonTapped() {
coordinator?.moveToParticipantsList()
}

Expand Down
29 changes: 29 additions & 0 deletions TWTW/TWTW/FindRoad/DefaultsFindRoadCoordinator.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// DefaultsFindRoadCoordinator.swift
// TWTW
//
// Created by 박다미 on 2023/12/18.
//

import Foundation
import UIKit

final class DefaultsFindRoadCoordinator: FindRoadCoordinator {

var childCoordinators: [Coordinator] = []
var navigationController: UINavigationController
private var findRoadViewModel: FindRoadViewModel?

// MARK: - Init
init(navigationController: UINavigationController) {
self.navigationController = navigationController
findRoadViewModel = FindRoadViewModel(coordinator: self)

}
func start() {
guard let findRoadViewModel = findRoadViewModel else { return }

let findRoadController = FindRoadViewController(viewModel: findRoadViewModel)
self.navigationController.pushViewController(findRoadController, animated: true)
}
}
10 changes: 10 additions & 0 deletions TWTW/TWTW/FindRoad/FindRoadCoordinator.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// FindRoadCoordinator.swift
// TWTW
//
// Created by 박다미 on 2023/12/18.
//

import Foundation

protocol FindRoadCoordinator: Coordinator {}
34 changes: 34 additions & 0 deletions TWTW/TWTW/FindRoad/FindRoadViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// FindRoadViewController.swift
// TWTW
//
// Created by 박다미 on 2023/12/18.
//

import RxCocoa
import RxSwift
import SnapKit
import UIKit

final class FindRoadViewController: UIViewController {
private let disposeBag = DisposeBag()
private var viewModel: FindRoadViewModel

// MARK: - Init
init(viewModel: FindRoadViewModel) {
self.viewModel = viewModel
super.init(nibName: nil, bundle: nil)
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// MARK: View Did Load
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white

}
}
50 changes: 50 additions & 0 deletions TWTW/TWTW/FindRoad/FindRoadViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// FindRoadViewModel.swift
// TWTW
//
// Created by 박다미 on 2023/12/18.
//

import RxCocoa
import RxRelay
import RxSwift
import UIKit

final class FindRoadViewModel {
private let disposeBag = DisposeBag()
weak var coordinator: DefaultsFindRoadCoordinator?


struct Input {
// 3.길찾기 버튼
let clickedConfirmEvents: ControlEvent<Void>?
}

struct Output {
}
// MARK: - Init
init(coordinator: DefaultsFindRoadCoordinator) {
self.coordinator = coordinator
}

// create Output
/// - Parameter input: Input Model
/// - Returns: Output Model
func createOutput(input: Input) -> Output {
let output = Output()

input.clickedConfirmEvents?
.bind { [weak self] in
guard let self = self else { return }
moveToFindRoad()
}
.disposed(by: disposeBag)

return output
}
/// 길찾기 화면으로
func moveToFindRoad() {
coordinator?.start()
}

}
8 changes: 8 additions & 0 deletions TWTW/TWTW/Friends/Model/Friend.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
//

import Foundation
import UIKit

struct Friend: Codable, Equatable {
let memberId: String?
let nickname: String?
let participantsImage: String?

enum CodingKeys: String, CodingKey {
case memberId
case nickname
case participantsImage = "profileImage"
}
}
22 changes: 21 additions & 1 deletion TWTW/TWTW/FriendsList/DefaultFriendsListCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ final class DefaultFriendsListCoordinator: FriendsListCoordinatorProtocol {
var childCoordinators: [Coordinator] = []
var navigationController: UINavigationController
var navigationControllerDelegate = TabBarNavigationControllerDelegate()

weak var delegate: FriendsSendListCoordinatorDelegate?

private var output: FriendsListViewModel.Output?

Expand All @@ -30,12 +32,30 @@ final class DefaultFriendsListCoordinator: FriendsListCoordinatorProtocol {
let friendsListViewController = FriendsListViewController(viewModel: friendsListViewModel)
navigationController.pushViewController(friendsListViewController, animated: false)
}

/// mark : 참여자 추가할때 fromPartiSetLocation
func startFromPartiSetLocation() {
let friendsListViewModel = FriendsListViewModel(
coordinator: self,
friendService: FriendService(),
caller: .fromPartiSetLocation
)
let friendsListViewController = FriendsListViewController(viewModel: friendsListViewModel)

navigationController.pushViewController(friendsListViewController, animated: true)

}

/// 새로운 친구추가 화면으로 이동
func makeNewFriends() {

let defaultMakeNewFriendsListCoordinator = DefaultMakeNewFriendsListCoordinator(navigationController: navigationController)
childCoordinators.append(defaultMakeNewFriendsListCoordinator)
defaultMakeNewFriendsListCoordinator.start()

}

func navigateBackWithSelectedFriends(_ friends: [Friend]) {
delegate?.didSelectFriends(friends)
navigationController.popViewController(animated: true)
}
}
13 changes: 13 additions & 0 deletions TWTW/TWTW/FriendsList/FriendListCaller.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Caller.swift
// TWTW
//
// Created by 박다미 on 2023/12/17.
//

import Foundation

enum FriendListCaller {
case fromPartiSetLocation
case fromTabBar
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// FriendsListCoordinatorDelegate.swift
// TWTW
//
// Created by 박다미 on 2023/12/17.
//

import Foundation

protocol FriendsSendListCoordinatorDelegate: AnyObject {
func didSelectFriends(_ friends: [Friend])
}
2 changes: 1 addition & 1 deletion TWTW/TWTW/FriendsList/View/FriendsListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class FriendsListViewController: UIViewController {
view.backgroundColor = .white
bind()
addSubviews()

}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
Expand Down
Loading

0 comments on commit 1b6d328

Please sign in to comment.