From 70ac7669a358e487587a376d52978008db5abd42 Mon Sep 17 00:00:00 2001 From: Andriy Gordiychuk Date: Mon, 23 Sep 2024 13:03:53 +0200 Subject: [PATCH] fix: added support for Swift 6 --- .DS_Store | Bin 0 -> 6148 bytes Instructions.xcodeproj/project.pbxproj | 8 ++++---- .../Core/Internal/CoachMarksViewController.swift | 10 +++------- .../Core/Public/CoachMarksController.swift | 1 + .../Default Views/CoachMarkBackgroundStyle.swift | 2 ++ .../Extra/Internal/CoachMarkComponent.swift | 1 + .../Internal/CoachMarkInnerLayoutHelper.swift | 1 + .../Helpers/Internal/CoachMarkLayoutHelper.swift | 2 +- .../Helpers/Public/CoachMarkHelper.swift | 2 +- .../Internal/CoachMarkDisplayManager.swift | 2 +- .../BlurringOverlayStyleManager.swift | 2 +- .../OverlayStyleManager.swift | 3 ++- .../Internal/SkipViewDisplayManager.swift | 2 +- .../Managers/Public/FlowManager.swift | 9 +-------- .../Managers/Public/OverlayManager.swift | 15 +-------------- .../CoachMarkViewControllerDelegate.swift | 2 +- .../Public/CoachMarkArrowView.swift | 1 + .../CoachMarkBodyHighlightArrowDelegate.swift | 2 +- .../Public/CoachMarkBodyView.swift | 1 + .../Public/CoachMarkSkipView.swift | 1 + .../Public/CoachMarksControllerDataSource.swift | 2 ++ .../CoachMarksControllerAnimationDelegate.swift | 4 ++-- .../Delegates/CoachMarksControllerDelegate.swift | 3 +++ 23 files changed, 33 insertions(+), 43 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5586a99a55cc2891397e61cb6684a148d77e5703 GIT binary patch literal 6148 zcmeHLOHRW;47EcSL2SD0a!!EM8w^!gutVwvpe+JKOQJ#r%iN3=+<_Bt0S>_PM^&r9 zra}l+wlsb-&e+L3OK}_`;?Zh0BT-o?gn&5_w<0gZRSrb$MlSRJ|UY+y2HAmORTTv*TeC&UNm|j{ut~MV^LStWL{6; zTfXPl&zJMJlilLXekD$GvvH;(;ZZ_@fnXpQ*jolrvqj1y!_dJ%Fc1u^8Ibow!Vt`k zt)ad;ptJ=5%4ehs=F&@uPjbwTts$;J*j$0;%HCqIxx=1(Uv_K_&7Ihr5B58=cPOlP zNBpGQiL+toU?3RSX5he UIView? @@ -15,7 +16,7 @@ protocol Snapshottable: AnyObject { /// (Blurring the content behind, simple background color, etc.) /// Takes care of displaying and animating the overlay / cutout path (doesn't /// deals with the coach mark view itself). -protocol OverlayStyleManager: AnyObject { +@MainActor protocol OverlayStyleManager: AnyObject { /// The overlay managed by the styleManager. var overlayView: OverlayView? { get set } diff --git a/Sources/Instructions/Managers/Internal/SkipViewDisplayManager.swift b/Sources/Instructions/Managers/Internal/SkipViewDisplayManager.swift index d5d0416f..93af67f6 100644 --- a/Sources/Instructions/Managers/Internal/SkipViewDisplayManager.swift +++ b/Sources/Instructions/Managers/Internal/SkipViewDisplayManager.swift @@ -4,7 +4,7 @@ import UIKit /// This class deals with the layout of the "skip" view. -class SkipViewDisplayManager { +@MainActor class SkipViewDisplayManager { // MARK: - Internal properties /// Datasource providing the constraints to use. weak var dataSource: CoachMarksControllerProxyDataSource? diff --git a/Sources/Instructions/Managers/Public/FlowManager.swift b/Sources/Instructions/Managers/Public/FlowManager.swift index 4b32505b..7d41fdbd 100644 --- a/Sources/Instructions/Managers/Public/FlowManager.swift +++ b/Sources/Instructions/Managers/Public/FlowManager.swift @@ -3,7 +3,7 @@ import UIKit -public class FlowManager { +@MainActor public class FlowManager { // MARK: - Internal Properties /// `true` if coach marks are curently being displayed, `false` otherwise. public var isStarted: Bool { return currentIndex > -1 } @@ -294,13 +294,6 @@ public class FlowManager { showPreviousCoachMark(hidePrevious: true) } - - // MARK: Renamed Public Properties - @available(*, unavailable, renamed: "isStarted") - public var started: Bool = false - - @available(*, unavailable, renamed: "isPaused") - public var paused: Bool = false } extension FlowManager: CoachMarksViewControllerDelegate { diff --git a/Sources/Instructions/Managers/Public/OverlayManager.swift b/Sources/Instructions/Managers/Public/OverlayManager.swift index 6cd50caf..de3e25c3 100644 --- a/Sources/Instructions/Managers/Public/OverlayManager.swift +++ b/Sources/Instructions/Managers/Public/OverlayManager.swift @@ -5,7 +5,7 @@ import UIKit // Overlay a blocking view on top of the screen and handle the cutout path // around the point of interest. -public class OverlayManager { +@MainActor public class OverlayManager { // MARK: - Public properties /// The background color of the overlay public var backgroundColor: UIColor = InstructionsColor.overlay { @@ -186,19 +186,6 @@ public class OverlayManager { return translucentOverlayStyleManager } } - - // MARK: Renamed Public Properties - @available(*, unavailable, renamed: "backgroundColor") - public var color: UIColor = InstructionsColor.overlay - - @available(*, unavailable, renamed: "isUserInteractionEnabled") - public var allowTap: Bool = true - - @available(*, unavailable, renamed: "isUserInteractionEnabledInsideCutoutPath") - public var allowTouchInsideCutoutPath: Bool = false - - @available(*, unavailable, renamed: "areTouchEventsForwarded") - public var forwardTouchEvents: Bool = false } // swiftlint:disable class_delegate_protocol diff --git a/Sources/Instructions/Protocols and Enums/Internal/CoachMarkViewControllerDelegate.swift b/Sources/Instructions/Protocols and Enums/Internal/CoachMarkViewControllerDelegate.swift index 88ca8ab6..6b558a26 100644 --- a/Sources/Instructions/Protocols and Enums/Internal/CoachMarkViewControllerDelegate.swift +++ b/Sources/Instructions/Protocols and Enums/Internal/CoachMarkViewControllerDelegate.swift @@ -2,7 +2,7 @@ // Licensed under the terms of the MIT License. /// Used by the CoachMarksViewController to notify user or system related events. -protocol CoachMarksViewControllerDelegate: AnyObject { +@MainActor protocol CoachMarksViewControllerDelegate: AnyObject { /// The given `coachMarkView` was tapped. /// /// - Parameter coachMarkView: the view that was tapped. diff --git a/Sources/Instructions/Protocols and Enums/Public/CoachMarkArrowView.swift b/Sources/Instructions/Protocols and Enums/Public/CoachMarkArrowView.swift index 4ac03084..2eb6d9f5 100644 --- a/Sources/Instructions/Protocols and Enums/Public/CoachMarkArrowView.swift +++ b/Sources/Instructions/Protocols and Enums/Public/CoachMarkArrowView.swift @@ -4,6 +4,7 @@ import UIKit /// A protocol to which all the "arrow views" of a coach mark must conform. +@MainActor public protocol CoachMarkArrowView: AnyObject { /// A method to change the arrow highlighted state. /// If you feel the arrow should mirror the state of the "body view", diff --git a/Sources/Instructions/Protocols and Enums/Public/CoachMarkBodyHighlightArrowDelegate.swift b/Sources/Instructions/Protocols and Enums/Public/CoachMarkBodyHighlightArrowDelegate.swift index 5f342730..a1e98d2d 100644 --- a/Sources/Instructions/Protocols and Enums/Public/CoachMarkBodyHighlightArrowDelegate.swift +++ b/Sources/Instructions/Protocols and Enums/Public/CoachMarkBodyHighlightArrowDelegate.swift @@ -6,7 +6,7 @@ import UIKit /// Delegate the hilight mecanism of the arrow. This protocol is /// useful in case the whole body itself is the active control and /// we want the arrow to looks like it is part of this control. -public protocol CoachMarkBodyHighlightArrowDelegate: AnyObject { +@MainActor public protocol CoachMarkBodyHighlightArrowDelegate: AnyObject { /// Set wethe ror not the arrow should get in its /// highlighted state. diff --git a/Sources/Instructions/Protocols and Enums/Public/CoachMarkBodyView.swift b/Sources/Instructions/Protocols and Enums/Public/CoachMarkBodyView.swift index 2b835853..fe548726 100644 --- a/Sources/Instructions/Protocols and Enums/Public/CoachMarkBodyView.swift +++ b/Sources/Instructions/Protocols and Enums/Public/CoachMarkBodyView.swift @@ -4,6 +4,7 @@ import UIKit /// A protocol to which all the "body views" of a coach mark must conform. +@MainActor public protocol CoachMarkBodyView: AnyObject { /// The control that will trigger the change between the current coach mark /// and the next one. diff --git a/Sources/Instructions/Protocols and Enums/Public/CoachMarkSkipView.swift b/Sources/Instructions/Protocols and Enums/Public/CoachMarkSkipView.swift index 07670e65..0001cfb6 100644 --- a/Sources/Instructions/Protocols and Enums/Public/CoachMarkSkipView.swift +++ b/Sources/Instructions/Protocols and Enums/Public/CoachMarkSkipView.swift @@ -4,6 +4,7 @@ import UIKit /// A protocol to which all the "skip views" must conform. +@MainActor public protocol CoachMarkSkipView: AnyObject { /// The control that will trigger the stop, in the display flow. var skipControl: UIControl? { get } diff --git a/Sources/Instructions/Protocols and Enums/Public/CoachMarksControllerDataSource.swift b/Sources/Instructions/Protocols and Enums/Public/CoachMarksControllerDataSource.swift index 5f059482..868f7fba 100644 --- a/Sources/Instructions/Protocols and Enums/Public/CoachMarksControllerDataSource.swift +++ b/Sources/Instructions/Protocols and Enums/Public/CoachMarksControllerDataSource.swift @@ -5,6 +5,7 @@ import UIKit /// Describe how a coachmark datasource should behave. /// It works a bit like `UITableViewDataSource`. +@MainActor public protocol CoachMarksControllerDataSource: AnyObject { /// Asks for the number of coach marks to display. /// @@ -66,6 +67,7 @@ public extension CoachMarksControllerDataSource { } } +@MainActor internal protocol CoachMarksControllerProxyDataSource: AnyObject { /// Asks for the number of coach marks to display. /// diff --git a/Sources/Instructions/Protocols and Enums/Public/Delegates/CoachMarksControllerAnimationDelegate.swift b/Sources/Instructions/Protocols and Enums/Public/Delegates/CoachMarksControllerAnimationDelegate.swift index 3e78ce84..3430a174 100644 --- a/Sources/Instructions/Protocols and Enums/Public/Delegates/CoachMarksControllerAnimationDelegate.swift +++ b/Sources/Instructions/Protocols and Enums/Public/Delegates/CoachMarksControllerAnimationDelegate.swift @@ -4,7 +4,7 @@ import UIKit /// -public protocol CoachMarksControllerAnimationDelegate: AnyObject { +@MainActor public protocol CoachMarksControllerAnimationDelegate: AnyObject { func coachMarksController(_ coachMarksController: CoachMarksController, fetchAppearanceTransitionOfCoachMark coachMarkView: UIView, at index: Int, @@ -38,7 +38,7 @@ public extension CoachMarksControllerAnimationDelegate { using manager: CoachMarkAnimationManager) { } } -protocol CoachMarksControllerAnimationProxyDelegate: AnyObject { +@MainActor protocol CoachMarksControllerAnimationProxyDelegate: AnyObject { func fetchAppearanceTransition(OfCoachMark coachMarkView: UIView, at index: Int, using manager: CoachMarkTransitionManager) diff --git a/Sources/Instructions/Protocols and Enums/Public/Delegates/CoachMarksControllerDelegate.swift b/Sources/Instructions/Protocols and Enums/Public/Delegates/CoachMarksControllerDelegate.swift index defea48f..e8983606 100644 --- a/Sources/Instructions/Protocols and Enums/Public/Delegates/CoachMarksControllerDelegate.swift +++ b/Sources/Instructions/Protocols and Enums/Public/Delegates/CoachMarksControllerDelegate.swift @@ -4,6 +4,7 @@ import UIKit /// Give a chance to react when coach marks are displayed +@MainActor public protocol CoachMarksControllerDelegate: AnyObject { func coachMarksController(_ coachMarksController: CoachMarksController, configureOrnamentsOfOverlay overlay: UIView) @@ -36,6 +37,7 @@ public protocol CoachMarksControllerDelegate: AnyObject { at index: Int) -> Bool } + public extension CoachMarksControllerDelegate { func coachMarksController(_ coachMarksController: CoachMarksController, configureOrnamentsOfOverlay overlay: UIView) { } @@ -82,6 +84,7 @@ public extension CoachMarksControllerDelegate { } } +@MainActor protocol CoachMarksControllerProxyDelegate: AnyObject { func configureOrnaments(ofOverlay: UIView)