forked from organicmaps/organicmaps
backup
This commit is contained in:
parent
7166577cd1
commit
c5e3417af0
12 changed files with 314 additions and 54 deletions
|
@ -367,6 +367,11 @@
|
|||
52E95F072C6B7E2400A3FE2E /* SignUpRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E95F062C6B7E2400A3FE2E /* SignUpRequest.swift */; };
|
||||
52E95F0B2C6B8CC800A3FE2E /* UIViewControllerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E95F0A2C6B8CC800A3FE2E /* UIViewControllerExtensions.swift */; };
|
||||
52E95F0D2C6C797B00A3FE2E /* ProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E95F0C2C6C797B00A3FE2E /* ProfileViewController.swift */; };
|
||||
52ECA80F2C8A0D5F00F213B3 /* DescriptionScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52ECA80E2C8A0D5F00F213B3 /* DescriptionScreen.swift */; };
|
||||
52ECA8132C8A0D7A00F213B3 /* ReviewsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52ECA8122C8A0D7A00F213B3 /* ReviewsScreen.swift */; };
|
||||
52ECA8152C8A0D9E00F213B3 /* GalleryScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52ECA8142C8A0D9E00F213B3 /* GalleryScreen.swift */; };
|
||||
52ECA8182C8A255900F213B3 /* PlaceTabsBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52ECA8172C8A255900F213B3 /* PlaceTabsBar.swift */; };
|
||||
52ECA81A2C8A25D800F213B3 /* PlaceTopBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52ECA8192C8A25D800F213B3 /* PlaceTopBar.swift */; };
|
||||
52ED919D2C71F639000EE25B /* SimpleResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52ED919C2C71F639000EE25B /* SimpleResponse.swift */; };
|
||||
52ED919F2C71F718000EE25B /* SignUpRequestDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52ED919E2C71F718000EE25B /* SignUpRequestDTO.swift */; };
|
||||
52ED91A32C7200C4000EE25B /* Currency.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 52ED91A12C7200C4000EE25B /* Currency.xcdatamodeld */; };
|
||||
|
@ -1402,6 +1407,11 @@
|
|||
52E95F062C6B7E2400A3FE2E /* SignUpRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpRequest.swift; sourceTree = "<group>"; };
|
||||
52E95F0A2C6B8CC800A3FE2E /* UIViewControllerExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerExtensions.swift; sourceTree = "<group>"; };
|
||||
52E95F0C2C6C797B00A3FE2E /* ProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileViewController.swift; sourceTree = "<group>"; };
|
||||
52ECA80E2C8A0D5F00F213B3 /* DescriptionScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DescriptionScreen.swift; sourceTree = "<group>"; };
|
||||
52ECA8122C8A0D7A00F213B3 /* ReviewsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewsScreen.swift; sourceTree = "<group>"; };
|
||||
52ECA8142C8A0D9E00F213B3 /* GalleryScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GalleryScreen.swift; sourceTree = "<group>"; };
|
||||
52ECA8172C8A255900F213B3 /* PlaceTabsBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PlaceTabsBar.swift; path = Tourism/Presentation/Home/Screens/Profile/PlaceDetails/Gallery/PlaceTabsBar.swift; sourceTree = SOURCE_ROOT; };
|
||||
52ECA8192C8A25D800F213B3 /* PlaceTopBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceTopBar.swift; sourceTree = "<group>"; };
|
||||
52ED919C2C71F639000EE25B /* SimpleResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleResponse.swift; sourceTree = "<group>"; };
|
||||
52ED919E2C71F718000EE25B /* SignUpRequestDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpRequestDTO.swift; sourceTree = "<group>"; };
|
||||
52ED91A22C7200C4000EE25B /* CurrencyRates.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = CurrencyRates.xcdatamodel; sourceTree = "<group>"; };
|
||||
|
@ -3285,9 +3295,10 @@
|
|||
52A48AEE2C8988CC0081E522 /* PlaceDetails */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52ECA8162C8A253D00F213B3 /* Components */,
|
||||
52A48AF02C8989630081E522 /* Description */,
|
||||
52A48AF22C8989780081E522 /* Reviews */,
|
||||
52A48AF12C89896B0081E522 /* Gallery */,
|
||||
52A48AF22C8989780081E522 /* Reviews */,
|
||||
52EF1B612C8989F1003046A4 /* PlaceViewController.swift */,
|
||||
52EF1B652C8989F9003046A4 /* PlaceViewModel.swift */,
|
||||
);
|
||||
|
@ -3298,6 +3309,7 @@
|
|||
52A48AF02C8989630081E522 /* Description */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52ECA80E2C8A0D5F00F213B3 /* DescriptionScreen.swift */,
|
||||
);
|
||||
path = Description;
|
||||
sourceTree = "<group>";
|
||||
|
@ -3305,6 +3317,7 @@
|
|||
52A48AF12C89896B0081E522 /* Gallery */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52ECA8142C8A0D9E00F213B3 /* GalleryScreen.swift */,
|
||||
);
|
||||
path = Gallery;
|
||||
sourceTree = "<group>";
|
||||
|
@ -3312,6 +3325,7 @@
|
|||
52A48AF22C8989780081E522 /* Reviews */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52ECA8122C8A0D7A00F213B3 /* ReviewsScreen.swift */,
|
||||
);
|
||||
path = Reviews;
|
||||
sourceTree = "<group>";
|
||||
|
@ -3402,6 +3416,15 @@
|
|||
path = Utils;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
52ECA8162C8A253D00F213B3 /* Components */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52ECA8172C8A255900F213B3 /* PlaceTabsBar.swift */,
|
||||
52ECA8192C8A25D800F213B3 /* PlaceTopBar.swift */,
|
||||
);
|
||||
path = Components;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
52ED91A02C72007C000EE25B /* DataModels */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -4916,6 +4939,7 @@
|
|||
47F86D0120C93D8D00FEE291 /* TabViewController.swift in Sources */,
|
||||
52E95F022C6B32E500A3FE2E /* ErrorResponse.swift in Sources */,
|
||||
99536113235DB86C008B218F /* InsetsLabel.swift in Sources */,
|
||||
52ECA8182C8A255900F213B3 /* PlaceTabsBar.swift in Sources */,
|
||||
6741A9A51BF340DE002C974C /* MWMShareActivityItem.mm in Sources */,
|
||||
994F790723E85C5900660E75 /* DifficultyView.swift in Sources */,
|
||||
F6E2FF5D1E097BA00083EBEC /* MWMRecentTrackSettingsController.mm in Sources */,
|
||||
|
@ -5046,6 +5070,7 @@
|
|||
99A906DE23F6F7030005872B /* PlacePageBookmarkViewController.swift in Sources */,
|
||||
52B573F92C6223CE0047FAC9 /* AuthBackButton.swift in Sources */,
|
||||
52522F4A2C6DFE580015709C /* BackButtonWithText.swift in Sources */,
|
||||
52ECA80F2C8A0D5F00F213B3 /* DescriptionScreen.swift in Sources */,
|
||||
529A5F2B2C86DF2D004FE4A1 /* PlaceShort.swift in Sources */,
|
||||
F6791B141C43DF0B007A8A6E /* MWMStartButton.m in Sources */,
|
||||
9977E6A12480E1EE0073780C /* BottomMenuLayerButton.swift in Sources */,
|
||||
|
@ -5173,6 +5198,7 @@
|
|||
34AC8FDB1EFC07FE00E7F910 /* UILabel+NumberOfVisibleLines.swift in Sources */,
|
||||
52ED91A52C72C50F000EE25B /* CurrencyRepositoryImpl.swift in Sources */,
|
||||
52A48AE92C888AD90081E522 /* ReviewsRepositoryImpl.swift in Sources */,
|
||||
52ECA8132C8A0D7A00F213B3 /* ReviewsScreen.swift in Sources */,
|
||||
ED79A5AD2BD7BA0F00952D1F /* UIApplication+LoadingOverlay.swift in Sources */,
|
||||
9959C75C24599CCD008FD4FD /* DirectionView.swift in Sources */,
|
||||
47CA68D62500448D00671019 /* BookmarksListInteractor.swift in Sources */,
|
||||
|
@ -5296,6 +5322,7 @@
|
|||
3454D7BC1E07F045004AF2AD /* CLLocation+Mercator.mm in Sources */,
|
||||
47E3C7272111E5A8008B3B27 /* AlertPresentationController.swift in Sources */,
|
||||
CDCA27812243F59800167D87 /* CarPlayRouter.swift in Sources */,
|
||||
52ECA81A2C8A25D800F213B3 /* PlaceTopBar.swift in Sources */,
|
||||
34F5E0D41E3F254800B1C415 /* UIView+Hierarchy.swift in Sources */,
|
||||
6741AA0B1BF340DE002C974C /* MWMMapViewControlsManager.mm in Sources */,
|
||||
F6E2FED91E097BA00083EBEC /* MWMSearchContentView.m in Sources */,
|
||||
|
@ -5330,6 +5357,7 @@
|
|||
34763EE71F2F392300F4D2D3 /* MWMTextToSpeech.mm in Sources */,
|
||||
998927402449ECC200260CE2 /* BottomMenuItemCell.swift in Sources */,
|
||||
F6E2FEE21E097BA00083EBEC /* MWMSearchManager.mm in Sources */,
|
||||
52ECA8152C8A0D9E00F213B3 /* GalleryScreen.swift in Sources */,
|
||||
F6E2FE221E097BA00083EBEC /* MWMOpeningHoursEditorViewController.mm in Sources */,
|
||||
ED79A5D72BDF8D6100952D1F /* SynchronizationStateManager.swift in Sources */,
|
||||
999FC12B23ABB4B800B0E6F9 /* FontStyleSheet.swift in Sources */,
|
||||
|
|
|
@ -10,6 +10,53 @@ struct Constants {
|
|||
"restaurants": NSLocalizedString("restaurants", comment: ""),
|
||||
"hotels_tourism": NSLocalizedString("hotels_tourism", comment: "")
|
||||
]
|
||||
|
||||
static let placeExample = PlaceFull(
|
||||
id: 1,
|
||||
name: "Beautiful Place",
|
||||
rating: 4.5,
|
||||
excerpt: "<p>Ресторан отличается от других подобных объектов bla bla bla.</p>",
|
||||
description: """
|
||||
<p>Ресторан отличается от других подобных объектов уникальным дизайном и новым способом подачи различных блюд. Красивое оформление холла здания, использование экологически чистых материалов и приятная музыка отражают теплый климат Бразилии.</p><p>Объект построен по франчайзинговому проекту, то есть на основе подряда, с использованием известного иностранного бренда и его технологий. Управлением рестораном и приготовлением различных блюд занимается гражданин Бразилии, который будет обслуживать клиентов в сотрудничестве с таджикскими поварами и официантами.</p>
|
||||
""",
|
||||
placeLocation: PlaceLocation(
|
||||
name: "Mountain Retreat",
|
||||
lat: 38.550288,
|
||||
lon: 68.729752
|
||||
),
|
||||
cover: Constants.imageUrlExample,
|
||||
pics: [
|
||||
Constants.imageUrlExample,
|
||||
Constants.imageUrlExample,
|
||||
Constants.thumbnailUrlExample
|
||||
],
|
||||
reviews: [
|
||||
Review(
|
||||
id: 1,
|
||||
placeId: 1,
|
||||
rating: 5,
|
||||
user: User(id: 1, name: "John Doe", pfpUrl: Constants.imageUrlExample, countryCodeName: "us"),
|
||||
date: "2024-09-01",
|
||||
comment: "Amazing place! The views are incredible and the atmosphere is so calming.",
|
||||
picsUrls: [
|
||||
Constants.imageUrlExample,
|
||||
Constants.thumbnailUrlExample
|
||||
]
|
||||
),
|
||||
Review(
|
||||
id: 2,
|
||||
placeId: 1,
|
||||
rating: 4,
|
||||
user: User(id: 2, name: "Jane Smith", pfpUrl: Constants.imageUrlExample, countryCodeName: "tj"),
|
||||
date: "2024-08-20",
|
||||
comment: "Great place for a weekend getaway. A bit crowded but worth the visit.",
|
||||
picsUrls: [
|
||||
Constants.imageUrlExample
|
||||
]
|
||||
)
|
||||
],
|
||||
isFavorite: false
|
||||
)
|
||||
}
|
||||
|
||||
let BASE_URL_WITHOUT_API = "https://product.rebus.tj/"
|
||||
|
|
|
@ -31,7 +31,7 @@ struct AppTopBar: View {
|
|||
.foregroundColor(.primary)
|
||||
.padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 16))
|
||||
|
||||
Spacer(minLength: 12)
|
||||
VerticalSpace(height: 12)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,12 @@ class HomeViewController: UIViewController {
|
|||
goToCategoriesTab: goToCategoriesTab,
|
||||
goToSearchScreen: { query in
|
||||
let destinationVC = SearchViewController(searchVM: self.searchVM)
|
||||
self.navigationController?.pushViewController(destinationVC, animated: true)
|
||||
self.navigationController?.pushViewController(destinationVC, animated: false)
|
||||
},
|
||||
goToPlaceScreen: { id in
|
||||
let destinationVC = PlaceViewController(placeId: id)
|
||||
self.navigationController?.pushViewController(destinationVC, animated: false)
|
||||
self.tabBarController?.tabBar.isHidden = true
|
||||
}
|
||||
)
|
||||
)
|
||||
|
@ -43,6 +48,7 @@ struct HomeScreen: View {
|
|||
@ObservedObject var categoriesVM: CategoriesViewModel
|
||||
var goToCategoriesTab: () -> Void
|
||||
var goToSearchScreen: (String) -> Void
|
||||
var goToPlaceScreen: (Int64) -> Void
|
||||
|
||||
@State var top30: SingleChoiceItem<Int>? = SingleChoiceItem(id: 1, label: L("top30"))
|
||||
|
||||
|
@ -95,7 +101,7 @@ struct HomeScreen: View {
|
|||
title: L("sights"),
|
||||
items: sights,
|
||||
onPlaceClick: { place in
|
||||
|
||||
goToPlaceScreen(place.id)
|
||||
},
|
||||
setFavoriteChanged: { place, isFavorite in
|
||||
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
import SwiftUI
|
||||
import SDWebImageSwiftUI
|
||||
|
||||
struct PlaceTopBar: View {
|
||||
let title: String
|
||||
let picUrl: String?
|
||||
let onBackClick: (() -> Void)?
|
||||
let isFavorite: Bool
|
||||
let onFavoriteChanged: (Bool) -> Void
|
||||
let onMapClick: () -> Void
|
||||
|
||||
private let height: CGFloat = 160
|
||||
private let padding: CGFloat = 16
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
// Load image
|
||||
LoadImageView(url: picUrl)
|
||||
.frame(height: height)
|
||||
.clipShape(
|
||||
RoundedRectangle(cornerRadius: 20, style: .continuous)
|
||||
)
|
||||
|
||||
// Black overlay with opacity
|
||||
SwiftUI.Color.black.opacity(0.3)
|
||||
.frame(height: height)
|
||||
.clipShape(
|
||||
RoundedRectangle(cornerRadius: 20, style: .continuous)
|
||||
)
|
||||
|
||||
// Top actions: Back, Favorite, Map
|
||||
VStack {
|
||||
HStack {
|
||||
if let onBackClick = onBackClick {
|
||||
PlaceTopBarAction(
|
||||
iconName: "chevron.left",
|
||||
onClick: onBackClick
|
||||
)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
PlaceTopBarAction(
|
||||
iconName: isFavorite ? "heart.fill" : "heart",
|
||||
onClick: { onFavoriteChanged(!isFavorite) }
|
||||
)
|
||||
|
||||
PlaceTopBarAction(
|
||||
iconName: "map",
|
||||
onClick: onMapClick
|
||||
)
|
||||
}
|
||||
.padding(.horizontal, padding)
|
||||
.padding(.top, 48)
|
||||
|
||||
VerticalSpace(height: 32)
|
||||
|
||||
// Title
|
||||
Text(title)
|
||||
.textStyle(TextStyle.h2)
|
||||
.foregroundColor(.white)
|
||||
.padding(.horizontal, padding)
|
||||
.padding(.bottom, padding)
|
||||
.lineLimit(1)
|
||||
.truncationMode(.tail)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: height)
|
||||
}
|
||||
}
|
||||
|
||||
struct PlaceTopBarAction: View {
|
||||
let iconName: String
|
||||
let onClick: () -> Void
|
||||
|
||||
var body: some View {
|
||||
Button(action: onClick) {
|
||||
Image(systemName: iconName)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 24, height: 24)
|
||||
.padding(8)
|
||||
.background(SwiftUI.Color.white.opacity(0.2))
|
||||
.clipShape(Circle())
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct PlaceTopBar_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
PlaceTopBar(
|
||||
title: "Place Title",
|
||||
picUrl: "https://example.com/image.jpg",
|
||||
onBackClick: { print("Back clicked") },
|
||||
isFavorite: true,
|
||||
onFavoriteChanged: { isFavorite in print("Favorite changed: \(isFavorite)") },
|
||||
onMapClick: { print("Map clicked") }
|
||||
)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
import SwiftUI
|
||||
|
||||
struct DescriptionScreen: View {
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
Text("Description")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
import SwiftUI
|
||||
|
||||
struct GalleryScreen: View {
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
Text("Gallery")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
import SwiftUI
|
||||
|
||||
let tabBarShape = RoundedRectangle(cornerRadius: 50)
|
||||
|
||||
struct PlaceTabsBar: View {
|
||||
let tabTitles = ["Description", "Gallery", "Reviews"]
|
||||
|
||||
@Binding var selectedTab: Int
|
||||
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
ForEach(0..<tabTitles.count, id: \.self) { index in
|
||||
TabButton(title: tabTitles[index], isSelected: selectedTab == index) {
|
||||
selectedTab = index
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
}
|
||||
.padding(8)
|
||||
.background(Color.surface)
|
||||
.clipShape(tabBarShape)
|
||||
}
|
||||
|
||||
struct TabButton: View {
|
||||
let title: String
|
||||
let isSelected: Bool
|
||||
let action: () -> Void
|
||||
|
||||
var body: some View {
|
||||
Button(action: action) {
|
||||
Text(title)
|
||||
.padding(8)
|
||||
.background(isSelected ? Color.selected : SwiftUI.Color.clear)
|
||||
.cornerRadius(8)
|
||||
.foregroundColor(Color.onBackground)
|
||||
.clipShape(tabBarShape)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,70 +1,73 @@
|
|||
import UIKit
|
||||
import SwiftUI
|
||||
|
||||
class PlaceViewController: UIViewController {
|
||||
let placeId: Int64
|
||||
|
||||
init(placeId: Int64) {
|
||||
self.placeId = placeId
|
||||
super.init(
|
||||
nibName: nil,
|
||||
bundle: nil
|
||||
)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
let placeVM = PlaceViewModel()
|
||||
integrateSwiftUIScreen(PlaceScreen(placeVM: placeVM))
|
||||
integrateSwiftUIScreen(PlaceScreen(
|
||||
placeVM: placeVM,
|
||||
id: placeId,
|
||||
showBottomBar: {
|
||||
self.tabBarController?.tabBar.isHidden = false
|
||||
}
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
struct PlaceScreen: View {
|
||||
@ObservedObject var placeVM: PlaceViewModel
|
||||
let id: Int64
|
||||
let showBottomBar: () -> Void
|
||||
|
||||
@State private var selectedTab = 0
|
||||
|
||||
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
|
||||
|
||||
var body: some View {
|
||||
TabView() {
|
||||
Text("Tab 1")
|
||||
.tabItem {
|
||||
Label("First Tab", systemImage: "house")
|
||||
}
|
||||
Text("Tab 2")
|
||||
.tabItem {
|
||||
Label("Second Tab", systemImage: "person")
|
||||
}
|
||||
// Add more tabs as needed
|
||||
}
|
||||
VStack {
|
||||
PlaceTopBar(
|
||||
title: "place",
|
||||
picUrl: Constants.imageUrlExample,
|
||||
onBackClick: {
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
showBottomBar()
|
||||
},
|
||||
isFavorite: false,
|
||||
onFavoriteChanged: { isFavorite in
|
||||
// TODO: Cmon
|
||||
},
|
||||
onMapClick: {
|
||||
// TODO: Cmon
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct FirstScreen: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
Text("First Screen")
|
||||
NavigationLink("Go to Detail", destination: DetailScreen())
|
||||
VStack {
|
||||
PlaceTabsBar(selectedTab: $selectedTab)
|
||||
|
||||
SwiftUI.TabView(selection: $selectedTab) {
|
||||
DescriptionScreen().tag(0)
|
||||
GalleryScreen().tag(1)
|
||||
ReviewsScreen().tag(2)
|
||||
}
|
||||
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
|
||||
}.padding(16)
|
||||
}
|
||||
.navigationTitle("First Tab")
|
||||
}
|
||||
}
|
||||
|
||||
struct SecondScreen: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
Text("Second Screen")
|
||||
NavigationLink("Go to Detail", destination: DetailScreen())
|
||||
}
|
||||
.navigationTitle("Second Tab")
|
||||
}
|
||||
}
|
||||
|
||||
struct ThirdScreen: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
Text("Third Screen")
|
||||
NavigationLink("Go to Detail", destination: DetailScreen())
|
||||
}
|
||||
.navigationTitle("Third Tab")
|
||||
}
|
||||
}
|
||||
|
||||
struct DetailScreen: View {
|
||||
var body: some View {
|
||||
Text("Detail Screen")
|
||||
.navigationTitle("Detail")
|
||||
.edgesIgnoringSafeArea(.all)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import Combine
|
||||
|
||||
class PlaceViewModel : ObservableObject {
|
||||
@Published var place: PlaceFull?
|
||||
|
||||
init() {
|
||||
place = Constants.placeExample
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
import SwiftUI
|
||||
|
||||
struct ReviewsScreen: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
Text("Reviews")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,6 +6,8 @@ class TabBarController: UITabBarController {
|
|||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
hidesBottomBarWhenPushed = true
|
||||
|
||||
// creating tabs
|
||||
let homeTab = UITabBarItem(title: L("home"), image: UIImage(systemName: "house"), selectedImage: UIImage(systemName: "house.fill"))
|
||||
let categoriesTab = UITabBarItem(title: L("categories"), image: UIImage(systemName: "list.bullet.rectangle"), selectedImage: UIImage(systemName: "list.bullet.rectangle.fill"))
|
||||
|
|
Loading…
Add table
Reference in a new issue