Skip to content

Commit

Permalink
refactor: migrate project to swift 6
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanStepanok committed Nov 19, 2024
1 parent 21e94b6 commit 2774689
Show file tree
Hide file tree
Showing 242 changed files with 3,180 additions and 3,230 deletions.
36 changes: 27 additions & 9 deletions Authorization/Authorization.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@
0770DE3728D0A319006D8A5D /* Sources */,
0770DE3828D0A319006D8A5D /* Frameworks */,
0770DE3928D0A319006D8A5D /* Resources */,
3A3FABB297FA699667A0F655 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -496,6 +497,23 @@
shellPath = /bin/sh;
shellScript = "if [[ -f \"${PODS_ROOT}/SwiftGen/bin/swiftgen\" ]]; then\n \"${PODS_ROOT}/SwiftGen/bin/swiftgen\"\nelse\n echo \"warning: SwiftGen is not installed. Run 'pod install --repo-update' to install it.\"\nfi\n";
};
3A3FABB297FA699667A0F655 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-App-Authorization/Pods-App-Authorization-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-App-Authorization/Pods-App-Authorization-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App-Authorization/Pods-App-Authorization-resources.sh\"\n";
showEnvVarsInLog = 0;
};
737436DC910C5A48E4C01AC7 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -719,7 +737,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = DebugStage;
Expand Down Expand Up @@ -829,7 +847,7 @@
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = ReleaseStage;
Expand Down Expand Up @@ -1054,7 +1072,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = DebugDev;
Expand Down Expand Up @@ -1146,7 +1164,7 @@
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = ReleaseDev;
Expand Down Expand Up @@ -1245,7 +1263,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = DebugProd;
Expand Down Expand Up @@ -1337,7 +1355,7 @@
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = ReleaseProd;
Expand Down Expand Up @@ -1494,7 +1512,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -1528,7 +1546,7 @@
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down Expand Up @@ -1605,7 +1623,7 @@
repositoryURL = "https://github.com/openedx/openedx-app-foundation-ios/";
requirement = {
kind = exactVersion;
version = 1.0.0;
version = 1.0.1;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Foundation
import Core

//sourcery: AutoMockable
@MainActor
public protocol AuthorizationRouter: BaseRouter {
func showUpdateRequiredView(showAccountLink: Bool)
}
Expand Down
10 changes: 7 additions & 3 deletions Authorization/Authorization/Presentation/Login/SignInView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ public struct SignInView: View {
.transition(.move(edge: .top))
.onAppear {
doAfter(Theme.Timeout.snackbarMessageLongTimeout) {
viewModel.alertMessage = nil
Task { @MainActor in
viewModel.alertMessage = nil
}
}
}
}
Expand All @@ -272,15 +274,17 @@ public struct SignInView: View {
}.transition(.move(edge: .bottom))
.onAppear {
doAfter(Theme.Timeout.snackbarMessageLongTimeout) {
viewModel.errorMessage = nil
Task { @MainActor in
viewModel.errorMessage = nil
}
}
}
}
}
.navigationBarHidden(true)
.ignoresSafeArea(.all, edges: .horizontal)
.background(Theme.Colors.background.ignoresSafeArea(.all))
.onFirstAppear{
.onFirstAppear {
viewModel.trackScreenEvent()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import FacebookLogin
import GoogleSignIn
import MSAL

@MainActor
public class SignInViewModel: ObservableObject {

@Published private(set) var isShowProgress = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public struct SignUpView: View {
.ignoresSafeArea(.all, edges: .horizontal)
.background(Theme.Colors.background.ignoresSafeArea(.all))
.navigationBarHidden(true)
.onFirstAppear{
.onFirstAppear {
viewModel.trackScreenEvent()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import FacebookLogin
import GoogleSignIn
import MSAL

public class SignUpViewModel: ObservableObject {
@MainActor
public final class SignUpViewModel: ObservableObject {

@Published var isShowProgress = false
@Published var scrollTo: Int?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import SwiftUI
import Core
import OEXFoundation

public class ResetPasswordViewModel: ObservableObject {
@MainActor
public final class ResetPasswordViewModel: ObservableObject {

@Published private(set) var isShowProgress = false
@Published private(set) var showError: Bool = false
Expand Down
3 changes: 1 addition & 2 deletions Authorization/Authorization/Presentation/SSO/SSOHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import KeychainSwift
A Helper for some of the SSO preferences.
Keeps data under the UserDefaults.
*/
public class SSOHelper: NSObject {
public final class SSOHelper: NSObject {

private let keychain: KeychainSwift
public enum SSOHelperKeys: String, CaseIterable {
Expand Down Expand Up @@ -77,4 +77,3 @@ public class SSOHelper: NSObject {
cookieSignature = nil
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import FacebookLogin
import GoogleSignIn
import MSAL

@MainActor
public class SSOWebViewModel: ObservableObject {

@Published private(set) var isShowProgress = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ enum SocialAuthDetails {
}
}

@MainActor
final public class SocialAuthViewModel: ObservableObject {

// MARK: - Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Foundation
import Core

@MainActor
public class StartupViewModel: ObservableObject {
let router: AuthorizationRouter
let analytics: CoreAnalytics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Swinject
import OEXFoundation
import Core

public final class AppleAuthProvider: NSObject, ASAuthorizationControllerDelegate {
public final class AppleAuthProvider: NSObject, ASAuthorizationControllerDelegate, Sendable {

private let config: ConfigProtocol

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import OEXFoundation
import Alamofire
import SwiftUI

@MainActor
final class ResetPasswordViewModelTests: XCTestCase {

func testResetPasswordValidationEmailError() async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import OEXFoundation
import Alamofire
import SwiftUI

@MainActor
final class SignInViewModelTests: XCTestCase {

override func setUpWithError() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import OEXFoundation
import Alamofire
import SwiftUI

@MainActor
final class SignUpViewModelTests: XCTestCase {

override func setUpWithError() throws {
Expand Down
Loading

0 comments on commit 2774689

Please sign in to comment.