Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
544701d
🩹chore: 파일 추적 해제
devBambu Aug 19, 2026
52e699b
🚚build: 폴더 및 파일 추가, 이동
devBambu Aug 19, 2026
29e7bc1
✨feat: MohaView 파일 생성 및 TabView 추가
devBambu Aug 19, 2026
61498b3
✨feat: Route 프로토콜 생성 및 구현
devBambu Aug 19, 2026
937263f
✨feat: HomeRoute 생성
devBambu Aug 19, 2026
0b025db
✨feat: MainRouter 생성 및 기초 구현
devBambu Aug 20, 2026
e2d73b9
✨feat: MainRouter 프로퍼티 수정
devBambu Aug 20, 2026
69029b9
✨feat: Router 프로토콜 정의
devBambu Aug 20, 2026
c3056fe
✨feat: 탭별 Router 및 Route 생성, 마지막 탭 이름 변경(MyPage -> Settings)
devBambu Aug 20, 2026
825958f
🚚build: Route, Router 폴더 분리
devBambu Aug 20, 2026
685adba
✨feat: MohaView 프로퍼티 수정
devBambu Aug 20, 2026
9f6d910
✨feat: HomeNavigationStack 생성 및 기초 구현
devBambu Aug 20, 2026
60bad05
✨feat: ReportNavigationStack 생성 및 기초 구현
devBambu Aug 20, 2026
2002e61
✨feat: SettingsNavigationStack 생성 및 기초 구현
devBambu Aug 20, 2026
f645af1
✨feat: TabView 각 NavigationStack 연결
devBambu Aug 20, 2026
9bb31c1
✨feat: MainRouter environment 등록
devBambu Aug 20, 2026
dfc2cdb
🩹chore: Router 프로토콜 네이밍 수정 -> NavigationRouter
devBambu Aug 20, 2026
2667ab9
✨feat: 앱 진입 메인뷰 변경
devBambu Aug 20, 2026
d434586
🐞fix: workflow yml 파일 수정
devBambu Aug 20, 2026
813c0b5
✨feat: NavigationRouter 함수 매개변수 타입 수정
devBambu Aug 20, 2026
60bd52c
✨feat: Route 프로토콜 id 속성 및 hash 함수 삭제
devBambu Aug 20, 2026
008d723
✨feat: TabItem 의존성 분리
devBambu Aug 20, 2026
d22a9cd
🐞fix: selectedTab의 TabItem 의존성 삭제
devBambu Aug 20, 2026
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
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Build & Test
- name: Build
run: |
xcodebuild \
-project Moha.xcodeproj \
-project Moha/Moha.xcodeproj \
-scheme Moha \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.5'
clean test
-destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NO \
clean build
Binary file not shown.
File renamed without changes.
47 changes: 47 additions & 0 deletions Moha/Moha/Sources/Features/MohaView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// MohaView.swift
// Moha
//
// Created by 변예린 on 8/19/26.
//

import SwiftUI

struct MohaView: View {
@State private var router = MainRouter()

var body: some View {
TabView(selection: $router.selectedTab) {
HomeNavigationStack(router: router.homeRouter)
.tag(TabItem.home)
.tabItem {
Label("Home", systemImage: "house")
}

ReportNavigationStack(router: router.reportRouter)
.tag(TabItem.report)
.tabItem {
Label("Report", systemImage: "chart.xyaxis.line")
}

SettingsNavigationStack(router: router.settingsRouter)
.tag(TabItem.settings)
.tabItem {
Label("Settings", systemImage: "person")
}
}
.environment(router)
}
}

//MARK: Tab Item
enum TabItem {
case home
case report
case settings
}

