From 15f1be66fe646e7407dd1d0aa7693ec1c0080a95 Mon Sep 17 00:00:00 2001 From: "Bandaru, Krishna Kishore" Date: Thu, 18 Jan 2024 16:42:15 +0000 Subject: [PATCH 1/5] Added sourceRect.origin for UIActivityViewController while presenting in iPad. --- MVMCore/MVMCore/ActionHandling/ActionShareHandler.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MVMCore/MVMCore/ActionHandling/ActionShareHandler.swift b/MVMCore/MVMCore/ActionHandling/ActionShareHandler.swift index cfaff2c..39d5738 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionShareHandler.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionShareHandler.swift @@ -22,6 +22,11 @@ open class ActionShareHandler: MVMCoreActionHandlerProtocol { try await withCheckedThrowingContinuation { continuation in let controller = UIActivityViewController(activityItems: activityItems, applicationActivities: nil) controller.popoverPresentationController?.sourceView = NavigationHandler.shared().viewControllerToPresentOn?.view + var originPoint: CGPoint = .zero + if let view = NavigationHandler.shared().viewControllerToPresentOn?.view { + originPoint = CGPoint(x: view.frame.midX, y: view.frame.maxY) + } + controller.popoverPresentationController?.sourceRect.origin = originPoint controller.completionWithItemsHandler = {(activityType: UIActivity.ActivityType?, completed: Bool, returnedItems: [Any]?, error: Error?) in if completed { // Activity was completed, considered finished. From 47286a9e354a62351ab1a91eeed14e9b707df3de Mon Sep 17 00:00:00 2001 From: Nandhini Rajendran Date: Tue, 23 Jan 2024 15:22:19 +0530 Subject: [PATCH 2/5] Fixing function declaration to override from MF --- MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift index afe5fc1..9558634 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift @@ -27,7 +27,7 @@ import Foundation func recordEvent(_ name: String, attributes: [String : Any]?) {} // MARK: - logging delegate - @objc public func handleDebugMessage(_ message: String?) { + @objc open func handleDebugMessage(_ message: String?) { #if LOGGING guard let message = message else { return } self.print(with: message) From d7db83583f68412e19c0cdc3e1f4538f36b08f89 Mon Sep 17 00:00:00 2001 From: "Rajendran, Nandhini" Date: Wed, 24 Jan 2024 14:44:45 +0000 Subject: [PATCH 3/5] Logging handler code fix --- MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift index 9558634..42b4754 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift @@ -24,7 +24,7 @@ import Foundation MVMCoreObject.sharedInstance()?.loggingDelegate?.logLoadFinished(loadObject, loadedViewController: loadedViewController as? MVMCoreViewControllerProtocol, error: error) } - func recordEvent(_ name: String, attributes: [String : Any]?) {} + open func recordEvent(_ name: String, attributes: [String : Any]?) {} // MARK: - logging delegate @objc open func handleDebugMessage(_ message: String?) { From d91dbbd460bbf6c2bbb310d80317ad494a328ead Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Fri, 26 Jan 2024 14:03:01 -0500 Subject: [PATCH 4/5] Prevent stack overflow if the logging handler is its own delegate. --- MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift index 42b4754..9db4039 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift @@ -36,6 +36,8 @@ import Foundation @objc(addErrorToLog:) open func addError(toLog errorObject: MVMCoreErrorObject) { - MVMCoreObject.sharedInstance()?.loggingDelegate?.addError(toLog: errorObject) + // Guard against doing anything further if the logging handler is its own delegate. + guard let loggingDelegate = MVMCoreObject.sharedInstance()?.loggingDelegate, loggingDelegate as? NSObject !== self else { return } + loggingDelegate.addError(toLog: errorObject) } } From 435b5a4c9759530e6676787bc3d3e62c29d67fc5 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Fri, 26 Jan 2024 16:12:17 -0500 Subject: [PATCH 5/5] Scott recommendation to simplify. --- MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift index 9db4039..7ddadbb 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift @@ -36,8 +36,6 @@ import Foundation @objc(addErrorToLog:) open func addError(toLog errorObject: MVMCoreErrorObject) { - // Guard against doing anything further if the logging handler is its own delegate. - guard let loggingDelegate = MVMCoreObject.sharedInstance()?.loggingDelegate, loggingDelegate as? NSObject !== self else { return } - loggingDelegate.addError(toLog: errorObject) + // Subclass to handle. } }