From f96c97032aef6dbcea179ed8e9867868b400b770 Mon Sep 17 00:00:00 2001 From: Dominic Go <18517029+dominicstop@users.noreply.github.com> Date: Fri, 19 May 2023 08:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20Update:=20`RNIComputableSizeMode?= =?UTF-8?q?`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Make public. --- .../RNIComputable/RNIComputableOffset.swift | 4 ++-- .../RNIComputable/RNIComputableSize.swift | 16 ++++++++-------- .../RNIComputable/RNIComputableSizeMode.swift | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ios/src_library/React Native/RNIComputable/RNIComputableOffset.swift b/ios/src_library/React Native/RNIComputable/RNIComputableOffset.swift index 88d448b2..b683ce54 100644 --- a/ios/src_library/React Native/RNIComputable/RNIComputableOffset.swift +++ b/ios/src_library/React Native/RNIComputable/RNIComputableOffset.swift @@ -32,14 +32,14 @@ public struct RNIComputableOffset { public var offset: Double; public var offsetOperation: OffsetOperation; - func compute(withValue value: Double) -> Double { + public func compute(withValue value: Double) -> Double { return self.offsetOperation.compute(a: self.offset, b: value); }; }; extension RNIComputableOffset { - init?(fromDict dict: NSDictionary){ + public init?(fromDict dict: NSDictionary){ guard let offset = dict["offset"] as? NSNumber else { return nil }; self.offset = offset.doubleValue; diff --git a/ios/src_library/React Native/RNIComputable/RNIComputableSize.swift b/ios/src_library/React Native/RNIComputable/RNIComputableSize.swift index 494eeb42..7440639a 100644 --- a/ios/src_library/React Native/RNIComputable/RNIComputableSize.swift +++ b/ios/src_library/React Native/RNIComputable/RNIComputableSize.swift @@ -10,12 +10,12 @@ import JavaScriptCore public struct RNIComputableSize { - let mode: RNIComputableSizeMode; + public let mode: RNIComputableSizeMode; - let offsetWidth: RNIComputableOffset?; - let offsetHeight: RNIComputableOffset?; + public let offsetWidth: RNIComputableOffset?; + public let offsetHeight: RNIComputableOffset?; - func computeOffsets(withSize size: CGSize) -> CGSize { + public func computeOffsets(withSize size: CGSize) -> CGSize { let offsetWidth = self.offsetWidth?.compute(withValue: size.width); @@ -28,7 +28,7 @@ public struct RNIComputableSize { ); }; - func compute( + public func compute( withTargetSize targetSize: CGSize, currentSize: CGSize ) -> CGSize { @@ -50,7 +50,7 @@ public struct RNIComputableSize { }; }; - func computeWithOffsets( + public func computeWithOffsets( withTargetSize targetSize: CGSize, currentSize: CGSize ) -> CGSize { @@ -64,7 +64,7 @@ public struct RNIComputableSize { }; extension RNIComputableSize { - init?(fromDict dict: NSDictionary){ + public init?(fromDict dict: NSDictionary){ guard let mode = RNIComputableSizeMode(fromDict: dict) else { return nil }; @@ -87,7 +87,7 @@ extension RNIComputableSize { }(); }; - init(mode: RNIComputableSizeMode){ + public init(mode: RNIComputableSizeMode){ self.mode = mode; self.offsetWidth = nil; self.offsetHeight = nil; diff --git a/ios/src_library/React Native/RNIComputable/RNIComputableSizeMode.swift b/ios/src_library/React Native/RNIComputable/RNIComputableSizeMode.swift index 6ed77dd8..c9f01504 100644 --- a/ios/src_library/React Native/RNIComputable/RNIComputableSizeMode.swift +++ b/ios/src_library/React Native/RNIComputable/RNIComputableSizeMode.swift @@ -15,7 +15,7 @@ public enum RNIComputableSizeMode { }; extension RNIComputableSizeMode { - init?(fromDict dict: NSDictionary){ + public init?(fromDict dict: NSDictionary){ guard let mode = dict["mode"] as? String else { return nil }; switch mode {