Commit eb9f2fed authored by wieseoli's avatar wieseoli

Merge branch 'onboardingScreens_swiftUI_merge_Dev' into 'dev'

Onboarding screens swift ui merge dev

See merge request !59
parents b631329b 7b34ea1b
......@@ -160,10 +160,15 @@
47E7BE632232BD0A00C8EF94 /* SignedEncMailFromMac.eml in Resources */ = {isa = PBXBuildFile; fileRef = 47E7BE622232BD0A00C8EF94 /* SignedEncMailFromMac.eml */; };
47EABF09241A9C8700774A93 /* AuthenticationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EABF06241A9C8700774A93 /* AuthenticationModel.swift */; };
47EABF0A241A9C8700774A93 /* AuthenticationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EABF07241A9C8700774A93 /* AuthenticationViewModel.swift */; };
47EABF0B241A9C8700774A93 /* AuthenticationScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EABF08241A9C8700774A93 /* AuthenticationScreen.swift */; };
47EABF0D241A9CA800774A93 /* MailAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EABF0C241A9CA800774A93 /* MailAccount.swift */; };
47EABF0E2420C63600774A93 /* GeneratedMocks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97C527A0241AA4090030BBC9 /* GeneratedMocks.swift */; };
47EABF0F2420C63600774A93 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97C5279E241A9F7B0030BBC9 /* AuthenticationTests.swift */; };
47EABF272423BFDD00774A93 /* AuthenticationScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EABF262423BFDD00774A93 /* AuthenticationScreen.swift */; };
47EABF292423C1FB00774A93 /* KeyboardChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EABF282423C1FB00774A93 /* KeyboardChecker.swift */; };
47EABF2B2423C20C00774A93 /* LoadingBlocker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EABF2A2423C20C00774A93 /* LoadingBlocker.swift */; };
47EABF2D2423C65F00774A93 /* AuthenticationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EABF2C2423C65F00774A93 /* AuthenticationView.swift */; };
47EABF3024240BD300774A93 /* AccountSetupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EABF2F24240BD300774A93 /* AccountSetupView.swift */; };
47EABF342424FD1900774A93 /* SwiftUIOnboardingUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EABF332424FD1800774A93 /* SwiftUIOnboardingUITests.swift */; };
47F0376E22A7278A0005C9DE /* accounts.json in Resources */ = {isa = PBXBuildFile; fileRef = 47F0376D22A7278A0005C9DE /* accounts.json */; };
47F79240203492E3005E7DB6 /* KeyRecord+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47F7923E203492E3005E7DB6 /* KeyRecord+CoreDataClass.swift */; };
47F79241203492E3005E7DB6 /* KeyRecord+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47F7923F203492E3005E7DB6 /* KeyRecord+CoreDataProperties.swift */; };
......@@ -259,6 +264,7 @@
A1FA44A721E10E1400DB02AC /* TravelHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1FA44A621E10E1400DB02AC /* TravelHandler.swift */; };
A5E303D824110F6400310264 /* smime-helpers.c in Sources */ = {isa = PBXBuildFile; fileRef = A5E303D724110F6400310264 /* smime-helpers.c */; };
AC4001CA169DC07A7A1E3AD3 /* Pods_enzevalos_iphone.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94EE54279AB591E0CAB8EFD8 /* Pods_enzevalos_iphone.framework */; };
AD97DFBE241F97A300C35B95 /* OnboardingIntroInfoSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD97DFBD241F97A300C35B95 /* OnboardingIntroInfoSection.swift */; };
F113C3851F30D06800E7F1D6 /* QRScannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F113C3841F30D06800E7F1D6 /* QRScannerView.swift */; };
F113C38B1F3344C200E7F1D6 /* ViewControllerPannable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F113C38A1F3344C200E7F1D6 /* ViewControllerPannable.swift */; };
F119D2901E364B59001D732A /* AnimatedSendIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = F119D28F1E364B59001D732A /* AnimatedSendIcon.swift */; };
......@@ -575,6 +581,7 @@
47CEF4EA2052C3C700887CDB /* ObjectivePGP.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ObjectivePGP.framework; sourceTree = "<group>"; };
47CEF4EC2052C3E600887CDB /* ObjectivePGP.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectivePGP.framework; path = ../enzevalos_iphone_workspace/ObjectivePGP.framework; sourceTree = "<group>"; };
47D1302A1F7CEE6D007B14DF /* DebugSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DebugSettings.swift; sourceTree = "<group>"; };
47D1BB052431F81C001F1EC9 /* enzevalos_iphone 10.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "enzevalos_iphone 10.xcdatamodel"; sourceTree = "<group>"; };
47E7376D22845EC400972401 /* SecretKeyTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecretKeyTableViewController.swift; sourceTree = "<group>"; };
47E7376F22845F3A00972401 /* KeyViews.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = KeyViews.storyboard; sourceTree = "<group>"; };
47E737732284610E00972401 /* KeyCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KeyCell.xib; sourceTree = "<group>"; };
......@@ -586,8 +593,13 @@
47E7BE622232BD0A00C8EF94 /* SignedEncMailFromMac.eml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SignedEncMailFromMac.eml; sourceTree = "<group>"; };
47EABF06241A9C8700774A93 /* AuthenticationModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationModel.swift; sourceTree = "<group>"; };
47EABF07241A9C8700774A93 /* AuthenticationViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationViewModel.swift; sourceTree = "<group>"; };
47EABF08241A9C8700774A93 /* AuthenticationScreen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationScreen.swift; sourceTree = "<group>"; };
47EABF0C241A9CA800774A93 /* MailAccount.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MailAccount.swift; sourceTree = "<group>"; };
47EABF262423BFDD00774A93 /* AuthenticationScreen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationScreen.swift; sourceTree = "<group>"; };
47EABF282423C1FB00774A93 /* KeyboardChecker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyboardChecker.swift; sourceTree = "<group>"; };
47EABF2A2423C20C00774A93 /* LoadingBlocker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadingBlocker.swift; sourceTree = "<group>"; };
47EABF2C2423C65F00774A93 /* AuthenticationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationView.swift; sourceTree = "<group>"; };
47EABF2F24240BD300774A93 /* AccountSetupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSetupView.swift; sourceTree = "<group>"; };
47EABF332424FD1800774A93 /* SwiftUIOnboardingUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIOnboardingUITests.swift; sourceTree = "<group>"; };
47F0376D22A7278A0005C9DE /* accounts.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = accounts.json; sourceTree = "<group>"; };
47F7923E203492E3005E7DB6 /* KeyRecord+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "KeyRecord+CoreDataClass.swift"; sourceTree = "<group>"; };
47F7923F203492E3005E7DB6 /* KeyRecord+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "KeyRecord+CoreDataProperties.swift"; sourceTree = "<group>"; };
......@@ -713,6 +725,7 @@
A5E303D624110F6400310264 /* smime-helpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "smime-helpers.h"; sourceTree = "<group>"; };
A5E303D724110F6400310264 /* smime-helpers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "smime-helpers.c"; sourceTree = "<group>"; };
AA686D4FC9B86445A0C87F0F /* Pods-enzevalos_iphone.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphone.release.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphone/Pods-enzevalos_iphone.release.xcconfig"; sourceTree = "<group>"; };
AD97DFBD241F97A300C35B95 /* OnboardingIntroInfoSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingIntroInfoSection.swift; sourceTree = "<group>"; };
AF67EF30BB065CC9C0D17940 /* Pods_enzevalos_iphoneUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_enzevalos_iphoneUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
BC7D006B3B40A23E53B4F317 /* Pods-enzevalos_iphoneTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphoneTests.release.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphoneTests/Pods-enzevalos_iphoneTests.release.xcconfig"; sourceTree = "<group>"; };
C1F4458FC892EBE555836F55 /* Pods_enzevalos_iphone_AdHoc.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_enzevalos_iphone_AdHoc.framework; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -1058,6 +1071,7 @@
476406872416B54D00C7D426 /* SwiftUI */ = {
isa = PBXGroup;
children = (
47EABF2E24240BA400774A93 /* AccountSetup */,
476406882416B54D00C7D426 /* Inbox */,
4764068C2416B54D00C7D426 /* SupportingViews */,
);
......@@ -1077,6 +1091,8 @@
4764068C2416B54D00C7D426 /* SupportingViews */ = {
isa = PBXGroup;
children = (
47EABF2A2423C20C00774A93 /* LoadingBlocker.swift */,
47EABF282423C1FB00774A93 /* KeyboardChecker.swift */,
4764068D2416B54D00C7D426 /* CiricleImage.swift */,
4764068E2416B54D00C7D426 /* SearchView.swift */,
4764068F2416B54D00C7D426 /* MailView.swift */,
......@@ -1109,6 +1125,7 @@
476EEFA522A87B9800BB4EF7 /* private */,
476EEFA022A873A800BB4EF7 /* OnboardingTest.swift */,
476EEF9A22A872BF00BB4EF7 /* Info.plist */,
47EABF332424FD1800774A93 /* SwiftUIOnboardingUITests.swift */,
);
path = enzevalos_iphoneUITests;
sourceTree = "<group>";
......@@ -1216,14 +1233,24 @@
47EABF05241A9C7000774A93 /* Authentication */ = {
isa = PBXGroup;
children = (
AD97DFBD241F97A300C35B95 /* OnboardingIntroInfoSection.swift */,
47EABF0C241A9CA800774A93 /* MailAccount.swift */,
47EABF06241A9C8700774A93 /* AuthenticationModel.swift */,
47EABF08241A9C8700774A93 /* AuthenticationScreen.swift */,
47EABF262423BFDD00774A93 /* AuthenticationScreen.swift */,
47EABF2C2423C65F00774A93 /* AuthenticationView.swift */,
47EABF07241A9C8700774A93 /* AuthenticationViewModel.swift */,
);
name = Authentication;
sourceTree = "<group>";
};
47EABF2E24240BA400774A93 /* AccountSetup */ = {
isa = PBXGroup;
children = (
47EABF2F24240BD300774A93 /* AccountSetupView.swift */,
);
path = AccountSetup;
sourceTree = "<group>";
};
47F0376C22A7278A0005C9DE /* private */ = {
isa = PBXGroup;
children = (
......@@ -2100,6 +2127,7 @@
buildActionMask = 2147483647;
files = (
476EEFA122A873A800BB4EF7 /* OnboardingTest.swift in Sources */,
47EABF342424FD1900774A93 /* SwiftUIOnboardingUITests.swift in Sources */,
476EEF9922A872BF00BB4EF7 /* enzevalos_iphoneUITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -2115,12 +2143,14 @@
A1C3270E1DB907D900CE2ED5 /* TextFormatter.swift in Sources */,
F12041FD1DA409A5002E4940 /* ListViewCell.swift in Sources */,
A1EFF93321E6655C003BB240 /* IntroTableView.swift in Sources */,
47EABF272423BFDD00774A93 /* AuthenticationScreen.swift in Sources */,
4764069A2416B54D00C7D426 /* MailView.swift in Sources */,
A1E2324E1F0FA41A00DC9D40 /* FolderListCell.swift in Sources */,
A1F8541021E8A60800614514 /* IntroSecretViewController.swift in Sources */,
A1ACDD0921EB9C4C00A059D0 /* IntroInputViewController.swift in Sources */,
476406952416B54D00C7D426 /* KeyRecordRow.swift in Sources */,
476916A0216B86A100491527 /* PersistentMail +CoreDataClass.swift in Sources */,
47EABF3024240BD300774A93 /* AccountSetupView.swift in Sources */,
4751C7002344D37C006B2A4D /* SecretKey+CoreDataClass.swift in Sources */,
A1AEBA5921E808CB00C84E59 /* IntroYesNoViewController.swift in Sources */,
A1EB05941D956931008659C1 /* InboxCellDelegator.swift in Sources */,
......@@ -2156,7 +2186,9 @@
F18B44601E704C550080C041 /* ReplaceSegue.swift in Sources */,
8428A8661F436A11007649A5 /* ArrowTableViewCell.swift in Sources */,
F1ACF21C1E0C1C6800C1B843 /* ContactViewController.swift in Sources */,
AD97DFBE241F97A300C35B95 /* OnboardingIntroInfoSection.swift in Sources */,
476406962416B54D00C7D426 /* Inbox.swift in Sources */,
47EABF2B2423C20C00774A93 /* LoadingBlocker.swift in Sources */,
475B00351F7B9565006CDD41 /* CryptoObject.swift in Sources */,
A1EB057E1D956848008659C1 /* VENDataDelegate.swift in Sources */,
4706D661225CD21D00B3F1D3 /* ExportKeyHelper.swift in Sources */,
......@@ -2188,6 +2220,7 @@
475B00431F7BB6D6006CDD41 /* PersistentKey+CoreDataProperties.swift in Sources */,
479C649A21F45DAF00A01071 /* HideShowPasswordTextField.swift in Sources */,
47CEAC98222541B40075B7DC /* MailSession.swift in Sources */,
47EABF292423C1FB00774A93 /* KeyboardChecker.swift in Sources */,
F119D2901E364B59001D732A /* AnimatedSendIcon.swift in Sources */,
4707096D1F8F9F4900657F41 /* ExportViewController.swift in Sources */,
F12060801DA540FE00F6EF37 /* RefreshControlExtension.swift in Sources */,
......@@ -2246,6 +2279,7 @@
A1EB05901D956923008659C1 /* ReadViewController.swift in Sources */,
472F398E1E251B8D009260FB /* MailAddress.swift in Sources */,
A198D2292056B384004CC838 /* SendViewDelegate.swift in Sources */,
47EABF2D2423C65F00774A93 /* AuthenticationView.swift in Sources */,
479011492289975D0057AB04 /* NoSecIconStyleKit.swift in Sources */,
F12060821DA552FC00F6EF37 /* MailHandlerDelegator.swift in Sources */,
474994022261E4E6000F8DA5 /* SimpleSendIcon.swift in Sources */,
......@@ -2562,6 +2596,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 0.8.33;
DEFINES_MODULE = NO;
DEVELOPMENT_TEAM = VJ9C93G68Y;
FRAMEWORK_SEARCH_PATHS = (
......@@ -2595,6 +2630,7 @@
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/enzevalos_iphone/OpenSSL/lib",
);
MARKETING_VERSION = 0.8.33;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......@@ -2639,6 +2675,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 0.8.33;
DEFINES_MODULE = NO;
DEVELOPMENT_TEAM = VJ9C93G68Y;
FRAMEWORK_SEARCH_PATHS = (
......@@ -2672,6 +2709,7 @@
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/enzevalos_iphone/OpenSSL/lib",
);
MARKETING_VERSION = 0.8.33;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......@@ -2830,6 +2868,7 @@
A135267F1D955BDF00D3BFE1 /* enzevalos_iphone.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
47D1BB052431F81C001F1EC9 /* enzevalos_iphone 10.xcdatamodel */,
670159DF240FB4E800797FA5 /* enzevalos_iphone 9.xcdatamodel */,
4751C6FD2344D169006B2A4D /* enzevalos_iphone 8.xcdatamodel */,
4751C6F0233CE1E4006B2A4D /* enzevalos_iphone 7.xcdatamodel */,
......@@ -2840,7 +2879,7 @@
47B2318A1F0D458100961B28 /* enzevalos_iphone 2.xcdatamodel */,
A13526801D955BDF00D3BFE1 /* enzevalos_iphone.xcdatamodel */,
);
currentVersion = 670159DF240FB4E800797FA5 /* enzevalos_iphone 9.xcdatamodel */;
currentVersion = 47D1BB052431F81C001F1EC9 /* enzevalos_iphone 10.xcdatamodel */;
path = enzevalos_iphone.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
......
......@@ -27,6 +27,7 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
......@@ -92,6 +93,20 @@
BlueprintName = "enzevalos_iphoneUITests"
ReferencedContainer = "container:enzevalos_iphone.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "SwiftUIOnboardingUITests/testDetailLogin2()">
</Test>
<Test
Identifier = "SwiftUIOnboardingUITests/testDetailLogin5()">
</Test>
<Test
Identifier = "SwiftUIOnboardingUITests/testHappyPath2()">
</Test>
<Test
Identifier = "SwiftUIOnboardingUITests/testHappyPath5()">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
</TestAction>
......
......@@ -25,24 +25,21 @@ import SystemConfiguration
import QAKit
import GTMAppAuth
import UserNotifications
import SwiftUI
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var newOnboarding = true
var newOnboarding=true
var inboxCoordinator: InboxCoordinator? = nil
var window: UIWindow?
var contactStore = CNContactStore()
var mailHandler = MailHandler()
//var dataHandler = DataHandler.handler
var orientationLock = UIInterfaceOrientationMask.allButUpsideDown
var counterBackgroundFetch = 0
var start: Date = Date()
let showAlertNoConnection = false
var inboxCoordinator: InboxCoordinator? = nil
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
......@@ -64,7 +61,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
self.window = UIWindow(frame: UIScreen.main.bounds)
if (newOnboarding)
{self.window?.rootViewController = UIHostingController(rootView: AuthenticationScreen())}
{
let avm=AuthenticationViewModel(authenticationModel: AuthenticationModel())
self.window?.rootViewController = UIHostingController(rootView: NewOnboardingView().environmentObject(avm))}
else
{self.window?.rootViewController = Onboarding.onboarding()}
self.window?.makeKeyAndVisible()
......@@ -255,10 +254,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
class func getAppDelegate() -> AppDelegate {
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else {
fatalError("No AppDelegate!")
}
return appDelegate
return UIApplication.shared.delegate as! AppDelegate
}
......@@ -318,14 +314,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func requestForAccess() {
self.requestForAccess(self.contactCheck)
}
func sceneDidEnterBackground(_ scene: UIScene) {
DataHandler.handler.saveContext()
}
func presentInboxViewController() {
//presentSwiftUITest()
guard let vc = self.window?.rootViewController as? UINavigationController else {
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "usericon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "gluecklich.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "1024px-Google_\"G\"_Logo.svg.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "stornieren.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "schild.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "image.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
// AuthenticationModel.swift
// enzevalos_iphone
//
// Created by SWP Usable Security für Smartphones on 10.03.20.
// Created by hanneh00 on 18.03.20.
// Copyright © 2020 fu-berlin. All rights reserved.
//
......@@ -68,6 +68,7 @@ class AuthenticationModel: NSObject {
func checkIMAPConfig(mailAccount: MailAccount, _ callback: AuthenticationCallback) {
imapConfigurationSuccessful = false
let mailSession: MailSession = setupIMAPSession(mailAccount: mailAccount, callback: callback)
print(mailSession.server.port)
currentIMAP = mailSession
if extendedValidation && mailSession.startTestingServerConfig(){
imapConfigurationSuccessful = true
......@@ -194,3 +195,4 @@ class AuthenticationCallback {
}
}
}
......@@ -106,43 +106,3 @@ struct AuthenticationScreen: View {
return (self.viewModel.errorMessage != nil) && (!self.viewModel.errorMessage!.isEmpty)
}
}
struct ActivityIndicator: UIViewRepresentable {
@Binding var isAnimating: Bool
let style: UIActivityIndicatorView.Style
func makeUIView(context: UIViewRepresentableContext<ActivityIndicator>) -> UIActivityIndicatorView {
return UIActivityIndicatorView(style: style)
}
func updateUIView(_ uiView: UIActivityIndicatorView, context: UIViewRepresentableContext<ActivityIndicator>) {
isAnimating ? uiView.startAnimating() : uiView.stopAnimating()
}
}
struct LoadingView<Content>: View where Content: View {
@Binding var isShowing: Bool
var content: () -> Content
var body: some View {
ZStack(alignment: .center) {
self.content()
.disabled(self.isShowing)
.blur(radius: self.isShowing ? 3 : 0)
VStack {
Text("Loading...")
ActivityIndicator(isAnimating: .constant(true), style: .large)
}
.frame(width: UIScreen.main.bounds.size.width / 2,
height: UIScreen.main.bounds.size.height / 5)
.background(Color.secondary.colorInvert())
.foregroundColor(Color.primary)
.cornerRadius(20)
.opacity(self.isShowing ? 1 : 0)
}
}
}
//
// AuthenticationView.swift
// enzevalos_iphone
//
// Created by hanneh00 on 17.03.20.
// Copyright © 2020 fu-berlin. All rights reserved.
//
import SwiftUI
struct AuthenticationView: View{
@State private var loggingIn:Bool = false
let imageSize : CGFloat = 35
var onBack: ()->Void
var onClick: ()->Void
@State private var login: String = ""
@State private var password: String = ""
@State private var username: String = ""
@State private var imapServer: String = ""
@State private var imapPort: String = ""
@State private var smtpServer: String = ""
@State private var smtpPort: String = ""
@State private var imapEncryption = 0
@State private var smtpEncryption = 0
@State private var smtpOrImap:Bool = false
var encryptionOptions = ["Plaintext", "StartTLS", "TLS/SSL"]
//@EnvironmentObject var viewModel:AuthenticationViewModel
@ObservedObject private var viewModel = AuthenticationViewModel(authenticationModel: AuthenticationModel.instance)
@ObservedObject private var keyboard = KeyboardResponder()
//whether the next-button is enabled (correct email format and all necessary fields used)
var buttonEnabled: Bool {
let advancedCorrect = !imapServer.isEmpty && !imapPort.isEmpty && !smtpServer.isEmpty && !smtpPort.isEmpty
let regex = try! NSRegularExpression(pattern: """
(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])
""")
let emailCorrectFormat = regex.firstMatch(in: login, options: [], range: NSRange(location: 0, length: login.utf16.count)) != nil
return (!login.isEmpty && !password.isEmpty && emailCorrectFormat)&&(!viewModel.isDetailedAuthentication || advancedCorrect)
}
var body: some View {
VStack{
if self.viewModel.errorMessage != nil && !self.viewModel.errorMessage!.isEmpty {
VStack{
Text(self.viewModel.errorMessage!)
.foregroundColor(Color.white)
}.padding(.all, 20)
.clipShape(RoundedRectangle(cornerRadius: 8))
.background(Color.red)
}
LoadingView(isShowing: self.$viewModel.showProgressSpinner) {
VStack{
LoginCredentialSection(email: self.$login, password: self.$password)