diff --git a/AVIRO.xcodeproj/project.pbxproj b/AVIRO.xcodeproj/project.pbxproj index c83a0180..2f63c99c 100644 --- a/AVIRO.xcodeproj/project.pbxproj +++ b/AVIRO.xcodeproj/project.pbxproj @@ -52,6 +52,7 @@ C510005E2ABAA3C700F65C1F /* Enum+.swift in Sources */ = {isa = PBXBuildFile; fileRef = C510005D2ABAA3C700F65C1F /* Enum+.swift */; }; C51000612ABAE61F00F65C1F /* ReportReviewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51000602ABAE61F00F65C1F /* ReportReviewModel.swift */; }; C51000632ABAE6A200F65C1F /* MenuModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51000622ABAE6A200F65C1F /* MenuModel.swift */; }; + C5101DFE2BCC125300FF6C69 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = C52CD2DB2BCA4E940031671B /* PrivacyInfo.xcprivacy */; }; C51132C12A559BCA006E1EC3 /* AppController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51132C02A559BCA006E1EC3 /* AppController.swift */; }; C51385422AAADB0E001AB827 /* EditNickNameButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51385412AAADB0E001AB827 /* EditNickNameButton.swift */; }; C51385452AAAE493001AB827 /* MyDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51385442AAAE493001AB827 /* MyDataModel.swift */; }; @@ -88,6 +89,7 @@ C528E4BC2A5F9AB6002BD72E /* ThridRegistrationPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C528E4BB2A5F9AB6002BD72E /* ThridRegistrationPresenter.swift */; }; C528E4BE2A5FB816002BD72E /* TermsTableCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C528E4BD2A5FB816002BD72E /* TermsTableCell.swift */; }; C528E4C02A5FF1CB002BD72E /* FinalRegistrationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C528E4BF2A5FF1CB002BD72E /* FinalRegistrationViewController.swift */; }; + C52CD2DD2BCA5C310031671B /* BlurEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52CD2DC2BCA5C310031671B /* BlurEffectView.swift */; }; C52FA3432A175B20005E70DC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52FA3422A175B20005E70DC /* AppDelegate.swift */; }; C52FA3452A175B20005E70DC /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52FA3442A175B20005E70DC /* SceneDelegate.swift */; }; C52FA3472A175B20005E70DC /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52FA3462A175B20005E70DC /* HomeViewController.swift */; }; @@ -362,6 +364,8 @@ C528E4BB2A5F9AB6002BD72E /* ThridRegistrationPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThridRegistrationPresenter.swift; sourceTree = ""; }; C528E4BD2A5FB816002BD72E /* TermsTableCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsTableCell.swift; sourceTree = ""; }; C528E4BF2A5FF1CB002BD72E /* FinalRegistrationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinalRegistrationViewController.swift; sourceTree = ""; }; + C52CD2DB2BCA4E940031671B /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + C52CD2DC2BCA5C310031671B /* BlurEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlurEffectView.swift; sourceTree = ""; }; C52FA33F2A175B20005E70DC /* AVIRO.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AVIRO.app; sourceTree = BUILT_PRODUCTS_DIR; }; C52FA3422A175B20005E70DC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C52FA3442A175B20005E70DC /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -603,6 +607,7 @@ C52FA34D2A175B20005E70DC /* LaunchScreen.storyboard */, C52FA3502A175B20005E70DC /* Info.plist */, 62166DED2BA2E92300F05D40 /* API.plist */, + C52CD2DB2BCA4E940031671B /* PrivacyInfo.xcprivacy */, ); path = App; sourceTree = ""; @@ -1647,6 +1652,7 @@ C54BC0D82A2C2CEE00B65439 /* UIButton */, C54BC0D92A2C2CF900B65439 /* UITextLabel */, C5B071E22A59B3C200AE709A /* UITextField */, + C52CD2DC2BCA5C310031671B /* BlurEffectView.swift */, ); path = SubClass; sourceTree = ""; @@ -2147,6 +2153,7 @@ C52FA34F2A175B20005E70DC /* LaunchScreen.storyboard in Resources */, C510004F2AB5F76600F65C1F /* Pretendard-Bold.otf in Resources */, C505EB162ACC048E0057A4F8 /* Berry2.json in Resources */, + C5101DFE2BCC125300FF6C69 /* PrivacyInfo.xcprivacy in Resources */, C51000512AB5F76600F65C1F /* Pretendard-ExtraBold.otf in Resources */, C51000522AB5F76600F65C1F /* Pretendard-Regular.otf in Resources */, C510004D2AB5F76600F65C1F /* Pretendard-ExtraLight.otf in Resources */, @@ -2480,6 +2487,7 @@ C505C1DA2B3AC0070058F115 /* AVIROConfiguration.swift in Sources */, C5FD92F72A9CDB9300CF4673 /* EditMenuTopView.swift in Sources */, C56857822A7113CF00F52715 /* RequestTableViewCell.swift in Sources */, + C52CD2DD2BCA5C310031671B /* BlurEffectView.swift in Sources */, C5C2907B2A85E51B00ED5DCE /* PlaceReviewsView.swift in Sources */, C5A201BD2A98708800A54381 /* EditPlaceInfoPresenter.swift in Sources */, C59491D32AB0336100880B4B /* UIView(Animation)+Extension.swift in Sources */, @@ -2661,14 +2669,14 @@ CODE_SIGN_ENTITLEMENTS = AVIRO/AVIRO.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = C4K2HXA435; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AVIRO/App/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "어비로"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.lifestyle"; - INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "현재 내 위치와 가까운 가게를 찾아드려요. 위치 정보를 저장하지 않으니 안심하세요."; - INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "현재 내 위치와 가까운 가게를 찾아드려요. 위치 정보를 저장하지 않으니 안심하세요."; + INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "근처 비건 식당 검색이 이제 더 쉬어집니다! 사용자의 위치 정보는 서비스 이용간 최적화하는 데 사용되며, 모든 데이터는 안전하게 관리됩니다."; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "근처 비건 식당 검색이 이제 더 쉬어집니다! 사용자의 위치 정보는 서비스 이용간 최적화하는 데 사용되며, 모든 데이터는 안전하게 관리됩니다."; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; @@ -2679,7 +2687,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.3; + MARKETING_VERSION = 1.2.4; PRODUCT_BUNDLE_IDENTIFIER = SeonghunJeon.VeganRestaurant; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -2698,14 +2706,14 @@ CODE_SIGN_ENTITLEMENTS = AVIRO/AVIRO.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = C4K2HXA435; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AVIRO/App/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "어비로"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.lifestyle"; - INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "현재 내 위치와 가까운 가게를 찾아드려요. 위치 정보를 저장하지 않으니 안심하세요."; - INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "현재 내 위치와 가까운 가게를 찾아드려요. 위치 정보를 저장하지 않으니 안심하세요."; + INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "근처 비건 식당 검색이 이제 더 쉬어집니다! 사용자의 위치 정보는 서비스 이용간 최적화하는 데 사용되며, 모든 데이터는 안전하게 관리됩니다."; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "근처 비건 식당 검색이 이제 더 쉬어집니다! 사용자의 위치 정보는 서비스 이용간 최적화하는 데 사용되며, 모든 데이터는 안전하게 관리됩니다."; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; @@ -2716,7 +2724,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.3; + MARKETING_VERSION = 1.2.4; PRODUCT_BUNDLE_IDENTIFIER = SeonghunJeon.VeganRestaurant; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/AVIRO.xcodeproj/xcshareddata/xcschemes/AVIRO.xcscheme b/AVIRO.xcodeproj/xcshareddata/xcschemes/AVIRO.xcscheme index b0b3e87a..f23ca29a 100644 --- a/AVIRO.xcodeproj/xcshareddata/xcschemes/AVIRO.xcscheme +++ b/AVIRO.xcodeproj/xcshareddata/xcschemes/AVIRO.xcscheme @@ -68,6 +68,11 @@ value = "disable" isEnabled = "YES"> + + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + + diff --git a/AVIRO/Custom/Extension/UIView(Animation)+Extension.swift b/AVIRO/Custom/Extension/UIView(Animation)+Extension.swift index 71debe04..0cad78d6 100644 --- a/AVIRO/Custom/Extension/UIView(Animation)+Extension.swift +++ b/AVIRO/Custom/Extension/UIView(Animation)+Extension.swift @@ -157,4 +157,23 @@ extension UIView { } } } + + func activeClickButton( + duration: Double = 0.15, + delay: Double = 0, + scaleX: Double = 1.08, + scaleY: Double = 0.95 + ) { + UIView.animate( + withDuration: duration, + delay: delay, + options: [.allowUserInteraction], + animations: { + self.transform = CGAffineTransform(scaleX: scaleX, y: scaleY) + }, completion: { _ in + UIView.animate(withDuration: duration) { + self.transform = CGAffineTransform.identity + } + }) + } } diff --git a/AVIRO/Custom/SubClass/BlurEffectView.swift b/AVIRO/Custom/SubClass/BlurEffectView.swift new file mode 100644 index 00000000..27044cf1 --- /dev/null +++ b/AVIRO/Custom/SubClass/BlurEffectView.swift @@ -0,0 +1,27 @@ +// +// BlurEffectView.swift +// AVIRO +// +// Created by 전성훈 on 4/13/24. +// + +import UIKit + +final class BlurEffectView: UIView { + override init(frame: CGRect) { + super.init(frame: frame) + + setupAttribute() + } + + required init?(coder: NSCoder) { + fatalError() + } + + private func setupAttribute() { + self.backgroundColor = .black + self.alpha = 0.6 + + self.isHidden = true + } +} diff --git a/AVIRO/Custom/Utility/AmplitudeUtility.swift b/AVIRO/Custom/Utility/AmplitudeUtility.swift index 5b9e72a5..0b396d7a 100644 --- a/AVIRO/Custom/Utility/AmplitudeUtility.swift +++ b/AVIRO/Custom/Utility/AmplitudeUtility.swift @@ -59,9 +59,9 @@ protocol AmplitudeProtocol { func levelupDidMove(with level: Int) func levelupDidNotMove(with level: Int) - func wellcomeClick() - func wellcomeNoShow() - func wellcomeClose() + func didTappedCheckWelcome() + func didTappedNoMoreShowWelcome() + func didTappedCloseWelcome() } final class AmplitudeUtility: AmplitudeProtocol { @@ -204,15 +204,15 @@ final class AmplitudeUtility: AmplitudeProtocol { ) } - func wellcomeClick() { + func didTappedCheckWelcome() { amplitude?.track(eventType: AMType.wellcomeClick.rawValue) } - func wellcomeNoShow() { + func didTappedNoMoreShowWelcome() { amplitude?.track(eventType: AMType.wellcomeNoShow.rawValue) } - func wellcomeClose() { + func didTappedCloseWelcome() { amplitude?.track(eventType: AMType.wellcomeClose.rawValue) } } @@ -247,7 +247,7 @@ final class AmplitudeUtilityDummy: AmplitudeProtocol { func levelupDidMove(with level: Int) { return } func levelupDidNotMove(with level: Int) { return } - func wellcomeClick() { return } - func wellcomeNoShow() { return } - func wellcomeClose() { return } + func didTappedCheckWelcome() { return } + func didTappedNoMoreShowWelcome() { return } + func didTappedCloseWelcome() { return } } diff --git a/AVIRO/Custom/Utility/SystemUtility.swift b/AVIRO/Custom/Utility/SystemUtility.swift index 744d53fb..2dd3546a 100644 --- a/AVIRO/Custom/Utility/SystemUtility.swift +++ b/AVIRO/Custom/Utility/SystemUtility.swift @@ -13,26 +13,26 @@ struct SystemUtility { static let appStoreOpenUrlString = "itms-apps://itunes.apple.com/app/apple-store/\(APP.appId.rawValue)" - func latestVersion() -> String? { - let test = URL(string: - """ - http://itunes.apple.com/lookup?bundleId=\(APP.bundleId.rawValue) - """) - guard let url = URL(string: - """ - http://itunes.apple.com/lookup?bundleId=\(APP.bundleId.rawValue) - """), - let data = try? Data(contentsOf: url), - let json = try? JSONSerialization.jsonObject( - with: data, - options: .allowFragments - ) as? [String: Any], - let results = json["results"] as? [[String: Any]], - let appStoreVersion = results[0]["version"] as? String else { - return nil + func latestVersion(completion: @escaping (String?) -> Void) { + guard let url = URL(string: "http://itunes.apple.com/lookup?bundleId=\(APP.bundleId.rawValue)") else { + completion(nil) + return + } + + let task = URLSession.shared.dataTask(with: url) { data, response, error in + DispatchQueue.main.async { + guard let data = data, + let json = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any], + let results = json["results"] as? [[String: Any]], + let appStoreVersion = results.first?["version"] as? String else { + completion(nil) + return + } + completion(appStoreVersion) + } } - return appStoreVersion + task.resume() } func openAppStore() { diff --git a/AVIRO/Manager/APIManager/AVIROManager/AVIROAPI.swift b/AVIRO/Manager/APIManager/AVIROManager/AVIROAPI.swift index 70dddd5e..001374fb 100644 --- a/AVIRO/Manager/APIManager/AVIROManager/AVIROAPI.swift +++ b/AVIRO/Manager/APIManager/AVIROManager/AVIROAPI.swift @@ -28,12 +28,10 @@ final class AVIROAPI: AVIROAPIMangerProtocol { headers: [String: String]? = nil, completionHandler: @escaping (Result) -> Void ) where T: Decodable { -// print("before: ", onRequest.count) guard !onRequest.contains(url) else { return } onRequest.insert(url) -// print("after: ", onRequest.count) var request = URLRequest(url: url) @@ -48,7 +46,6 @@ final class AVIROAPI: AVIROAPIMangerProtocol { let task = session.dataTask(with: request) { [weak self] data, response, error in defer { -// print(url) self?.onRequest.remove(url) } @@ -305,6 +302,8 @@ final class AVIROAPI: AVIROAPIMangerProtocol { return } + print(url) + performRequest( with: url, headers: requestAPI.headers, diff --git a/AVIRO/Scene/Base/TabBar/AVIROTabBarController.swift b/AVIRO/Scene/Base/TabBar/AVIROTabBarController.swift index 0d9fb925..573e2d64 100644 --- a/AVIRO/Scene/Base/TabBar/AVIROTabBarController.swift +++ b/AVIRO/Scene/Base/TabBar/AVIROTabBarController.swift @@ -12,7 +12,7 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { private var amplitude: AmplitudeProtocol! private var viewControllers: [UINavigationController] = [] - private var wellcomeViewController: WelcomeViewController? + private var welcomeViewController: WelcomeViewController? private var types: [TabBarType] = [] private var buttons: [TabBarButton] = [] @@ -37,17 +37,7 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { return view }() - private lazy var tabBarBlurView: UIVisualEffectView = { - let view = UIVisualEffectView() - - let blurEffect = UIBlurEffect(style: .dark) - - view.effect = blurEffect - view.alpha = 0.3 - view.isHidden = true - - return view - }() + private lazy var tabBarBlurView = BlurEffectView() private lazy var wellcomeView: UIView = { let view = UIView() @@ -55,9 +45,9 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { view.backgroundColor = .clear view.isHidden = true - wellcomeViewController = WelcomeViewController.create() + welcomeViewController = WelcomeViewController.create() - if let wellcomeVC = wellcomeViewController { + if let wellcomeVC = welcomeViewController { add(child: wellcomeVC, container: view) view.addSubview(wellcomeVC.view) } @@ -65,17 +55,7 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { return view }() - private lazy var blurView: UIVisualEffectView = { - let view = UIVisualEffectView() - - let blurEffect = UIBlurEffect(style: .dark) - - view.effect = blurEffect - view.alpha = 0.6 - view.isHidden = true - - return view - }() + private lazy var blurView = BlurEffectView() var afterFetchingData: Bool = false @@ -119,7 +99,6 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { vc.amplitude = amplitude vc.setViewControllers(with: type, amplitude: amplitude) - return vc } @@ -268,38 +247,38 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { guard let compareDate = UserDefaults.standard.object( forKey: UDKey.hideUntil.rawValue ) as? Date else { - showWellcomeVC() + showWelcomeVC() return } - let components = Calendar.current.dateComponents( - [.hour], - from: compareDate, - to: Date() - ) + let calendar = Calendar.current + let today = calendar.startOfDay(for: Date()) + let lastShownDate = calendar.startOfDay(for: compareDate) - if let hoursPassed = components.hour, hoursPassed >= 24 { - showWellcomeVC() + let components = calendar.dateComponents([.day], from: lastShownDate, to: today) + + if let daysPassed = components.day, daysPassed >= 1 { + showWelcomeVC() } } - private func showWellcomeVC() { - wellcomeViewController?.tabBarDelegate = self - wellcomeViewController?.loadWellcomeImage { [weak self] in - self?.wellcomeViewController?.didTappedNoShowButton = { + private func showWelcomeVC() { + welcomeViewController?.tabBarDelegate = self + welcomeViewController?.loadWelcomeImage { [weak self] in + self?.welcomeViewController?.didTappedNoShowButton = { UserDefaults.standard.set(Date(), forKey: UDKey.hideUntil.rawValue) - self?.amplitude.wellcomeNoShow() - self?.removeWellcomVC() + self?.amplitude.didTappedNoMoreShowWelcome() + self?.removeWelcomeVC() } - self?.wellcomeViewController?.didTappedCloseButton = { - self?.amplitude.wellcomeClose() - self?.removeWellcomVC() + self?.welcomeViewController?.didTappedCloseButton = { + self?.amplitude.didTappedCloseWelcome() + self?.removeWelcomeVC() } - self?.wellcomeViewController?.didTappedCheckButton = { - self?.amplitude.wellcomeClick() - self?.removeWellcomVC() + self?.welcomeViewController?.didTappedCheckButton = { + self?.amplitude.didTappedCheckWelcome() + self?.removeWelcomeVC() self?.selectedIndex = 2 } @@ -309,12 +288,12 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { } } - private func removeWellcomVC() { + private func removeWelcomeVC() { blurView.isHidden = true wellcomeView.isHidden = true - wellcomeViewController?.remove() - wellcomeViewController = nil + welcomeViewController?.remove() + welcomeViewController = nil } // MARK: - TabBar Click After @@ -398,7 +377,7 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { private func afterTappedButton(_ button: UIButton) { vibrate() - animateButton(button) + button.activeClickButton() } private func vibrate() { @@ -407,20 +386,6 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { generator.impactOccurred() } - private func animateButton(_ button: UIButton) { - UIView.animate( - withDuration: 0.15, - delay: 0, - options: [.allowUserInteraction], - animations: { - button.transform = CGAffineTransform(scaleX: 1.08, y: 0.95) - }, completion: { _ in - UIView.animate(withDuration: 0.15) { - button.transform = CGAffineTransform.identity - } - }) - } - // MARK: - Selecetd Index With Key func setSelectedIndex( _ index: Int, diff --git a/AVIRO/Scene/Feature/Challenge/ChallengeInfoView/AnimationCustom/ChallengeInfoPresentationAnimator.swift b/AVIRO/Scene/Feature/Challenge/ChallengeInfoView/AnimationCustom/ChallengeInfoPresentationAnimator.swift index 3e322644..8a611eea 100644 --- a/AVIRO/Scene/Feature/Challenge/ChallengeInfoView/AnimationCustom/ChallengeInfoPresentationAnimator.swift +++ b/AVIRO/Scene/Feature/Challenge/ChallengeInfoView/AnimationCustom/ChallengeInfoPresentationAnimator.swift @@ -11,7 +11,7 @@ class ChallengeInfoPresentationAnimator: NSObject, UIViewControllerAnimatedTrans func transitionDuration( using transitionContext: UIViewControllerContextTransitioning? ) -> TimeInterval { - return 0.15 + return 0.25 } func animateTransition( @@ -23,13 +23,13 @@ class ChallengeInfoPresentationAnimator: NSObject, UIViewControllerAnimatedTrans return } - let blurEffect = UIBlurEffect(style: .dark) - let blurEffectView = UIVisualEffectView(effect: blurEffect) - blurEffectView.frame = transitionContext.containerView.bounds - blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight] - blurEffectView.alpha = 0 + let blurEffectView = BlurEffectView() let containerView = transitionContext.containerView + + blurEffectView.frame = containerView.frame + blurEffectView.isHidden = false + containerView.addSubview(blurEffectView) containerView.addSubview(toViewController.view) @@ -52,7 +52,6 @@ class ChallengeInfoPresentationAnimator: NSObject, UIViewControllerAnimatedTrans toViewController.view.frame = finalFrame }, completion: { finished in - blurEffectView.alpha = 0.3 transitionContext.completeTransition(finished) } ) diff --git a/AVIRO/Scene/Feature/Challenge/Setting/ViewController/Cells/SettingCell.swift b/AVIRO/Scene/Feature/Challenge/Setting/ViewController/Cells/SettingCell.swift index 24f4a5c0..39bbb28a 100644 --- a/AVIRO/Scene/Feature/Challenge/Setting/ViewController/Cells/SettingCell.swift +++ b/AVIRO/Scene/Feature/Challenge/Setting/ViewController/Cells/SettingCell.swift @@ -110,13 +110,11 @@ final class SettingCell: UITableViewCell { } private func loadVersion() { - DispatchQueue.global().async { [weak self] in - let latestVersion = SystemUtility().latestVersion() ?? "0.0" - let currentVersion = SystemUtility.appVersion ?? "0.0" + SystemUtility().latestVersion { [weak self] latestVersion in + let latestVersion = latestVersion ?? "0.0.0" + let currentVersion = SystemUtility.appVersion ?? "0.0.0" - DispatchQueue.main.async { - self?.versionLabel.text = "현재" + currentVersion + " / " + "최신 " + latestVersion - } + self?.versionLabel.text = "현재" + currentVersion + " / " + "최신 " + latestVersion } } } diff --git a/AVIRO/Scene/Feature/Challenge/Setting/ViewController/SettingViewController.swift b/AVIRO/Scene/Feature/Challenge/Setting/ViewController/SettingViewController.swift index c96052ab..9a79335a 100644 --- a/AVIRO/Scene/Feature/Challenge/Setting/ViewController/SettingViewController.swift +++ b/AVIRO/Scene/Feature/Challenge/Setting/ViewController/SettingViewController.swift @@ -80,15 +80,7 @@ final class SettingViewController: UIViewController { return indicatorView }() - private lazy var blurEffectView: UIView = { - - let view = UIView() - view.backgroundColor = .gray6.withAlphaComponent(0.3) - view.frame = self.view.bounds - view.isHidden = true - - return view - }() + private lazy var blurEffectView = BlurEffectView() private lazy var settingTableView: UITableView = { let tableView = UITableView(frame: .zero, style: .grouped) @@ -281,23 +273,11 @@ extension SettingViewController: MyPageViewProtocol { ) } - func pushLoginViewController(with: LoginRedirectReason) { - let vc = LoginViewController() - let presenter = LoginViewPresenter(viewController: vc) - vc.presenter = presenter - - switch with { - case .logout: - presenter.whenAfterLogout = true - case .withdrawal: - presenter.whenAfterWithdrawal = true - - } + func pushLoginViewController(type: LoginViewToastType) { - let rootViewController = UINavigationController(rootViewController: vc) - if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene { - windowScene.windows.first?.rootViewController = rootViewController - windowScene.windows.first?.makeKeyAndVisible() + if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, + let window = windowScene.windows.first { + AppController.shared.setupLoginViewAfterLogout(in: window, with: type) } } diff --git a/AVIRO/Scene/Feature/Challenge/Setting/ViewPresenter/SettingViewPresenter.swift b/AVIRO/Scene/Feature/Challenge/Setting/ViewPresenter/SettingViewPresenter.swift index ac9c1616..a005dc50 100644 --- a/AVIRO/Scene/Feature/Challenge/Setting/ViewPresenter/SettingViewPresenter.swift +++ b/AVIRO/Scene/Feature/Challenge/Setting/ViewPresenter/SettingViewPresenter.swift @@ -9,16 +9,17 @@ import UIKit import KeychainSwift -enum LoginRedirectReason { +enum LoginViewToastType { case logout case withdrawal + case none } protocol MyPageViewProtocol: NSObject { func setupLayout() func setupAttribute() // func updateMyData(_ myDataModel: MyDataModel) - func pushLoginViewController(with: LoginRedirectReason) + func pushLoginViewController(type: LoginViewToastType) func showErrorAlert(with error: String, title: String?) func switchIsLoading(with loading: Bool) } @@ -103,7 +104,7 @@ final class SettingViewPresenter { self.keychain.delete(KeychainKey.appleRefreshToken.rawValue) - viewController?.pushLoginViewController(with: .logout) + viewController?.pushLoginViewController(type: .logout) } func whenAfterWithdrawal() { @@ -127,7 +128,7 @@ final class SettingViewPresenter { DispatchQueue.main.async { self?.markerManager.deleteAllMarker() - self?.viewController?.pushLoginViewController(with: .withdrawal) + self?.viewController?.pushLoginViewController(type: .withdrawal) } } else { self?.viewController?.switchIsLoading(with: false) diff --git a/AVIRO/Scene/Feature/Home/EditPlaceInfo/ViewController/EditPlaceInfoViewController.swift b/AVIRO/Scene/Feature/Home/EditPlaceInfo/ViewController/EditPlaceInfoViewController.swift index 21ff59bc..b29017af 100644 --- a/AVIRO/Scene/Feature/Home/EditPlaceInfo/ViewController/EditPlaceInfoViewController.swift +++ b/AVIRO/Scene/Feature/Home/EditPlaceInfo/ViewController/EditPlaceInfoViewController.swift @@ -95,7 +95,7 @@ final class EditPlaceInfoViewController: UIViewController { private lazy var leftSwipeGesture = UISwipeGestureRecognizer() private lazy var rightSwipeGesture = UISwipeGestureRecognizer() - private lazy var blurEffectView = UIVisualEffectView() + private lazy var blurEffectView = BlurEffectView() private lazy var operationHourChangebleView = EditOperationHourChangebleView() override func viewDidLoad() { @@ -156,6 +156,8 @@ extension EditPlaceInfoViewController: EditPlaceInfoProtocol { equalTo: self.view.widthAnchor, multiplier: 1, constant: -32) ]) + operationHourChangebleView.isHidden = true + setupSafeAreaViewLayout() } @@ -278,16 +280,6 @@ extension EditPlaceInfoViewController: EditPlaceInfoProtocol { navigationController?.popViewController(animated: true) } - func setupBlurEffect() { - let blurEffectStyle = UIBlurEffect(style: UIBlurEffect.Style.dark) - - blurEffectView.effect = blurEffectStyle - blurEffectView.frame = view.bounds - blurEffectView.alpha = 0.3 - blurEffectView.isHidden = true - operationHourChangebleView.isHidden = true - } - func setupGesture() { [ leftSwipeGesture, diff --git a/AVIRO/Scene/Feature/Home/EditPlaceInfo/ViewPresenter/EditPlaceInfoPresenter.swift b/AVIRO/Scene/Feature/Home/EditPlaceInfo/ViewPresenter/EditPlaceInfoPresenter.swift index c66f6c4b..4aac5026 100644 --- a/AVIRO/Scene/Feature/Home/EditPlaceInfo/ViewPresenter/EditPlaceInfoPresenter.swift +++ b/AVIRO/Scene/Feature/Home/EditPlaceInfo/ViewPresenter/EditPlaceInfoPresenter.swift @@ -12,7 +12,6 @@ import NMapsMap protocol EditPlaceInfoProtocol: NSObject { func setupLayout() func setupAttribute() - func setupBlurEffect() func setupGesture() func handleClosure() func whenViewWillAppearSelectedIndex(_ index: Int) @@ -175,7 +174,6 @@ final class EditPlaceInfoPresenter { func viewDidLoad() { viewController?.setupLayout() viewController?.setupAttribute() - viewController?.setupBlurEffect() viewController?.setupGesture() viewController?.handleClosure() diff --git a/AVIRO/Scene/Feature/Home/ViewController/CategoryCell/CategoryCollectionViewCell.swift b/AVIRO/Scene/Feature/Home/ViewController/CategoryCell/CategoryCollectionViewCell.swift index a9a7c0f4..915e12fa 100644 --- a/AVIRO/Scene/Feature/Home/ViewController/CategoryCell/CategoryCollectionViewCell.swift +++ b/AVIRO/Scene/Feature/Home/ViewController/CategoryCell/CategoryCollectionViewCell.swift @@ -24,6 +24,7 @@ final class CategoryCollectionViewCell: UICollectionViewCell { }() private var type = "" + var whenCategoryButtonTapped: ((String, Bool) -> Void)? override init(frame: CGRect) { @@ -105,6 +106,7 @@ final class CategoryCollectionViewCell: UICollectionViewCell { } @objc private func categoryButtonTapped(_ sender: UIButton) { + sender.activeClickButton(duration: 0.15, scaleX: 1.04, scaleY: 0.98) sender.isSelected.toggle() if type == "취소" { diff --git a/AVIRO/Scene/Feature/Home/ViewController/HomeViewController.swift b/AVIRO/Scene/Feature/Home/ViewController/HomeViewController.swift index be44d354..427f25b9 100644 --- a/AVIRO/Scene/Feature/Home/ViewController/HomeViewController.swift +++ b/AVIRO/Scene/Feature/Home/ViewController/HomeViewController.swift @@ -222,16 +222,7 @@ final class HomeViewController: UIViewController { private(set) lazy var placeView = PlaceView() - private lazy var blurEffectView: UIVisualEffectView = { - let view = UIVisualEffectView() - - let blurEffect = UIBlurEffect(style: .dark) - - view.effect = blurEffect - view.alpha = 0.3 - - return view - }() + private lazy var blurEffectView = BlurEffectView() private(set) var placeViewTopConstraint: NSLayoutConstraint? private(set) var searchTextFieldTopConstraint: NSLayoutConstraint? @@ -262,7 +253,6 @@ final class HomeViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - presenter.viewWillAppear() } @@ -410,7 +400,6 @@ extension HomeViewController: HomeViewProtocol { ) placeViewTopConstraint?.isActive = true - blurEffectView.isHidden = true recommendPlaceAlertView.isHidden = true levelUpAlertView.isHidden = true } @@ -637,15 +626,18 @@ extension HomeViewController: HomeViewProtocol { } @objc private func flagButtonTapped(_ sender: UIButton) { + sender.activeClickButton(duration: 0.15, scaleX: 1.04, scaleY: 0.98) presenter.checkReportPlaceDuplecated() } @objc private func starButtonTapped(_ sender: UIButton) { + sender.activeClickButton(duration: 0.15, scaleX: 1.04, scaleY: 0.98) sender.isSelected.toggle() presenter.loadBookmark(sender.isSelected) } @objc private func locationButtonTapped(_ sender: UIButton) { + sender.activeClickButton(duration: 0.15, scaleX: 1.04, scaleY: 0.98) presenter.locationUpdate() } diff --git a/AVIRO/Scene/Feature/Home/ViewPresenter/HomeViewPresenter.swift b/AVIRO/Scene/Feature/Home/ViewPresenter/HomeViewPresenter.swift index db6fc5af..b3e89983 100644 --- a/AVIRO/Scene/Feature/Home/ViewPresenter/HomeViewPresenter.swift +++ b/AVIRO/Scene/Feature/Home/ViewPresenter/HomeViewPresenter.swift @@ -170,6 +170,7 @@ final class HomeViewPresenter: NSObject { } deinit { + print("Deinit HomeViewPresenter") NotificationCenter.default.removeObserver( self, name: NSNotification.Name(NotiName.afterMainSearch.rawValue), diff --git a/AVIRO/Scene/Feature/Login/Registration/ViewController/FinalRegistrationViewController.swift b/AVIRO/Scene/Feature/Login/Registration/ViewController/FinalRegistrationViewController.swift index fc05c25f..0f6aa401 100644 --- a/AVIRO/Scene/Feature/Login/Registration/ViewController/FinalRegistrationViewController.swift +++ b/AVIRO/Scene/Feature/Login/Registration/ViewController/FinalRegistrationViewController.swift @@ -107,23 +107,9 @@ final class FinalRegistrationViewController: UIViewController { // MARK: UI Interactions @objc func buttonTapped() { - let tabBarVC = AVIROTabBarController.create( - amplitude: AmplitudeUtility(), - type: [ - TabBarType.home, - TabBarType.plus, - TabBarType.challenge - ] - ) - - tabBarVC.selectedIndex = 0 - - navigationController?.pushViewController(tabBarVC, animated: true) - // let viewController = TabBarViewController() - // - // navigationController?.pushViewController( - // viewController, - // animated: true - // ) + if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, + let window = windowScene.windows.first { + AppController.shared.show(in: window) + } } } diff --git a/AVIRO/Scene/Feature/Login/ViewController/LoginViewController.swift b/AVIRO/Scene/Feature/Login/ViewController/LoginViewController.swift index 08560a11..dcd7378f 100644 --- a/AVIRO/Scene/Feature/Login/ViewController/LoginViewController.swift +++ b/AVIRO/Scene/Feature/Login/ViewController/LoginViewController.swift @@ -125,14 +125,7 @@ final class LoginViewController: UIViewController { return indicatorView }() - private lazy var blurEffectView: UIView = { - - let view = UIView() - view.backgroundColor = .gray7.withAlphaComponent(0.3) - view.frame = self.view.bounds - - return view - }() + private lazy var blurEffectView = BlurEffectView() // MARK: Override func override func viewDidLoad() { @@ -216,19 +209,11 @@ extension LoginViewController: LoginViewProtocol { // MARK: Push Intercations func pushTabBar() { - DispatchQueue.main.async { [weak self] in - let tabBarVC = AVIROTabBarController.create( - amplitude: AmplitudeUtility(), - type: [ - TabBarType.home, - TabBarType.plus, - TabBarType.challenge - ] - ) - - tabBarVC.selectedIndex = 0 - - self?.navigationController?.pushViewController(tabBarVC, animated: true) + DispatchQueue.main.async { + if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, + let window = windowScene.windows.first { + AppController.shared.show(in: window) + } } } diff --git a/AVIRO/Scene/Feature/Login/ViewPresenter/LoginViewPresenter.swift b/AVIRO/Scene/Feature/Login/ViewPresenter/LoginViewPresenter.swift index 0a2f24b9..70a2ad97 100644 --- a/AVIRO/Scene/Feature/Login/ViewPresenter/LoginViewPresenter.swift +++ b/AVIRO/Scene/Feature/Login/ViewPresenter/LoginViewPresenter.swift @@ -56,6 +56,10 @@ final class LoginViewPresenter: NSObject { } } + deinit { + print("Test LoginView Presenter Deinit") + } + // MARK: Clicke Apple Login func clickedAppleLogin() { let request = ASAuthorizationAppleIDProvider().createRequest() diff --git a/AVIRO/Scene/Feature/Tutorial/TutorialViewController.swift b/AVIRO/Scene/Feature/Tutorial/TutorialViewController.swift index d7b442ee..07e4b5b7 100644 --- a/AVIRO/Scene/Feature/Tutorial/TutorialViewController.swift +++ b/AVIRO/Scene/Feature/Tutorial/TutorialViewController.swift @@ -183,12 +183,17 @@ final class TutorialViewController: UIViewController { pushLoginView() } + deinit { + print("TutorialViewController deinit") + } + private func pushLoginView() { UserDefaults.standard.set(true, forKey: UDKey.tutorial.rawValue) - let loginVC = LoginViewController() - - self.navigationController?.pushViewController(loginVC, animated: true) + if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, + let window = windowScene.windows.first { + AppController.shared.show(in: window) + } } } diff --git a/AVIRO/Scene/Feature/Welcome/WelcomeViewController.swift b/AVIRO/Scene/Feature/Welcome/WelcomeViewController.swift index 0d399787..353036f0 100644 --- a/AVIRO/Scene/Feature/Welcome/WelcomeViewController.swift +++ b/AVIRO/Scene/Feature/Welcome/WelcomeViewController.swift @@ -166,7 +166,7 @@ final class WelcomeViewController: UIViewController { self.view.backgroundColor = .clear } - func loadWellcomeImage(completionHandler: @escaping () -> Void) { + func loadWelcomeImage(completionHandler: @escaping () -> Void) { AVIROAPI.manager.loadWellcomeImagesURL { [weak self] result in guard let self = self else { return } DispatchQueue.main.async { diff --git a/Podfile b/Podfile index a718ae8f..c0355c8d 100644 --- a/Podfile +++ b/Podfile @@ -7,7 +7,7 @@ target 'AVIRO' do use_frameworks! pod 'NMapsMap' -pod 'KeychainSwift', '21.0.0' +pod 'KeychainSwift', '22.0.0' pod 'lottie-ios', '4.4.1' pod 'RealmSwift', '10.48.0' pod 'Toast-Swift', '5.1.0' diff --git a/Podfile.lock b/Podfile.lock index a55f507c..e00cbeeb 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -3,7 +3,7 @@ PODS: - AnalyticsConnector (~> 1.0.1) - AnalyticsConnector (1.0.3) - Differentiator (5.0.0) - - KeychainSwift (21.0.0) + - KeychainSwift (22.0.0) - lottie-ios (4.4.1) - NMapsGeometry (1.0.1) - NMapsMap (3.17.0): @@ -31,7 +31,7 @@ PODS: DEPENDENCIES: - AmplitudeSwift (= 1.4.4) - - KeychainSwift (= 21.0.0) + - KeychainSwift - lottie-ios (= 4.4.1) - NMapsMap - RealmSwift (= 10.48.0) @@ -65,7 +65,7 @@ SPEC CHECKSUMS: AmplitudeSwift: 13725c3313c2e2cac30836dc2c973d3883baabef AnalyticsConnector: a53214d38ae22734c6266106c0492b37832633a9 Differentiator: e8497ceab83c1b10ca233716d547b9af21b9344d - KeychainSwift: 4a71a45c802fd9e73906457c2dcbdbdc06c9419d + KeychainSwift: 72f81155e1cb01c1bc4da296e4ce2cfcff556a12 lottie-ios: e047b1d2e6239b787cc5e9755b988869cf190494 NMapsGeometry: 53c573ead66466681cf123f99f698dc8071a4b83 NMapsMap: a5b909a31b6f3d27a670f6eb2ddc913c38975474 @@ -79,6 +79,6 @@ SPEC CHECKSUMS: RxTest: a23f26bb53a5e146a0a69db4f0fa0b69001ce7f4 Toast-Swift: dd369e68ee529f542c65bd0d0c6c50cd743cf6f2 -PODFILE CHECKSUM: f2ae6150d9b0e8b31f63cefa4c1b50b904c7dae4 +PODFILE CHECKSUM: 52ae1d7225d731e6828cc877918e944eed0ac5c5 COCOAPODS: 1.15.2