ios Tried some swiftui integraton (failed)

This commit is contained in:
Emin 2024-07-31 09:47:26 +05:00
parent 0b99a3572b
commit 63e3de24a9
10 changed files with 146 additions and 102 deletions

View file

@ -262,9 +262,11 @@
4A300ED51C6DCFD400140018 /* countries-strings in Resources */ = {isa = PBXBuildFile; fileRef = 4A300ED31C6DCFD400140018 /* countries-strings */; };
4B4153B52BF9695500EE4B02 /* MWMTextToSpeechTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B4153B42BF9695500EE4B02 /* MWMTextToSpeechTests.mm */; };
5236A36F2C525A0A00E3A7AD /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5236A36E2C525A0A00E3A7AD /* HomeViewController.swift */; };
5236A3712C525A3400E3A7AD /* WelcomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5236A3702C525A3400E3A7AD /* WelcomeViewController.swift */; };
5236A3712C525A3400E3A7AD /* AuthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5236A3702C525A3400E3A7AD /* AuthViewController.swift */; };
524634C62C53BC3100FDCABA /* Auth.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 524634C22C53BB3A00FDCABA /* Auth.storyboard */; };
524634CD2C57232400FDCABA /* TourismMain.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 524634CC2C57232400FDCABA /* TourismMain.storyboard */; };
52E2D39D2C58E74100A8843A /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E2D39C2C58E74100A8843A /* HomeScreen.swift */; };
52E2D3A02C58E7A300A8843A /* WelcomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E2D39F2C58E7A300A8843A /* WelcomeScreen.swift */; };
6741A9421BF340DE002C974C /* sound-strings in Resources */ = {isa = PBXBuildFile; fileRef = 5605022E1B6211E100169CAD /* sound-strings */; };
6741A9451BF340DE002C974C /* classificator.txt in Resources */ = {isa = PBXBuildFile; fileRef = EE026F0511D6AC0D00645242 /* classificator.txt */; };
6741A9491BF340DE002C974C /* countries.txt in Resources */ = {isa = PBXBuildFile; fileRef = FA46DA2B12D4166E00968C36 /* countries.txt */; };
@ -1186,9 +1188,11 @@
4A7D89C41B2EBF3B00AC843E /* resources-xxhdpi_dark */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "resources-xxhdpi_dark"; path = "../../data/resources-xxhdpi_dark"; sourceTree = "<group>"; };
4B4153B42BF9695500EE4B02 /* MWMTextToSpeechTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMTextToSpeechTests.mm; sourceTree = "<group>"; };
5236A36E2C525A0A00E3A7AD /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = "<group>"; };
5236A3702C525A3400E3A7AD /* WelcomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeViewController.swift; sourceTree = "<group>"; };
5236A3702C525A3400E3A7AD /* AuthViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthViewController.swift; sourceTree = "<group>"; };
524634C22C53BB3A00FDCABA /* Auth.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Auth.storyboard; sourceTree = "<group>"; };
524634CC2C57232400FDCABA /* TourismMain.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = TourismMain.storyboard; sourceTree = "<group>"; };
52E2D39C2C58E74100A8843A /* HomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeScreen.swift; sourceTree = "<group>"; };
52E2D39F2C58E7A300A8843A /* WelcomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeScreen.swift; sourceTree = "<group>"; };
5605022E1B6211E100169CAD /* sound-strings */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "sound-strings"; path = "../../data/sound-strings"; sourceTree = "<group>"; };
6741AA5D1BF340DE002C974C /* Organic Maps (Debug).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Organic Maps (Debug).app"; sourceTree = BUILT_PRODUCTS_DIR; };
6B15907026623AE500944BBA /* 00_NotoSansThai-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "00_NotoSansThai-Regular.ttf"; path = "../../data/00_NotoSansThai-Regular.ttf"; sourceTree = "<group>"; };
@ -2695,25 +2699,18 @@
sourceTree = "<group>";
};
5236A36C2C5258AC00E3A7AD /* Presentation */ = {
isa = PBXGroup;
children = (
5236A36D2C5258B700E3A7AD /* Screens */,
);
path = Presentation;
sourceTree = "<group>";
};
5236A36D2C5258B700E3A7AD /* Screens */ = {
isa = PBXGroup;
children = (
52B189982C53B9FD00B5B6F9 /* Auth */,
52B189972C53B9E900B5B6F9 /* Home */,
);
path = Screens;
path = Presentation;
sourceTree = "<group>";
};
52B189972C53B9E900B5B6F9 /* Home */ = {
isa = PBXGroup;
children = (
52E2D39B2C58E72900A8843A /* Screens */,
5236A36E2C525A0A00E3A7AD /* HomeViewController.swift */,
524634CC2C57232400FDCABA /* TourismMain.storyboard */,
);
@ -2723,12 +2720,29 @@
52B189982C53B9FD00B5B6F9 /* Auth */ = {
isa = PBXGroup;
children = (
5236A3702C525A3400E3A7AD /* WelcomeViewController.swift */,
52E2D39E2C58E78700A8843A /* Screens */,
5236A3702C525A3400E3A7AD /* AuthViewController.swift */,
524634C22C53BB3A00FDCABA /* Auth.storyboard */,
);
path = Auth;
sourceTree = "<group>";
};
52E2D39B2C58E72900A8843A /* Screens */ = {
isa = PBXGroup;
children = (
52E2D39C2C58E74100A8843A /* HomeScreen.swift */,
);
path = Screens;
sourceTree = "<group>";
};
52E2D39E2C58E78700A8843A /* Screens */ = {
isa = PBXGroup;
children = (
52E2D39F2C58E7A300A8843A /* WelcomeScreen.swift */,
);
path = Screens;
sourceTree = "<group>";
};
97B4E9271851DAB300BEC5D7 /* Custom Views */ = {
isa = PBXGroup;
children = (
@ -4411,6 +4425,7 @@
F6E2FD561E097BA00083EBEC /* MWMMapDownloaderButtonTableViewCell.m in Sources */,
9901284F244732DB00C72B10 /* BottomTabBarPresenter.swift in Sources */,
CDB4D5002231412900104869 /* MapTemplateBuilder.swift in Sources */,
52E2D39D2C58E74100A8843A /* HomeScreen.swift in Sources */,
34AB66171FC5AA320078E451 /* MWMiPhoneRoutePreview.m in Sources */,
99A906EA23F6F7030005872B /* PlacePageInfoViewController.swift in Sources */,
993DF11723F6BDB100AC231A /* UINavigationBarRenderer.swift in Sources */,
@ -4490,7 +4505,7 @@
F6E2FD6B1E097BA00083EBEC /* MWMMapDownloaderSubplaceTableViewCell.m in Sources */,
CDCA27842245090900167D87 /* ListenerContainer.swift in Sources */,
47E3C7252111E41B008B3B27 /* DimmedModalPresentationController.swift in Sources */,
5236A3712C525A3400E3A7AD /* WelcomeViewController.swift in Sources */,
5236A3712C525A3400E3A7AD /* AuthViewController.swift in Sources */,
3472B5CB200F43EF00DC6CD5 /* BackgroundFetchScheduler.swift in Sources */,
34FE5A6F1F18F30F00BCA729 /* TrafficButtonArea.swift in Sources */,
993DF10D23F6BDB100AC231A /* UIPageControlRenderer.swift in Sources */,
@ -4633,6 +4648,7 @@
3444DFDE1F18A5AF00E73099 /* SideButtonsArea.swift in Sources */,
CDCA278622451F5000167D87 /* RouteInfo.swift in Sources */,
3467CEB6202C6FA900D3C670 /* BMCNotificationsCell.swift in Sources */,
52E2D3A02C58E7A300A8843A /* WelcomeScreen.swift in Sources */,
337F98B221D3BAE600C8AC27 /* SearchCategoriesViewController.swift in Sources */,
F6E2FE0A1E097BA00083EBEC /* MWMOpeningHoursDeleteScheduleTableViewCell.mm in Sources */,
3454D7DA1E07F045004AF2AD /* UILabel+RuntimeAttributes.m in Sources */,

View file

@ -9,40 +9,56 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Welcome View Controller-->
<scene sceneID="s0d-6b-0kx">
<objects>
<viewController id="Y6W-OH-hqX" customClass="WelcomeViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<navigationItem key="navigationItem" id="UA3-Bu-mES"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1063.3587786259541" y="4.9295774647887329"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="pVv-RU-UNv">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="sXn-9F-9cL" sceneMemberID="viewController">
<navigationController automaticallyAdjustsScrollViewInsets="NO" navigationBarHidden="YES" id="sXn-9F-9cL" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="YuG-c1-cC0">
<rect key="frame" x="0.0" y="59" width="393" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="Y6W-OH-hqX" kind="relationship" relationship="rootViewController" id="Rfg-Mb-7eR"/>
<segue destination="G0d-aL-jnC" kind="relationship" relationship="rootViewController" id="cQn-Cm-EqM"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="OF9-Vp-dYO" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="136.64122137404578" y="4.9295774647887329"/>
</scene>
<!--Hosting Controller-->
<scene sceneID="vS6-zd-FzX">
<objects>
<hostingController id="ZxD-Dx-Ftz" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="bGA-TI-Q6E" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1949" y="5"/>
</scene>
<!--Auth View Controller-->
<scene sceneID="8Gm-3q-IU4">
<objects>
<viewController id="G0d-aL-jnC" customClass="AuthViewController" customModule="Organic_Maps" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="nm7-4k-j8y">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<containerView opaque="NO" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Tkg-eG-TrL">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<connections>
<segue destination="ZxD-Dx-Ftz" kind="embed" destinationCreationSelector="embedSwiftUIView:" id="a5L-1u-mLi"/>
</connections>
</containerView>
</subviews>
<viewLayoutGuide key="safeArea" id="IhI-x3-rtr"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<navigationItem key="navigationItem" id="qa9-uW-F3Q"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="lb9-tw-Sa4" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1043.5114503816794" y="4.9295774647887329"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">

View file

@ -0,0 +1,12 @@
import UIKit
import SwiftUI
class AuthViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBSegueAction func embedSwiftUIView(_ coder: NSCoder) -> UIViewController? {
return UIHostingController(coder: coder, rootView: WelcomeScreen())
}
}

View file

@ -0,0 +1,17 @@
import SwiftUI
struct WelcomeScreen: View {
var body: some View {
NavigationView{
VStack {
Text("Welcome!")
}
}
}
}
struct WelcomeScreen_Previews: PreviewProvider {
static var previews: some View {
WelcomeScreen()
}
}

View file

@ -0,0 +1,12 @@
import UIKit
import SwiftUI
class HomeViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBSegueAction func embedSwiftUIView(_ coder: NSCoder) -> UIViewController? {
return UIHostingController(coder: coder, rootView: HomeScreen())
}
}

View file

@ -0,0 +1,13 @@
import SwiftUI
struct HomeScreen: View {
var body: some View {
Text("Home!")
}
}
struct HomeScreen_Previews: PreviewProvider {
static var previews: some View {
HomeScreen()
}
}

View file

@ -17,13 +17,13 @@
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kNk-X7-4er">
<rect key="frame" x="151" y="416" width="42" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<containerView opaque="NO" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EyT-Dt-KWu">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<connections>
<segue destination="r6l-7Z-NJa" kind="embed" destinationCreationSelector="embedSwiftUIView:" id="s92-4F-DfD"/>
</connections>
</containerView>
</subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
@ -37,10 +37,9 @@
<!--Navigation Controller-->
<scene sceneID="rej-xi-UQl">
<objects>
<navigationController wantsFullScreenLayout="YES" automaticallyAdjustsScrollViewInsets="NO" id="J4R-2x-Hen" sceneMemberID="viewController">
<navigationController automaticallyAdjustsScrollViewInsets="NO" navigationBarHidden="YES" id="J4R-2x-Hen" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="4fm-IZ-TTV">
<rect key="frame" x="0.0" y="59" width="393" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
@ -52,6 +51,14 @@
</objects>
<point key="canvasLocation" x="23.664122137404579" y="-2.1126760563380285"/>
</scene>
<!--Hosting Controller-->
<scene sceneID="WwH-tG-NMF">
<objects>
<hostingController id="r6l-7Z-NJa" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="ZGK-7Y-pRL" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1813" y="-1"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">

View file

@ -1,30 +0,0 @@
//
// AnotherViewController.swift
// OMaps
//
// Created by Macbook Pro on 25/07/24.
// Copyright © 2024 Organic Maps. All rights reserved.
//
import UIKit
class AnotherViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}

