From 92d160cc02a0f7dca9da4c0d0b37927bb4613995 Mon Sep 17 00:00:00 2001 From: Ajay Sabhaney Date: Thu, 12 May 2022 22:51:44 -0400 Subject: [PATCH 1/3] fix casting of bg colors from info.plist --- ios/ReactShareViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/ReactShareViewController.swift b/ios/ReactShareViewController.swift index f42bce6..9a1c8b5 100644 --- a/ios/ReactShareViewController.swift +++ b/ios/ReactShareViewController.swift @@ -36,10 +36,10 @@ class ReactShareViewController: ShareViewController, RCTBridgeDelegate, ReactSha break backgroundColorSetup } - let red = backgroundColorConfig[COLOR_RED_KEY] as? Float ?? 1 - let green = backgroundColorConfig[COLOR_GREEN_KEY] as? Float ?? 1 - let blue = backgroundColorConfig[COLOR_BLUE_KEY] as? Float ?? 1 - let alpha = backgroundColorConfig[COLOR_ALPHA_KEY] as? Float ?? 1 + let red = (backgroundColorConfig[COLOR_RED_KEY] as? NSNumber)?.floatValue ?? 1 + let green = (backgroundColorConfig[COLOR_GREEN_KEY] as? NSNumber)?.floatValue ?? 1 + let blue = (backgroundColorConfig[COLOR_BLUE_KEY] as? NSNumber)?.floatValue ?? 1 + let alpha = (backgroundColorConfig[COLOR_ALPHA_KEY] as? NSNumber)?.floatValue ?? 1 rootView.backgroundColor = UIColor(red: CGFloat(red), green: CGFloat(green), blue: CGFloat(blue), alpha: CGFloat(alpha)) } From ec91c8499428edbf0bef33434f979c3997077a1b Mon Sep 17 00:00:00 2001 From: Ajay Sabhaney Date: Thu, 12 May 2022 23:31:19 -0400 Subject: [PATCH 2/3] update docs --- SHARE_EXTENSION_VIEW.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SHARE_EXTENSION_VIEW.md b/SHARE_EXTENSION_VIEW.md index e6906fa..9e2224d 100644 --- a/SHARE_EXTENSION_VIEW.md +++ b/SHARE_EXTENSION_VIEW.md @@ -47,13 +47,13 @@ Open your Share Extension's `Info.plist` and add the following: ReactShareViewBackgroundColor Red - 1 + 1 Green - 1 + 1 Blue - 1 + 1 Alpha - 1 + 1 Transparent From e6c8ebf9b7a1bfc01902f61763d7212c9874c459 Mon Sep 17 00:00:00 2001 From: Ajay Sabhaney Date: Thu, 26 May 2022 11:15:25 -0400 Subject: [PATCH 3/3] allow to update delegate every time attachViewDelegate called --- ios/Modules/ShareMenuReactView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Modules/ShareMenuReactView.swift b/ios/Modules/ShareMenuReactView.swift index e290cce..71a0910 100644 --- a/ios/Modules/ShareMenuReactView.swift +++ b/ios/Modules/ShareMenuReactView.swift @@ -18,7 +18,7 @@ public class ShareMenuReactView: NSObject { } public static func attachViewDelegate(_ delegate: ReactShareViewDelegate!) { - guard (ShareMenuReactView.viewDelegate == nil) else { return } + // guard (ShareMenuReactView.viewDelegate == nil) else { return } ShareMenuReactView.viewDelegate = delegate }