//MARK: - MohaView Preview
#Preview {
MohaView()
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct MohaApp: App {

var body: some Scene {
WindowGroup {
ContentView()
MohaView()
}
.modelContainer(sharedModelContainer)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// HomeNavigationStack.swift
// Moha
//
// Created by 변예린 on 8/21/26.
//

import SwiftUI

struct HomeNavigationStack: View {
@Bindable var router: HomeRouter

var body: some View {
NavigationStack(path: $router.path) {
Text("Home") //TODO: HomeView로 수정 필요
.navigationDestination(for: HomeRoute.self) { route in
destinationView(for: route)
}
}
}

@ViewBuilder
private func destinationView(for route: HomeRoute) -> some View {
switch route {
case .createTodo:
Text("Create")
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// ReportNavigationStack.swift
// Moha
//
// Created by 변예린 on 8/21/26.
//

import SwiftUI

struct ReportNavigationStack: View {
@Bindable var router: ReportRouter

var body: some View {
NavigationStack(path: $router.path) {
Text("Report") //TODO: ReportView로 수정 필요
.navigationDestination(for: ReportRoute.self) { route in
destinationView(for: route)
}
}
}

@ViewBuilder
private func destinationView(for route: ReportRoute) -> some View {
switch route {
case .createTodo:
Text("Create")
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// SettingsNavigationStack.swift
// Moha
//
// Created by 변예린 on 8/21/26.
//

import SwiftUI

struct SettingsNavigationStack: View {
@Bindable var router: SettingsRouter

var body: some View {
NavigationStack(path: $router.path) {
Text("Settings") //TODO: SettingsView로 수정 필요
.navigationDestination(for: SettingsRoute.self) { route in
destinationView(for: route)
}
}
}

@ViewBuilder
private func destinationView(for route: SettingsRoute) -> some View {
switch route {
case .createTodo:
Text("Create")
}
}
}
10 changes: 10 additions & 0 deletions Moha/Moha/Sources/Navigation/Route/HomeRoute.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// HomeRoute.swift
// Moha
//
// Created by 변예린 on 8/20/26.
//

enum HomeRoute: Route {
case createTodo
}
10 changes: 10 additions & 0 deletions Moha/Moha/Sources/Navigation/Route/ReportRoute.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// ReportRoute.swift
// Moha
//
// Created by 변예린 on 8/20/26.
//

enum ReportRoute: Route {
case createTodo
}
8 changes: 8 additions & 0 deletions Moha/Moha/Sources/Navigation/Route/Route.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// Route.swift
// Moha
//
// Created by 변예린 on 8/20/26.
//

protocol Route: Hashable { }
10 changes: 10 additions & 0 deletions Moha/Moha/Sources/Navigation/Route/SettingsRoute.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// SettingsRoute.swift
// Moha
//
// Created by 변예린 on 8/20/26.
//

enum SettingsRoute: Route {
case createTodo
}
20 changes: 20 additions & 0 deletions Moha/Moha/Sources/Navigation/Router/MainRouter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// MainRouter.swift
// Moha
//
// Created by 변예린 on 8/20/26.
//

import SwiftUI
import Combine

@Observable
final class MainRouter: ObservableObject {
var selectedTab = TabItem.home

let homeRouter = HomeRouter()
let reportRouter = ReportRouter()
let settingsRouter = SettingsRouter()


}
60 changes: 60 additions & 0 deletions Moha/Moha/Sources/Navigation/Router/NavigationRouter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// Router.swift
// Moha
//
// Created by 변예린 on 8/20/26.
//

import SwiftUI

protocol NavigationRouter: AnyObject {
associatedtype Destination: Route

var path: NavigationPath { get set }
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
}

extension NavigationRouter {
func push(to route: Destination) {
path.append(route)
}

func pop() {
guard !path.isEmpty else { return }
path.removeLast()
}

func reset() {
path = NavigationPath()
}

func popTo(count: Int) {
guard count > 0, count <= path.count else { return }
path.removeLast(count)
}

func replace(with route: Destination) {
path = NavigationPath()
path.append(route)
}
}

@Observable
final class HomeRouter: NavigationRouter {
typealias Destination = HomeRoute

var path = NavigationPath()
}

@Observable
final class ReportRouter: NavigationRouter {
typealias Destination = ReportRoute

var path = NavigationPath()
}

@Observable
final class SettingsRouter: NavigationRouter {
typealias Destination = SettingsRoute

var path = NavigationPath()
}
Loading