View file

@ -1,30 +0,0 @@
//
// TourismViewController.swift
// OMaps
//
// Created by Macbook Pro on 25/07/24.
// Copyright © 2024 Organic Maps. All rights reserved.
//
import UIKit
class HomeViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}

View file

@ -17,7 +17,7 @@
</viewControllerPlaceholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="M1g-LC-NOC" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1598" y="-625"/>
<point key="canvasLocation" x="1508" y="-557"/>
</scene>
<!--Map View Controller-->
<scene sceneID="Wq1-a3-f7n">
@ -313,6 +313,7 @@
<segue destination="Psz-BY-Fy4" kind="presentation" identifier="PP2BookmarkEditingIPAD" modalPresentationStyle="formSheet" id="k6v-a7-5DO"/>
<segue destination="DdR-kk-MnB" kind="show" identifier="Map2Settings" id="Uyr-xb-oJc"/>
<segue destination="SOp-Vz-BSi" kind="presentation" identifier="Map2TourismMain" modalPresentationStyle="fullScreen" id="ZyV-kc-eXo"/>
<segue destination="6OK-aq-fiY" kind="presentation" identifier="Map2Auth" modalPresentationStyle="fullScreen" id="ZTS-EN-BxZ"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cKg-Q7-bFd" userLabel="First Responder" sceneMemberID="firstResponder"/>
@ -1148,6 +1149,16 @@
</objects>
<point key="canvasLocation" x="3780" y="2227.8169014084506"/>
</scene>
<!--Auth-->
<scene sceneID="Z0v-ES-xur">
<objects>
<viewControllerPlaceholder storyboardName="Auth" id="6OK-aq-fiY" sceneMemberID="viewController">
<navigationItem key="navigationItem" id="ghK-ag-Bkb"/>
</viewControllerPlaceholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="ZN4-4E-FRu" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1492" y="-657"/>
</scene>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="4Cc-99-mlN"/>