From 5eca31aaa25f198580c2f643ff2fe9c669ce58b9 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Mon, 22 Jan 2024 11:48:44 +1100 Subject: [PATCH] refactor & clean --- Session.xcodeproj/project.pbxproj | 56 ++++---- .../ExpandingAttachmentsButton.swift | 1 + Session/Home/HomeVC.swift | 2 +- Session/Meta/AppDelegate.swift | 4 +- Session/Meta/Session-Info.plist | 2 + ...NameView.swift => DisplayNameScreen.swift} | 6 +- ...{LandingView.swift => LandingScreen.swift} | 8 +- ...ountView.swift => LoadAccountScreen.swift} | 6 +- ...{LoadingView.swift => LoadingScreen.swift} | 6 +- .../{PNModeView.swift => PNModeScreen.swift} | 6 +- Session/Onboarding/PNOptionView.swift | 122 ------------------ Session/Settings/QRCodeScreem.swift | 13 ++ ...iew.swift => RecoveryPasswordScreen.swift} | 4 +- Session/Settings/SettingsViewModel.swift | 2 +- 14 files changed, 66 insertions(+), 172 deletions(-) rename Session/Onboarding/{DisplayNameView.swift => DisplayNameScreen.swift} (97%) rename Session/Onboarding/{LandingView.swift => LandingScreen.swift} (98%) rename Session/Onboarding/{LoadAccountView.swift => LoadAccountScreen.swift} (98%) rename Session/Onboarding/{LoadingView.swift => LoadingScreen.swift} (97%) rename Session/Onboarding/{PNModeView.swift => PNModeScreen.swift} (98%) delete mode 100644 Session/Onboarding/PNOptionView.swift create mode 100644 Session/Settings/QRCodeScreem.swift rename Session/Settings/{RecoveryPasswordView.swift => RecoveryPasswordScreen.swift} (98%) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 7e2221fe2..02e431629 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -120,12 +120,12 @@ 7B81682828B310D50069F315 /* _007_HomeQueryOptimisationIndexes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B81682728B310D50069F315 /* _007_HomeQueryOptimisationIndexes.swift */; }; 7B81682A28B6F1420069F315 /* ReactionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B81682928B6F1420069F315 /* ReactionResponse.swift */; }; 7B81682C28B72F480069F315 /* PendingChange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B81682B28B72F480069F315 /* PendingChange.swift */; }; - 7B87EF422A8D9840002A0E8F /* DisplayNameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF412A8D9840002A0E8F /* DisplayNameView.swift */; }; + 7B87EF422A8D9840002A0E8F /* DisplayNameScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF412A8D9840002A0E8F /* DisplayNameScreen.swift */; }; 7B87EF442A8DA720002A0E8F /* SessionTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF432A8DA720002A0E8F /* SessionTextField.swift */; }; - 7B87EF462A8DDA8E002A0E8F /* PNModeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF452A8DDA8E002A0E8F /* PNModeView.swift */; }; - 7B87EF482A8DFBBF002A0E8F /* RecoveryPasswordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF472A8DFBBF002A0E8F /* RecoveryPasswordView.swift */; }; - 7B87EF4A2A92DFB4002A0E8F /* LoadAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF492A92DFB4002A0E8F /* LoadAccountView.swift */; }; - 7B87EF4C2A933355002A0E8F /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF4B2A933355002A0E8F /* LoadingView.swift */; }; + 7B87EF462A8DDA8E002A0E8F /* PNModeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF452A8DDA8E002A0E8F /* PNModeScreen.swift */; }; + 7B87EF482A8DFBBF002A0E8F /* RecoveryPasswordScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF472A8DFBBF002A0E8F /* RecoveryPasswordScreen.swift */; }; + 7B87EF4A2A92DFB4002A0E8F /* LoadAccountScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF492A92DFB4002A0E8F /* LoadAccountScreen.swift */; }; + 7B87EF4C2A933355002A0E8F /* LoadingScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87EF4B2A933355002A0E8F /* LoadingScreen.swift */; }; 7B8914772A7CAAE200A4C627 /* SessionHostingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8914762A7CAAE200A4C627 /* SessionHostingViewController.swift */; }; 7B8C44C528B49DDA00FBE25F /* NewConversationVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8C44C428B49DDA00FBE25F /* NewConversationVC.swift */; }; 7B8D5FC428332600008324D9 /* VisibleMessage+Reaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8D5FC328332600008324D9 /* VisibleMessage+Reaction.swift */; }; @@ -161,7 +161,7 @@ 7BD687D12A5D0D1200D8E455 /* MessageInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BD687D02A5D0D1200D8E455 /* MessageInfoView.swift */; }; 7BD976972A776C76001B466F /* SessionCarouselView+SwiftUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BE2701D2A64C11500CEB71A /* SessionCarouselView+SwiftUI.swift */; }; 7BDCFC08242186E700641C39 /* NotificationServiceExtensionContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BDCFC07242186E700641C39 /* NotificationServiceExtensionContext.swift */; }; - 7BDE2A982A8B122900AE4393 /* LandingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BDE2A972A8B122900AE4393 /* LandingView.swift */; }; + 7BDE2A982A8B122900AE4393 /* LandingScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BDE2A972A8B122900AE4393 /* LandingScreen.swift */; }; 7BDE2A9A2A8C59CF00AE4393 /* AttributedText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BDE2A992A8C59CF00AE4393 /* AttributedText.swift */; }; 7BF570D32A9C1F9300DB013E /* Toast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BF570D22A9C1F9300DB013E /* Toast.swift */; }; 7BF8D1FB2A70AF57005F1D6E /* SwiftUI+Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BF8D1FA2A70AF57005F1D6E /* SwiftUI+Theme.swift */; }; @@ -169,6 +169,7 @@ 7BFD1A8A2745C4F000FB91B9 /* Permissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BFD1A892745C4F000FB91B9 /* Permissions.swift */; }; 7BFD1A8C2747150E00FB91B9 /* TurnServerInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BFD1A8B2747150E00FB91B9 /* TurnServerInfo.swift */; }; 7BFD1A972747689000FB91B9 /* Session-Turn-Server in Resources */ = {isa = PBXBuildFile; fileRef = 7BFD1A962747689000FB91B9 /* Session-Turn-Server */; }; + 946B34472B5DF0B7004CB4A3 /* QRCodeScreem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 946B34462B5DF0B7004CB4A3 /* QRCodeScreem.swift */; }; 99978E3F7A80275823CA9014 /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_SessionNotificationServiceExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29E827FDF6C1032BB985740C /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_SessionNotificationServiceExtension.framework */; }; A11CD70D17FA230600A2D1B1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A11CD70C17FA230600A2D1B1 /* QuartzCore.framework */; }; A163E8AB16F3F6AA0094D68B /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A163E8AA16F3F6A90094D68B /* Security.framework */; }; @@ -302,7 +303,6 @@ C331FFE82558FB0000070591 /* TextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C3CF8824D8EED300E1CCE7 /* TextView.swift */; }; C331FFE92558FB0000070591 /* Separator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8BB82B82394911B00BA5194 /* Separator.swift */; }; C331FFF32558FF0300070591 /* PathStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B879D44A247E1D9200DB3608 /* PathStatusView.swift */; }; - C331FFF42558FF0300070591 /* PNOptionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C353F8F8244809150011121A /* PNOptionView.swift */; }; C331FFFE2558FF3B00070591 /* FullConversationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8BB82AA238F669C00BA5194 /* FullConversationCell.swift */; }; C33FD9AF255A548A00E217F9 /* SignalUtilitiesKit.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FD9AD255A548A00E217F9 /* SignalUtilitiesKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FD9B3255A548A00E217F9 /* SignalUtilitiesKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C33FD9AB255A548A00E217F9 /* SignalUtilitiesKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -1246,12 +1246,12 @@ 7B81682728B310D50069F315 /* _007_HomeQueryOptimisationIndexes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = _007_HomeQueryOptimisationIndexes.swift; sourceTree = ""; }; 7B81682928B6F1420069F315 /* ReactionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionResponse.swift; sourceTree = ""; }; 7B81682B28B72F480069F315 /* PendingChange.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PendingChange.swift; sourceTree = ""; }; - 7B87EF412A8D9840002A0E8F /* DisplayNameView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayNameView.swift; sourceTree = ""; }; + 7B87EF412A8D9840002A0E8F /* DisplayNameScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayNameScreen.swift; sourceTree = ""; }; 7B87EF432A8DA720002A0E8F /* SessionTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionTextField.swift; sourceTree = ""; }; - 7B87EF452A8DDA8E002A0E8F /* PNModeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PNModeView.swift; sourceTree = ""; }; - 7B87EF472A8DFBBF002A0E8F /* RecoveryPasswordView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecoveryPasswordView.swift; sourceTree = ""; }; - 7B87EF492A92DFB4002A0E8F /* LoadAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadAccountView.swift; sourceTree = ""; }; - 7B87EF4B2A933355002A0E8F /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = ""; }; + 7B87EF452A8DDA8E002A0E8F /* PNModeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PNModeScreen.swift; sourceTree = ""; }; + 7B87EF472A8DFBBF002A0E8F /* RecoveryPasswordScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecoveryPasswordScreen.swift; sourceTree = ""; }; + 7B87EF492A92DFB4002A0E8F /* LoadAccountScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadAccountScreen.swift; sourceTree = ""; }; + 7B87EF4B2A933355002A0E8F /* LoadingScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingScreen.swift; sourceTree = ""; }; 7B8914762A7CAAE200A4C627 /* SessionHostingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionHostingViewController.swift; sourceTree = ""; }; 7B8C44C428B49DDA00FBE25F /* NewConversationVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewConversationVC.swift; sourceTree = ""; }; 7B8D5FC328332600008324D9 /* VisibleMessage+Reaction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VisibleMessage+Reaction.swift"; sourceTree = ""; }; @@ -1290,7 +1290,7 @@ 7BD687D22A5D283200D8E455 /* build_libSession_util.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build_libSession_util.sh; sourceTree = ""; }; 7BDCFC0424206E7300641C39 /* SessionNotificationServiceExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SessionNotificationServiceExtension.entitlements; sourceTree = ""; }; 7BDCFC07242186E700641C39 /* NotificationServiceExtensionContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationServiceExtensionContext.swift; sourceTree = ""; }; - 7BDE2A972A8B122900AE4393 /* LandingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandingView.swift; sourceTree = ""; }; + 7BDE2A972A8B122900AE4393 /* LandingScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandingScreen.swift; sourceTree = ""; }; 7BDE2A992A8C59CF00AE4393 /* AttributedText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttributedText.swift; sourceTree = ""; }; 7BE2701D2A64C11500CEB71A /* SessionCarouselView+SwiftUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SessionCarouselView+SwiftUI.swift"; sourceTree = ""; }; 7BF570D22A9C1F9300DB013E /* Toast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toast.swift; sourceTree = ""; }; @@ -1306,6 +1306,7 @@ 8E946CB54A221018E23599DE /* Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit.debug.xcconfig"; path = "Target Support Files/Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit/Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit.debug.xcconfig"; sourceTree = ""; }; 92E8569C96285EE3CDB5960D /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SignalUtilitiesKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SignalUtilitiesKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 93359C81CF2660040B7CD106 /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SessionUtilitiesKit_SessionUtilitiesKitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SessionUtilitiesKit_SessionUtilitiesKitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 946B34462B5DF0B7004CB4A3 /* QRCodeScreem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCodeScreem.swift; sourceTree = ""; }; A11CD70C17FA230600A2D1B1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; A163E8AA16F3F6A90094D68B /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; A1C32D4D17A0652C000A904E /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; @@ -1473,7 +1474,6 @@ C352A35A2557824E00338F3E /* AttachmentUploadJob.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttachmentUploadJob.swift; sourceTree = ""; }; C352A36C2557858D00338F3E /* NSTimer+Proxying.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+Proxying.m"; sourceTree = ""; }; C352A3762557859C00338F3E /* NSTimer+Proxying.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSTimer+Proxying.h"; sourceTree = ""; }; - C353F8F8244809150011121A /* PNOptionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PNOptionView.swift; sourceTree = ""; }; C3548F0724456AB6009433A8 /* UIView+Wrapping.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Wrapping.swift"; sourceTree = ""; }; C354E75923FE2A7600CE22E3 /* BaseVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseVC.swift; sourceTree = ""; }; C35D0DB425AE5F1200B6BF49 /* UIEdgeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIEdgeInsets.swift; sourceTree = ""; }; @@ -3026,14 +3026,13 @@ C360968D25AD16B4008B62B2 /* Onboarding */ = { isa = PBXGroup; children = ( - C353F8F8244809150011121A /* PNOptionView.swift */, B85357BE23A1AE0800AAF6CD /* SeedReminderView.swift */, B8D0A26825E4A2C200C1835E /* Onboarding.swift */, - 7BDE2A972A8B122900AE4393 /* LandingView.swift */, - 7B87EF412A8D9840002A0E8F /* DisplayNameView.swift */, - 7B87EF452A8DDA8E002A0E8F /* PNModeView.swift */, - 7B87EF492A92DFB4002A0E8F /* LoadAccountView.swift */, - 7B87EF4B2A933355002A0E8F /* LoadingView.swift */, + 7BDE2A972A8B122900AE4393 /* LandingScreen.swift */, + 7B87EF412A8D9840002A0E8F /* DisplayNameScreen.swift */, + 7B87EF452A8DDA8E002A0E8F /* PNModeScreen.swift */, + 7B87EF492A92DFB4002A0E8F /* LoadAccountScreen.swift */, + 7B87EF4B2A933355002A0E8F /* LoadingScreen.swift */, ); path = Onboarding; sourceTree = ""; @@ -3053,7 +3052,8 @@ C360969125AD1765008B62B2 /* Settings */ = { isa = PBXGroup; children = ( - 7B87EF472A8DFBBF002A0E8F /* RecoveryPasswordView.swift */, + 7B87EF472A8DFBBF002A0E8F /* RecoveryPasswordScreen.swift */, + 946B34462B5DF0B7004CB4A3 /* QRCodeScreem.swift */, FD37E9CD28A1E682003AE748 /* Views */, FD71162D28E168C700B47552 /* SettingsViewModel.swift */, B886B4A62398B23E00211ABE /* QRCodeVC.swift */, @@ -6235,7 +6235,7 @@ 45C0DC1E1E69011F00E04C47 /* UIStoryboard+OWS.swift in Sources */, B835246E25C38ABF0089A44F /* ConversationVC.swift in Sources */, 7B7037432834B81F000DCF35 /* ReactionContainerView.swift in Sources */, - 7B87EF422A8D9840002A0E8F /* DisplayNameView.swift in Sources */, + 7B87EF422A8D9840002A0E8F /* DisplayNameScreen.swift in Sources */, 7BBBDC462875600700747E59 /* DocumentTitleViewController.swift in Sources */, FD71163F28E2C82C00B47552 /* SessionHeaderView.swift in Sources */, 7B8914772A7CAAE200A4C627 /* SessionHostingViewController.swift in Sources */, @@ -6250,6 +6250,7 @@ FD37EA1928AC5CCA003AE748 /* NotificationSoundViewModel.swift in Sources */, FD71163E28E2C82900B47552 /* SessionCell.swift in Sources */, 4CA485BB2232339F004B9E7D /* PhotoCaptureViewController.swift in Sources */, + 946B34472B5DF0B7004CB4A3 /* QRCodeScreem.swift in Sources */, C328254925CA60E60062D0A7 /* ContextMenuVC+Action.swift in Sources */, FD71164628E2CC1300B47552 /* SessionHighlightingBackgroundLabel.swift in Sources */, 4542DF54208D40AC007B4E76 /* LoadingViewController.swift in Sources */, @@ -6262,8 +6263,7 @@ FD37EA1728AC5605003AE748 /* NotificationContentViewModel.swift in Sources */, B886B4A72398B23E00211ABE /* QRCodeVC.swift in Sources */, 4C586926224FAB83003FD070 /* AVAudioSession+OWS.m in Sources */, - 7B87EF4C2A933355002A0E8F /* LoadingView.swift in Sources */, - C331FFF42558FF0300070591 /* PNOptionView.swift in Sources */, + 7B87EF4C2A933355002A0E8F /* LoadingScreen.swift in Sources */, 7BB92B3F28C825FD0082762F /* NewConversationViewModel.swift in Sources */, 4C4AE6A1224AF35700D4AF6F /* SendMediaNavigationController.swift in Sources */, B82149C125D605C6009C0F2A /* InfoBanner.swift in Sources */, @@ -6307,18 +6307,18 @@ C328250F25CA06020062D0A7 /* VoiceMessageView.swift in Sources */, 3488F9362191CC4000E524CC /* MediaView.swift in Sources */, B8569AC325CB5D2900DBA3DB /* ConversationVC+Interaction.swift in Sources */, - 7B87EF462A8DDA8E002A0E8F /* PNModeView.swift in Sources */, + 7B87EF462A8DDA8E002A0E8F /* PNModeScreen.swift in Sources */, 3496955C219B605E00DCFE74 /* ImagePickerController.swift in Sources */, C31D1DE32521718E005D4DA8 /* UserSelectionVC.swift in Sources */, 34A6C28021E503E700B5B12E /* OWSImagePickerController.swift in Sources */, C31A6C5C247F2CF3001123EF /* CGRect+Utilities.swift in Sources */, - 7BDE2A982A8B122900AE4393 /* LandingView.swift in Sources */, + 7BDE2A982A8B122900AE4393 /* LandingScreen.swift in Sources */, FD4B200E283492210034334B /* InsetLockableTableView.swift in Sources */, B8269D3325C7A8C600488AB4 /* InputViewButton.swift in Sources */, FD12A8472AD63C3400EEBA0D /* PagedObservationSource.swift in Sources */, B8269D3D25C7B34D00488AB4 /* InputTextView.swift in Sources */, 7B0EFDF0275084AA00FFAAE7 /* CallMessageCell.swift in Sources */, - 7B87EF4A2A92DFB4002A0E8F /* LoadAccountView.swift in Sources */, + 7B87EF4A2A92DFB4002A0E8F /* LoadAccountScreen.swift in Sources */, C3AAFFF225AE99710089E6DD /* AppDelegate.swift in Sources */, B8BB82A5238F627000BA5194 /* HomeVC.swift in Sources */, 4521C3C01F59F3BA00B4C582 /* TextFieldHelper.swift in Sources */, @@ -6333,7 +6333,7 @@ B85357BF23A1AE0800AAF6CD /* SeedReminderView.swift in Sources */, FD716E6C28505E1C00C96BF4 /* MessageRequestsViewModel.swift in Sources */, C35E8AAE2485E51D00ACB629 /* IP2Country.swift in Sources */, - 7B87EF482A8DFBBF002A0E8F /* RecoveryPasswordView.swift in Sources */, + 7B87EF482A8DFBBF002A0E8F /* RecoveryPasswordScreen.swift in Sources */, B835249B25C3AB650089A44F /* VisibleMessageCell.swift in Sources */, B894D0752339EDCF00B4D94D /* NukeDataModal.swift in Sources */, 7B93D07727CF1A8A00811CB6 /* MockDataGenerator.swift in Sources */, diff --git a/Session/Conversations/Input View/ExpandingAttachmentsButton.swift b/Session/Conversations/Input View/ExpandingAttachmentsButton.swift index d77ede7a0..7509708d5 100644 --- a/Session/Conversations/Input View/ExpandingAttachmentsButton.swift +++ b/Session/Conversations/Input View/ExpandingAttachmentsButton.swift @@ -150,6 +150,7 @@ final class ExpandingAttachmentsButton: UIView, InputViewButtonDelegate { // MARK: Convenience private func container(for button: InputViewButton) -> UIView { let result = UIView() + result.isAccessibilityElement = true result.addSubview(button) result.set(.width, to: InputViewButton.expandedSize) result.set(.height, to: InputViewButton.expandedSize) diff --git a/Session/Home/HomeVC.swift b/Session/Home/HomeVC.swift index c9f942da7..eca3945b1 100644 --- a/Session/Home/HomeVC.swift +++ b/Session/Home/HomeVC.swift @@ -808,7 +808,7 @@ final class HomeVC: BaseVC, SessionUtilRespondingViewController, UITableViewData // MARK: - Interaction func handleContinueButtonTapped(from seedReminderView: SeedReminderView) { - if let recoveryPasswordView: RecoveryPasswordView = try? RecoveryPasswordView() { + if let recoveryPasswordView: RecoveryPasswordScreen = try? RecoveryPasswordScreen() { let viewController: SessionHostingViewController = SessionHostingViewController(rootView: recoveryPasswordView) viewController.setNavBarTitle("recovery_password_title".localized()) self.navigationController?.pushViewController(viewController, animated: true) diff --git a/Session/Meta/AppDelegate.swift b/Session/Meta/AppDelegate.swift index f9b1933c4..a0f74afd8 100644 --- a/Session/Meta/AppDelegate.swift +++ b/Session/Meta/AppDelegate.swift @@ -604,7 +604,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD switch Onboarding.State.current { case .newUser: DispatchQueue.main.async { - let viewController = SessionHostingViewController(rootView: LandingView()) + let viewController = SessionHostingViewController(rootView: LandingScreen()) viewController.setUpNavBarSessionIcon() populateHomeScreenTimer.invalidate() rootViewControllerSetupComplete(viewController) @@ -612,7 +612,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD case .missingName: DispatchQueue.main.async { - let viewController = SessionHostingViewController(rootView: DisplayNameView(flow: .register)) + let viewController = SessionHostingViewController(rootView: DisplayNameScreen(flow: .register)) viewController.setUpNavBarSessionIcon() populateHomeScreenTimer.invalidate() rootViewControllerSetupComplete(viewController) diff --git a/Session/Meta/Session-Info.plist b/Session/Meta/Session-Info.plist index 6e30c5bc2..d97994020 100644 --- a/Session/Meta/Session-Info.plist +++ b/Session/Meta/Session-Info.plist @@ -57,6 +57,8 @@ NSAppTransportSecurity + NSAllowsArbitraryLoads + NSExceptionDomains seed1.getsession.org diff --git a/Session/Onboarding/DisplayNameView.swift b/Session/Onboarding/DisplayNameScreen.swift similarity index 97% rename from Session/Onboarding/DisplayNameView.swift rename to Session/Onboarding/DisplayNameScreen.swift index 22f786d17..df950caf8 100644 --- a/Session/Onboarding/DisplayNameView.swift +++ b/Session/Onboarding/DisplayNameScreen.swift @@ -5,7 +5,7 @@ import SessionUIKit import SessionMessagingKit import SignalUtilitiesKit -struct DisplayNameView: View { +struct DisplayNameScreen: View { @EnvironmentObject var host: HostWrapper @State private var displayName: String = "" @@ -118,7 +118,7 @@ struct DisplayNameView: View { } // Need to get the PN mode if registering - let viewController: SessionHostingViewController = SessionHostingViewController(rootView: PNModeView(flow: flow)) + let viewController: SessionHostingViewController = SessionHostingViewController(rootView: PNModeScreen(flow: flow)) viewController.setUpNavBarSessionIcon() self.host.controller?.navigationController?.pushViewController(viewController, animated: true) } @@ -126,6 +126,6 @@ struct DisplayNameView: View { struct DisplayNameView_Previews: PreviewProvider { static var previews: some View { - DisplayNameView(flow: .register) + DisplayNameScreen(flow: .register) } } diff --git a/Session/Onboarding/LandingView.swift b/Session/Onboarding/LandingScreen.swift similarity index 98% rename from Session/Onboarding/LandingView.swift rename to Session/Onboarding/LandingScreen.swift index 4fa2b8841..3e732369d 100644 --- a/Session/Onboarding/LandingView.swift +++ b/Session/Onboarding/LandingScreen.swift @@ -6,7 +6,7 @@ import SessionUIKit import SignalUtilitiesKit import SessionUtilitiesKit -struct LandingView: View { +struct LandingScreen: View { @EnvironmentObject var host: HostWrapper var body: some View { @@ -115,7 +115,7 @@ struct LandingView: View { x25519KeyPair: x25519KeyPair ) - let viewController: SessionHostingViewController = SessionHostingViewController(rootView: DisplayNameView(flow: .register)) + let viewController: SessionHostingViewController = SessionHostingViewController(rootView: DisplayNameScreen(flow: .register)) viewController.setUpNavBarSessionIcon() self.host.controller?.navigationController?.pushViewController(viewController, animated: true) } @@ -123,7 +123,7 @@ struct LandingView: View { private func restore() { Onboarding.Flow.register.unregister() - let viewController: SessionHostingViewController = SessionHostingViewController(rootView: LoadAccountView()) + let viewController: SessionHostingViewController = SessionHostingViewController(rootView: LoadAccountScreen()) viewController.setNavBarTitle("onboarding_load_account_title".localized()) self.host.controller?.navigationController?.pushViewController(viewController, animated: true) } @@ -234,6 +234,6 @@ struct FakeChat: View { struct LandingView_Previews: PreviewProvider { static var previews: some View { - LandingView() + LandingScreen() } } diff --git a/Session/Onboarding/LoadAccountView.swift b/Session/Onboarding/LoadAccountScreen.swift similarity index 98% rename from Session/Onboarding/LoadAccountView.swift rename to Session/Onboarding/LoadAccountScreen.swift index db2c4f23f..de2ca4059 100644 --- a/Session/Onboarding/LoadAccountView.swift +++ b/Session/Onboarding/LoadAccountScreen.swift @@ -6,7 +6,7 @@ import SignalUtilitiesKit import SessionUtilitiesKit import AVFoundation -struct LoadAccountView: View { +struct LoadAccountScreen: View { @EnvironmentObject var host: HostWrapper @State var tabIndex = 0 @@ -63,7 +63,7 @@ struct LoadAccountView: View { ) // Otherwise continue on to request push notifications permissions - let viewController: SessionHostingViewController = SessionHostingViewController(rootView: PNModeView(flow: .link)) + let viewController: SessionHostingViewController = SessionHostingViewController(rootView: PNModeScreen(flow: .link)) viewController.setUpNavBarSessionIcon() self.host.controller?.navigationController?.pushViewController(viewController, animated: true) } @@ -329,6 +329,6 @@ struct ScanQRCodeView: View { struct LoadAccountView_Previews: PreviewProvider { static var previews: some View { - LoadAccountView() + LoadAccountScreen() } } diff --git a/Session/Onboarding/LoadingView.swift b/Session/Onboarding/LoadingScreen.swift similarity index 97% rename from Session/Onboarding/LoadingView.swift rename to Session/Onboarding/LoadingScreen.swift index 4905e3978..368420b58 100644 --- a/Session/Onboarding/LoadingView.swift +++ b/Session/Onboarding/LoadingScreen.swift @@ -5,7 +5,7 @@ import SessionUIKit import SessionMessagingKit import SignalUtilitiesKit -struct LoadingView: View { +struct LoadingScreen: View { @EnvironmentObject var host: HostWrapper @State var percentage: Double = 0.0 @@ -86,7 +86,7 @@ struct LoadingView: View { private func finishLoading(success: Bool) { guard success else { - let viewController: SessionHostingViewController = SessionHostingViewController(rootView: DisplayNameView(flow: flow)) + let viewController: SessionHostingViewController = SessionHostingViewController(rootView: DisplayNameScreen(flow: flow)) viewController.setUpNavBarSessionIcon() if let navigationController = self.host.controller?.navigationController { let index = navigationController.viewControllers.count - 1 @@ -169,6 +169,6 @@ struct CircularProgressView: View { struct LoadingView_Previews: PreviewProvider { static var previews: some View { - LoadingView(flow: .link, preview: true) + LoadingScreen(flow: .link, preview: true) } } diff --git a/Session/Onboarding/PNModeView.swift b/Session/Onboarding/PNModeScreen.swift similarity index 98% rename from Session/Onboarding/PNModeView.swift rename to Session/Onboarding/PNModeScreen.swift index db9d742a2..37cb67842 100644 --- a/Session/Onboarding/PNModeView.swift +++ b/Session/Onboarding/PNModeScreen.swift @@ -12,7 +12,7 @@ enum PNMode { case slow } -struct PNModeView: View { +struct PNModeScreen: View { @EnvironmentObject var host: HostWrapper @State private var currentSelection: PNMode = .fast @@ -141,7 +141,7 @@ struct PNModeView: View { } // If we don't have one then show a loading indicator and try to retrieve the existing name - let viewController: SessionHostingViewController = SessionHostingViewController(rootView: LoadingView(flow: flow)) + let viewController: SessionHostingViewController = SessionHostingViewController(rootView: LoadingScreen(flow: flow)) viewController.setUpNavBarSessionIcon() self.host.controller?.navigationController?.pushViewController(viewController, animated: true) } @@ -239,6 +239,6 @@ struct PNOptionView: View { struct PNModeView_Previews: PreviewProvider { static var previews: some View { - PNModeView(flow: .register) + PNModeScreen(flow: .register) } } diff --git a/Session/Onboarding/PNOptionView.swift b/Session/Onboarding/PNOptionView.swift deleted file mode 100644 index 3f4f567bc..000000000 --- a/Session/Onboarding/PNOptionView.swift +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. - -import UIKit -import SessionUIKit - -final class OptionView: UIView { - private let title: String - private let explanation: String - private let delegate: OptionViewDelegate - private let isRecommended: Bool - - var isSelected = false { didSet { handleIsSelectedChanged() } } - - private static let cornerRadius: CGFloat = 8 - - init(title: String, explanation: String, delegate: OptionViewDelegate, isRecommended: Bool = false) { - self.title = title - self.explanation = explanation - self.delegate = delegate - self.isRecommended = isRecommended - - super.init(frame: CGRect.zero) - - setUpViewHierarchy() - } - - override init(frame: CGRect) { - preconditionFailure("Use init(string:explanation:) instead.") - } - - required init?(coder: NSCoder) { - preconditionFailure("Use init(string:explanation:) instead.") - } - - private func setUpViewHierarchy() { - themeBackgroundColor = .backgroundSecondary - - // Round corners - layer.cornerRadius = OptionView.cornerRadius - - // Set up border - themeBorderColor = .borderSeparator - layer.borderWidth = 1 - - // Set up shadow - themeShadowColor = .black - layer.shadowOffset = CGSize(width: 0, height: 0.8) - - ThemeManager.onThemeChange(observer: self) { [weak self] theme, _ in - switch theme.interfaceStyle { - case .light: - self?.layer.shadowOpacity = 0.16 - self?.layer.shadowRadius = 4 - - default: - self?.layer.shadowOpacity = 1 - self?.layer.shadowRadius = 6 - } - } - - // Set up title label - let titleLabel: UILabel = UILabel() - titleLabel.font = .boldSystemFont(ofSize: Values.mediumFontSize) - titleLabel.text = title - titleLabel.themeTextColor = .textPrimary - titleLabel.lineBreakMode = .byWordWrapping - titleLabel.numberOfLines = 0 - - // Set up explanation label - let explanationLabel: UILabel = UILabel() - explanationLabel.font = .systemFont(ofSize: Values.verySmallFontSize) - explanationLabel.text = explanation - explanationLabel.themeTextColor = .textPrimary - explanationLabel.lineBreakMode = .byWordWrapping - explanationLabel.numberOfLines = 0 - - // Set up stack view - let stackView = UIStackView(arrangedSubviews: [ titleLabel, explanationLabel ]) - stackView.axis = .vertical - stackView.spacing = 4 - stackView.alignment = .fill - addSubview(stackView) - - stackView.pin(.leading, to: .leading, of: self, withInset: 12) - stackView.pin(.top, to: .top, of: self, withInset: 12) - self.pin(.trailing, to: .trailing, of: stackView, withInset: 12) - self.pin(.bottom, to: .bottom, of: stackView, withInset: 12) - - // Set up recommended label if needed - if isRecommended { - let recommendedLabel: UILabel = UILabel() - recommendedLabel.font = .boldSystemFont(ofSize: Values.smallFontSize) - recommendedLabel.text = "vc_pn_mode_recommended_option_tag".localized() - recommendedLabel.themeTextColor = .primary - stackView.addArrangedSubview(recommendedLabel) - } - - // Set up tap gesture recognizer - let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTap)) - addGestureRecognizer(tapGestureRecognizer) - } - - @objc private func handleTap() { - isSelected = !isSelected - } - - private func handleIsSelectedChanged() { - UIView.animate(withDuration: 0.3) { [weak self] in - self?.themeBorderColor = (self?.isSelected == true ? .primary : .borderSeparator) - self?.themeShadowColor = (self?.isSelected == true ? .primary : .black) - } - - // Notify delegate - if isSelected { delegate.optionViewDidActivate(self) } - } -} - -// MARK: - Option View Delegate - -protocol OptionViewDelegate { - func optionViewDidActivate(_ optionView: OptionView) -} diff --git a/Session/Settings/QRCodeScreem.swift b/Session/Settings/QRCodeScreem.swift new file mode 100644 index 000000000..608069f81 --- /dev/null +++ b/Session/Settings/QRCodeScreem.swift @@ -0,0 +1,13 @@ +// Copyright © 2024 Rangeproof Pty Ltd. All rights reserved. + +import SwiftUI + +struct QRCodeScreen: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +#Preview { + QRCodeScreen() +} diff --git a/Session/Settings/RecoveryPasswordView.swift b/Session/Settings/RecoveryPasswordScreen.swift similarity index 98% rename from Session/Settings/RecoveryPasswordView.swift rename to Session/Settings/RecoveryPasswordScreen.swift index b8a646770..e1a68d751 100644 --- a/Session/Settings/RecoveryPasswordView.swift +++ b/Session/Settings/RecoveryPasswordScreen.swift @@ -5,7 +5,7 @@ import SessionUIKit import SignalUtilitiesKit import SessionUtilitiesKit -struct RecoveryPasswordView: View { +struct RecoveryPasswordScreen: View { @EnvironmentObject var host: HostWrapper @State private var copied: Bool = false @@ -282,6 +282,6 @@ struct RecoveryPasswordView: View { struct RecoveryPasswordView_Previews: PreviewProvider { static var previews: some View { - RecoveryPasswordView(hardcode: "Voyage urban toyed maverick peculiar tuxedo penguin tree grass building listen speak withdraw terminal plane") + RecoveryPasswordScreen(hardcode: "Voyage urban toyed maverick peculiar tuxedo penguin tree grass building listen speak withdraw terminal plane") } } diff --git a/Session/Settings/SettingsViewModel.swift b/Session/Settings/SettingsViewModel.swift index 4608aabd3..2f4407bb4 100644 --- a/Session/Settings/SettingsViewModel.swift +++ b/Session/Settings/SettingsViewModel.swift @@ -434,7 +434,7 @@ class SettingsViewModel: SessionTableViewModel, NavigationItemSource, Navigatabl ), title: "recovery_password_title".localized(), onTap: { - if let recoveryPasswordView: RecoveryPasswordView = try? RecoveryPasswordView() { + if let recoveryPasswordView: RecoveryPasswordScreen = try? RecoveryPasswordScreen() { let viewController: SessionHostingViewController = SessionHostingViewController(rootView: recoveryPasswordView) viewController.setNavBarTitle("recovery_password_title".localized()) self?.transitionToScreen(viewController)