Skip to content

Commit

Permalink
Revert swizzle
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis committed Oct 10, 2023
1 parent 163762b commit f895896
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions StreamVideoSwiftUITests/StreamVideoUITestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ class StreamVideoUITestCase: XCTestCase {
animations(enabled: false)
}

open override func tearDown() {
CALayer.revertSwizzleShadow()
animations(enabled: true)
super.tearDown()
}

func animations(enabled: Bool) {
UIView.setAnimationsEnabled(enabled)
}
Expand Down
8 changes: 7 additions & 1 deletion StreamVideoTests/StreamVideoTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ open class StreamVideoTestCase: XCTestCase {
CALayer.swizzleShadow()
animations(enabled: false)
}


open override func tearDown() {
CALayer.revertSwizzleShadow()
animations(enabled: true)
super.tearDown()
}

// TODO: replace this with something a bit better
func waitForCallEvent(nanoseconds: UInt64 = 500_000_000) async throws {
try await Task.sleep(nanoseconds: nanoseconds)
Expand Down
2 changes: 1 addition & 1 deletion TestTools/SnapshotTesting/CALayer+Swizzle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extension CALayer {
swizzle(original: #selector(getter: shadowPath), modified: #selector(_swizzled_shadowPath))
}

static func reverSwizzleShadow() {
static func revertSwizzleShadow() {
swizzle(original: #selector(_swizzled_shadowOpacity), modified: #selector(getter: shadowOpacity))
swizzle(original: #selector(_swizzled_shadowRadius), modified: #selector(getter: shadowRadius))
swizzle(original: #selector(_swizzled_shadowColor), modified: #selector(getter: shadowColor))
Expand Down

0 comments on commit f895896

Please sign in to comment.