From 3b25e7c37ccc895eca655583dfdc5c29bbf177f9 Mon Sep 17 00:00:00 2001 From: Muukii Date: Thu, 8 Jun 2023 20:46:34 +0900 Subject: [PATCH] Patch --- Podfile.lock | 4 +-- .../Elements/GradientLayerNode.swift | 2 +- .../Tools/NamedDisplayCellNodeBase.swift | 15 +++++++++ .../Tools/NamedDisplayNodeBase.swift | 31 +++++++++++++++++++ TextureSwiftSupport.podspec | 2 +- 5 files changed, 50 insertions(+), 4 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 94f4305..9218bd0 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -80,10 +80,10 @@ SPEC CHECKSUMS: StorybookUI: aa60ba1ea5a169f39134822cddd2248f3840b79e Texture: 2e8ab2519452515f7f5a520f5a8f7e0a413abfa3 TextureBridging: ddc11a6abed757a57996ab7e0d2b37c78de7e6e0 - TextureSwiftSupport: 2de508abb74363be84f02721c5f0c273439963ee + TextureSwiftSupport: 9b02a51fdaf661e6b90403e73589986f250accae TypedTextAttributes: 8b363a82553099d885c9f06648ae9aed09bec263 Verge: 5199d7de11162b5568697dabdfab4f83d99d6436 PODFILE CHECKSUM: 4e988e9c85417e182d501d68fba7509ae874fb53 -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.1 diff --git a/Sources/Components/Elements/GradientLayerNode.swift b/Sources/Components/Elements/GradientLayerNode.swift index 0c4f0c7..68810b9 100644 --- a/Sources/Components/Elements/GradientLayerNode.swift +++ b/Sources/Components/Elements/GradientLayerNode.swift @@ -36,7 +36,7 @@ open class GradientLayerNode : ASDisplayNode { open override var supportsLayerBacking: Bool { return false } - + public var gradientLayer: CAGradientLayer { view.layer as! CAGradientLayer } diff --git a/Sources/Components/Tools/NamedDisplayCellNodeBase.swift b/Sources/Components/Tools/NamedDisplayCellNodeBase.swift index 2b67497..a316771 100644 --- a/Sources/Components/Tools/NamedDisplayCellNodeBase.swift +++ b/Sources/Components/Tools/NamedDisplayCellNodeBase.swift @@ -74,4 +74,19 @@ open class NamedDisplayCellNodeBase: ASCellNode { } } + open var overrideUserinterfaceStyle: UIUserInterfaceStyle = .unspecified + + open override func setPrimitiveTraitCollection(_ traitCollection: ASPrimitiveTraitCollection) { + + // 🤷🏻‍♂️ + // texture does not support for UIView.overrideUserinterfaceStyle + var _traitCollection = traitCollection + if case .unspecified = overrideUserinterfaceStyle { + + } else { + _traitCollection.userInterfaceStyle = overrideUserinterfaceStyle + } + super.setPrimitiveTraitCollection(_traitCollection) + } + } diff --git a/Sources/Components/Tools/NamedDisplayNodeBase.swift b/Sources/Components/Tools/NamedDisplayNodeBase.swift index 535c04f..c0e3137 100644 --- a/Sources/Components/Tools/NamedDisplayNodeBase.swift +++ b/Sources/Components/Tools/NamedDisplayNodeBase.swift @@ -79,6 +79,21 @@ open class NamedDisplayNodeBase: ASDisplayNode { } } + open var overrideUserinterfaceStyle: UIUserInterfaceStyle = .unspecified + + open override func setPrimitiveTraitCollection(_ traitCollection: ASPrimitiveTraitCollection) { + + // 🤷🏻‍♂️ + // texture does not support for UIView.overrideUserinterfaceStyle + var _traitCollection = traitCollection + if case .unspecified = overrideUserinterfaceStyle { + + } else { + _traitCollection.userInterfaceStyle = overrideUserinterfaceStyle + } + super.setPrimitiveTraitCollection(_traitCollection) + } + } /// An object from Abstract base class @@ -131,4 +146,20 @@ open class NamedDisplayControlNodeBase: ASControlNode { handler(self, action) } } + + open var overrideUserinterfaceStyle: UIUserInterfaceStyle = .unspecified + + open override func setPrimitiveTraitCollection(_ traitCollection: ASPrimitiveTraitCollection) { + + // 🤷🏻‍♂️ + // texture does not support for UIView.overrideUserinterfaceStyle + var _traitCollection = traitCollection + if case .unspecified = overrideUserinterfaceStyle { + + } else { + _traitCollection.userInterfaceStyle = overrideUserinterfaceStyle + } + super.setPrimitiveTraitCollection(_traitCollection) + } + } diff --git a/TextureSwiftSupport.podspec b/TextureSwiftSupport.podspec index 751f9f9..f0cbc1b 100644 --- a/TextureSwiftSupport.podspec +++ b/TextureSwiftSupport.podspec @@ -10,7 +10,7 @@ Pod::Spec.new do |spec| spec.license = "MIT" spec.author = { "Muukii" => "muukii.app@gmail.com" } spec.social_media_url = "https://twitter.com/muukii_app" - spec.platform = :ios, "11.0" + spec.platform = :ios, "12.0" spec.source = { :git => "https://github.com/TextureCommunity/TextureSwiftSupport.git", :tag => "#{spec.version}" } spec.swift_versions = ["5.6"]