Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CPS-830] Bug fix: iOS RN SDK - DS - Invalid access token overlaps with the icon #18

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FireworkVideoUI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FireworkVideoUI'
s.version = '0.1.1'
s.version = '0.1.2'
s.summary = 'An extension library meant to provide easier interfaces for the FireworkVideoSDK.'
s.homepage = 'https://github.com/loopsocial/firework_ios_sdk_ui_extensions'
s.license = 'Apache License, Version 2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,32 @@ extension UIView {
view.viewType = .normal
}

let swiftUIImageLayerClassName = "SW1hZ2VMYXllcg==".decodeBase64String()
let swiftUITextLayerClassName = "Q0dEcmF3aW5nTGF5ZXI=".decodeBase64String()
let layerClassName = String(describing: type(of: self.layer))

if AppLanguageManager.shared.shouldHorizontalFlip,
layerClassName == swiftUITextLayerClassName ||
layerClassName == swiftUIImageLayerClassName {
view.viewType = .normal
}

DispatchQueue.main.async {
if AppLanguageManager.shared.shouldHorizontalFlip {
let swiftUIImageLayerClassName = "SW1hZ2VMYXllcg==".decodeBase64String()
let swiftUITextLayerClassName = "Q0dEcmF3aW5nTGF5ZXI=".decodeBase64String()
let layerClassName = String(describing: type(of: self.layer))
if layerClassName == swiftUITextLayerClassName {
view.viewType = .normal
} else if layerClassName == swiftUIImageLayerClassName {
var resultViewType = LayoutFlipViewType.normal
if let contents = self.layer.contents as? CFTypeRef,
CFGetTypeID(contents) == CGImage.typeID {
let image = self.layer.contents as! CGImage
for imageName in gNamesOfImagesWithDirection {
let imageWithDirection = UIImage(
named: imageName,
in: Bundle(for: FireworkVideoSDK.self),
compatibleWith: nil
)?.cgImage
if image == imageWithDirection {
resultViewType = .flip
break
}
}
if AppLanguageManager.shared.shouldHorizontalFlip,
layerClassName == swiftUIImageLayerClassName,
let contents = self.layer.contents as? CFTypeRef,
CFGetTypeID(contents) == CGImage.typeID {
let image = self.layer.contents as! CGImage
for imageName in gNamesOfImagesWithDirection {
let imageWithDirection = UIImage(
named: imageName,
in: Bundle(for: FireworkVideoSDK.self),
compatibleWith: nil
)?.cgImage
if image == imageWithDirection {
view.viewType = .flip
break
}
view.viewType = resultViewType
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ extension UIView {
cls: self,
originalSelector: #selector(UIView.snapshotView(afterScreenUpdates:)),
customSelector: #selector(UIView.fw_snapshotView(afterScreenUpdates:)))
Swizzle.swizzleSelector(
cls: self,
originalSelector: #selector(UIView.layoutSubviews),
customSelector: #selector(UIView.fw_layoutSubviews))
}

var viewType: LayoutFlipViewType {
Expand Down Expand Up @@ -137,6 +141,11 @@ extension UIView {
return view
}

@objc func fw_layoutSubviews() {
fw_layoutSubviews()
renewLayerTransformForceRecursively(false)
}

func renewLayerTransformForceRecursively(_ forceRecursively: Bool) {
if !isIOSSDKView {
return
Expand Down
Loading