Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions TOASTER-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1530;
LastUpgradeCheck = 1620;
LastUpgradeCheck = 2630;
TargetAttributes = {
3FF2BEFE2BA17492001D7DC1 = {
CreatedOnToolsVersion = 15.3;
Expand Down Expand Up @@ -2343,7 +2343,6 @@
CODE_SIGN_ENTITLEMENTS = ToasterShareExtension/ToasterShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = JF6B89ULG6;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ToasterShareExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = ToasterShareExtension;
Expand All @@ -2370,7 +2369,6 @@
CODE_SIGN_ENTITLEMENTS = ToasterShareExtension/ToasterShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = JF6B89ULG6;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ToasterShareExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = ToasterShareExtension;
Expand Down Expand Up @@ -2427,6 +2425,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = JF6B89ULG6;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand All @@ -2450,8 +2449,11 @@
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_DEFAULT_ACTOR_ISOLATION = nonisolated;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_CONCURRENCY = complete;
};
name = Debug;
};
Expand Down Expand Up @@ -2491,6 +2493,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = JF6B89ULG6;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand All @@ -2507,7 +2510,10 @@
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_DEFAULT_ACTOR_ISOLATION = nonisolated;
SWIFT_STRICT_CONCURRENCY = complete;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -2521,7 +2527,6 @@
CODE_SIGN_ENTITLEMENTS = "TOASTER-iOS/TOASTER-iOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = JF6B89ULG6;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "TOASTER-iOS/Global/Supporting Files/Info.plist";
Expand All @@ -2535,12 +2540,13 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.2;
MARKETING_VERSION = 1.2.3;
PRODUCT_BUNDLE_IDENTIFIER = "TeamLinkMIND.TOASTER-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand All @@ -2555,7 +2561,6 @@
CODE_SIGN_ENTITLEMENTS = "TOASTER-iOS/TOASTER-iOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = JF6B89ULG6;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "TOASTER-iOS/Global/Supporting Files/Info.plist";
Expand All @@ -2569,12 +2574,13 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.2;
MARKETING_VERSION = 1.2.3;
PRODUCT_BUNDLE_IDENTIFIER = "TeamLinkMIND.TOASTER-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1620"
LastUpgradeVersion = "2630"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
64 changes: 37 additions & 27 deletions TOASTER-iOS/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
UserDefaults.standard.set(true, forKey: "isAppAlarmOn")

// MARK: - 카카오 로그인 설정

KakaoSDK.initSDK(appKey: Config.kakaoNativeAppKey)

let result = KeyChainService.loadTokens(accessKey: Config.accessTokenKey, refreshKey: Config.refreshTokenKey)
Expand All @@ -50,8 +50,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

