Skip to content

Commit

Permalink
Fixbug/fix can not hide tabbar (#20)
Browse files Browse the repository at this point in the history
* Fix can not hide tabbar

* update docs
  • Loading branch information
hoangatuan authored Nov 4, 2023
1 parent 4cf566c commit 2b4ffc1
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ struct MovieDetailView: View {
.customBackButton(action: {
router.navigateBack()
})
.toolbar(.hidden, for: .tabBar)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ struct ListGenresView: View {
}
})
}
.padding(EdgeInsets(top: 24, leading: 16, bottom: 0, trailing: 16))
.screenBackground(with: .color040F23)
.padding(EdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16))
.customBackButton(action: {
router.navigateBack()
})
.screenBackground(with: .color040F23)
.toolbar(.hidden, for: .tabBar)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct DiscoveryMoviesSectionView: View {

Image("search")
.frame(width: 24, height: 24)
.foregroundColor(Color.white)
.onTapGesture(perform: {
router.navigate(to: PublicMoviesDestination.search)
})
Expand Down
8 changes: 7 additions & 1 deletion Features/Search/Sources/Search/Presentation/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
import CommonUI
import DesignSystem
import Domain
import Router
import SwiftUI

struct SearchView: View {
@EnvironmentObject private var router: Router
@StateObject private var viewModel: SearchViewModel
init(viewModel: SearchViewModel) {
_viewModel = .init(wrappedValue: viewModel)
Expand Down Expand Up @@ -58,6 +60,10 @@ struct SearchView: View {
Spacer()
}
}
.toolbar(.hidden, for: .tabBar)
.customBackButton {
router.navigateBack()
}
.onSubmit(of: .text) {
Task {
await viewModel.search(keyword: searchKeyword, for: selectedSearchType)
Expand Down Expand Up @@ -102,7 +108,7 @@ struct SearchView: View {
.background(Color.color4E89FF)
}
}
.padding(.init(top: 36, leading: 16, bottom: 32, trailing: 16))
.padding(.init(top: 0, leading: 16, bottom: 32, trailing: 16))
}

private var tabsView: some View {
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Supports iOS 16+
For Clean Architecture, theoratically we should have `UseCaseInterface` and `UseCaseImplementation`. However, at this point I feel like bringing `Usecase` as an extra layer is unncessary.
If we feel like need `Usecase` layer in future, we will add it.

## Why MVVM but not TCA, Redux, ... ?

Please read [this great article](https://betterprogramming.pub/swiftui-choosing-an-application-architecture-6ec9289f8e8f) from @Michael Long. I pretty much agreed with his thoughts.

# Getting Started

## Set up project
Expand All @@ -46,10 +50,14 @@ Feel free to contribute for the project if you want. Here is the figma & api ref
- [Figma Design](https://www.figma.com/file/rqjEdJecH0tr6uIyT72KXh/NAP001?type=design&node-id=6-9199&t=Ai7i6CXqzbqM468M-0)
- [API Document](https://developer.themoviedb.org/reference/intro/getting-started)

To contribute, please create an issue to describe about what you gonna work on.
There are some ways you can contribute to the project:

1. I've created some tasks under `Issues` tab. There are bugs, features, ... there. If you want to pick a task, just need to comment on the issue.
2. If you want to work on a new issue, you can go to `Issues` tab, and create a new issue to describe what you want to do.

## References

These are articles I've written about the process building this project:

1. [How I build Navigation](https://medium.com/gitconnected/modular-navigation-in-swiftui-a-comprehensive-guide-5eeb8a511583)
2. [Choosing SwiftUI Architecture](https://betterprogramming.pub/swiftui-choosing-an-application-architecture-6ec9289f8e8f)
1 change: 0 additions & 1 deletion iMovie/Presentation/AppTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ struct AppTabView: View {
.foregroundColor(.color04EECD)
}
.tag(0)
.toolbar(.visible, for: .tabBar)
.toolbarBackground(
Color.color4E89FF,
for: .tabBar
Expand Down
1 change: 1 addition & 0 deletions iMovie/Presentation/MovieTabCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct MovieTabCoordinator: View {
var body: some View {
NavigationStack(path: $router.navPath) {
MoviesCoordinator(dependencies: .init(apiClient: Container.shared.apiClientService()))
.toolbar(.visible, for: .tabBar)
.navigationDestination(for: PublicMoviesDestination.self) { destination in
switch destination {
case .search:
Expand Down

0 comments on commit 2b4ffc1

Please sign in to comment.