Skip to content

Commit

Permalink
chore: Removing unused argument (#4621)
Browse files Browse the repository at this point in the history
SentryViewPhotographer had an unused argument for SentryViewPhotographer.image()
  • Loading branch information
brustolin authored Dec 11, 2024
1 parent 506e809 commit fce741e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class SentrySessionReplay: NSObject {

let screenName = delegate?.currentScreenNameForSessionReplay()

screenshotProvider.image(view: rootView, options: replayOptions) { [weak self] screenshot in
screenshotProvider.image(view: rootView) { [weak self] screenshot in
self?.newImage(image: screenshot, forScreen: screenName)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Swift/Tools/SentryViewPhotographer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SentryViewPhotographer: NSObject, SentryViewScreenshotProvider {
self.redactBuilder = UIRedactBuilder(options: redactOptions)
}

func image(view: UIView, options: SentryRedactOptions, onComplete: @escaping ScreenshotCallback ) {
func image(view: UIView, onComplete: @escaping ScreenshotCallback ) {
let redact = redactBuilder.redactRegionsFor(view: view)
let image = renderer.render(view: view)

Expand Down
2 changes: 1 addition & 1 deletion Sources/Swift/Tools/SentryViewScreenshotProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ typealias ScreenshotCallback = (UIImage) -> Void

@objc
protocol SentryViewScreenshotProvider: NSObjectProtocol {
func image(view: UIView, options: SentryRedactOptions, onComplete: @escaping ScreenshotCallback)
func image(view: UIView, onComplete: @escaping ScreenshotCallback)
}
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import XCTest
class SentrySessionReplayTests: XCTestCase {

private class ScreenshotProvider: NSObject, SentryViewScreenshotProvider {
var lastImageCall: (view: UIView, options: SentryRedactOptions)?
func image(view: UIView, options: Sentry.SentryRedactOptions, onComplete: @escaping Sentry.ScreenshotCallback) {
var lastImageCall: UIView?
func image(view: UIView, onComplete: @escaping Sentry.ScreenshotCallback) {
onComplete(UIImage.add)
lastImageCall = (view, options)
lastImageCall = view
}
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/SentryTests/SentryViewPhotographerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentryViewPhotographerTests: XCTestCase {
return SentryViewPhotographer(renderer: TestViewRenderer(), redactOptions: RedactOptions())
}

private func prepare(views: [UIView], options: any SentryRedactOptions = RedactOptions()) -> UIImage? {
private func prepare(views: [UIView]) -> UIImage? {
let rootView = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
rootView.backgroundColor = .white
views.forEach(rootView.addSubview(_:))
Expand All @@ -28,7 +28,7 @@ class SentryViewPhotographerTests: XCTestCase {
let expect = expectation(description: "Image rendered")
var result: UIImage?

sut.image(view: rootView, options: options) { image in
sut.image(view: rootView) { image in
result = image
expect.fulfill()
}
Expand Down

0 comments on commit fce741e

Please sign in to comment.