switch loginType {
case Config.appleLogin:
checkAppleLogin { [weak self] result in
self?.isLogin = result
Task { [weak self] in
let result = await self?.checkAppleLogin() ?? false
await MainActor.run { [weak self] in
self?.isLogin = result
}
}
case Config.kakaoLogin:
checkKakaoLogin { [weak self] result in
Expand Down Expand Up @@ -108,48 +111,55 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
}

func checkAppleLogin(completion: @escaping (Bool) -> Void) {
func checkAppleLogin() async -> Bool {
let appleIDProvider = ASAuthorizationAppleIDProvider()
appleIDProvider.getCredentialState(forUserID: UserDefaults.standard.string(forKey: Config.appleUserID) ?? "") { (credentialState, error) in
switch credentialState {
case .authorized:
print("해당 ID는 연동되어있습니다.")
completion(true)
case .revoked:
print("해당 ID는 연동되어있지않습니다.")
completion(false)
case .notFound:
print("해당 ID를 찾을 수 없습니다.")
completion(false)
default:
break
return await withCheckedContinuation { continuation in
appleIDProvider.getCredentialState(forUserID: UserDefaults.standard.string(forKey: Config.appleUserID) ?? "") { credentialState, _ in
switch credentialState {
case .authorized:
print("해당 ID는 연동되어있습니다.")
continuation.resume(returning: true)
case .revoked:
print("해당 ID는 연동되어있지 않습니다.")
continuation.resume(returning: false)
case .notFound:
print("해당 ID를 찾을 수 없습니다.")
continuation.resume(returning: false)
default:
continuation.resume(returning: false)
}
}
}
}
}

// MARK: - MessagingDelegate

extension AppDelegate: MessagingDelegate {

// FCM 토큰을 받았을 때 실행
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
nonisolated func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
if let fcmToken {
let _ = KeyChainService.saveFCMToken(fcmToken: fcmToken, key: Config.fcmTokenKey)
}
}
}

extension AppDelegate: UNUserNotificationCenterDelegate {

func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {

if let navigationViewController = UIApplication.shared.keyWindow?.rootViewController as? ToasterNavigationController {
navigationViewController.popToRootViewController(animated: false)
if let tabBarController = navigationViewController.topViewController as? TabBarController {
tabBarController.selectedIndex = 0
nonisolated func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {
Task { @MainActor in
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let navigationViewController = windowScene.windows
.first(where: { $0.isKeyWindow })?
.rootViewController as? ToasterNavigationController {
navigationViewController.popToRootViewController(animated: false)
if let tabBarController = navigationViewController.topViewController as? TabBarController {
tabBarController.selectedIndex = 0
}
}
}
completionHandler()
}
}
1 change: 1 addition & 0 deletions TOASTER-iOS/Application/Coordinator/Coordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation

@MainActor
protocol Coordinator: AnyObject {
var childCoordinators: [Coordinator] { get set }
func start()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation

@MainActor
protocol CoordinatorFinishOutput {
var onFinish: (() -> Void)? { get set }
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private extension TabBarCoordinator {
accessKey: Config.accessTokenKey,
refreshKey: Config.refreshTokenKey
)
self?.onFinish?()
MainActor.assumeIsolated { self?.onFinish?() }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@MainActor
protocol CoordinatorFactoryProtocol {
func makeTabBarCoordinator(
router: RouterProtocol,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation

@MainActor
protocol ViewControllerFactoryProtocol {
func makeLoginVC() -> LoginViewController
func makeTabBarVC() -> TabBarController
Expand Down
1 change: 1 addition & 0 deletions TOASTER-iOS/Application/Coordinator/Router.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@MainActor
protocol RouterProtocol: AnyObject {
func setRoot(_ viewController: UIViewController, animated: Bool)
func setRoot(_ viewController: UIViewController, animated: Bool, hideBottomBarWhenPushed: Bool)
Expand Down
2 changes: 1 addition & 1 deletion TOASTER-iOS/Global/Resources/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum Config {
}
}

private static let infoDictionary: [String: Any] = {
nonisolated(unsafe) private static let infoDictionary: [String: Any] = {
guard let dict = Bundle.main.infoDictionary else {
fatalError("plist cannot found !!!")
}
Expand Down
2 changes: 1 addition & 1 deletion TOASTER-iOS/Network/Base/APIInterceptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class APIInterceptor: RequestInterceptor {
/// 재발급을 받고 다시 기존 API 를 호출해야하기 때문에 Requset 의 Header 를 변경해야 한다.
/// 해당 프로퍼티가 true 일 경우 기존의 Requset 의 Header 를 변경
/// 재발급을 받은 적이 없는 false 의 경우 TargetType 을 통해 Header 를 설정한 Requset 를 기본으로 사용
private var isTokenRefreshed = false
nonisolated(unsafe) private var isTokenRefreshed = false

static let shared = APIInterceptor()

Expand Down
2 changes: 1 addition & 1 deletion TOASTER-iOS/Network/Base/NetworkService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

final class NetworkService {

static let shared = NetworkService()
nonisolated(unsafe) static let shared = NetworkService()

private init() {}

Expand Down
7 changes: 5 additions & 2 deletions TOASTER-iOS/Present/AddLink/AddLinkViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,11 @@ private extension AddLinkViewController {
loadingTitle: "저장 중...",
loadingAnimationSize: 16,
task: { _ in
DispatchQueue.global().asyncAfter(deadline: .now() + 0.5) { [weak self] in
self?.requestSaveLink.send()
Task {
try? await Task.sleep(for: .seconds(0.5))
await MainActor.run { [weak self] in
self?.requestSaveLink.send()
}
}
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import UIKit
import SnapKit
import Then

@MainActor
protocol SelectClipHeaderViewlDelegate: AnyObject {
func addClipCellTapped()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import UIKit
import SnapKit
import Then

@MainActor
protocol AddClipBottomSheetViewDelegate: AnyObject {
func addHeightBottom()
func minusHeightBottom()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import UIKit
import SnapKit
import Then

@MainActor
protocol ClipCollectionHeaderViewDelegate: AnyObject {
func addClipButtonTapped()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Kingfisher
import SnapKit
import Then

@MainActor
protocol DetailClipListCollectionViewCellDelegate: AnyObject {
func modifiedButtonTapped(toastId: Int)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@ private extension ChangeClipBottomSheetView {
loadingTitle: "이동 중...",
loadingAnimationSize: 16,
task: { completion in
DispatchQueue.global().asyncAfter(deadline: .now() + 0.5) {
self.delegate?.completButtonTap()
completion()
Task {
try? await Task.sleep(for: .seconds(0.5))
await MainActor.run {
self.delegate?.completButtonTap()
completion()
}
}
}
)
Expand Down Expand Up @@ -174,6 +177,7 @@ extension ChangeClipBottomSheetView: UICollectionViewDelegateFlowLayout {
}
}

@MainActor
protocol ChangeClipBottomSheetViewDelegate: AnyObject {
func didSelectClip(selectClipId: Int)
func completButtonTap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import UIKit
import SnapKit
import Then

@MainActor
protocol UserClipCollectionViewCellDelegate: AnyObject {
func addClipCellTapped()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import UIKit

// MARK: - Compositional Layout

@MainActor
enum CompositionalFactory {
static func create() -> UICollectionViewCompositionalLayout {
return UICollectionViewCompositionalLayout { (sectionNumber, _ environment) -> NSCollectionLayoutSection? in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ private extension LinkWebViewController {
progressObservation = $0.observe(
\.estimatedProgress,
options: [.new]) { [weak self] object, _ in
let progress = Float(object.estimatedProgress)
self?.progressView.progress = progress
MainActor.assumeIsolated {
let progress = Float(object.estimatedProgress)
self?.progressView.progress = progress
}
}
}
}
Expand Down
Loading
Loading