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

Fix compile errors in Xcode 14 #2146

Merged
merged 1 commit into from
Sep 13, 2022
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
4 changes: 2 additions & 2 deletions Samples/iOS-Swift/iOS-Swift/Tools/SpanObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SpanObserver: NSObject {
}
}

func performOnFinish(callback : @escaping (Span) -> Void) {
func performOnFinish(callback: @escaping (Span) -> Void) {
addSpanObserver(forKeyPath: "timestamp", callback: callback)
}

Expand All @@ -32,7 +32,7 @@ class SpanObserver: NSObject {
}
}

func addSpanObserver(forKeyPath keyPath: String, callback : @escaping (Span) -> Void) {
func addSpanObserver(forKeyPath keyPath: String, callback: @escaping (Span) -> Void) {
callbacks[keyPath] = callback
//The given span may be a SentryTracer that wont respond to KVO. We need to get the root Span
let spanToObserve = span.rootSpan() ?? span
Expand Down
2 changes: 1 addition & 1 deletion Samples/tvOS-Swift/tvOS-SBSwift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ViewController: UICollectionViewController {

struct Action {
var title: String
var callback : () -> Void
var callback: () -> Void
}

var actions: [Action]!
Expand Down
2 changes: 1 addition & 1 deletion Tests/SentryTests/Helper/UrlSessionDelegateSpy.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

class UrlSessionDelegateSpy: NSObject, URLSessionDelegate {
var delegateCallback : () -> Void = {}
var delegateCallback: () -> Void = {}

func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
delegateCallback()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class SentryFramesTrackerTests: XCTestCase {
XCTAssertEqual(0, sut.currentFrames.frozen)
}

private func assertPreviousCountBiggerThanCurrent(_ group: DispatchGroup, count: @escaping () -> UInt) {
private func assertPreviousCountBiggerThanCurrent(_ group: DispatchGroup, count: @escaping () -> UInt) {
group.enter()
fixture.queue.async {
var previousCount: UInt = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class SentryFileIOTrackingIntegrationTests: XCTestCase {
}
}

private func assertSpans( _ spansCount: Int, _ operation: String, _ description: String = "TestFile", _ block : () -> Void) {
private func assertSpans( _ spansCount: Int, _ operation: String, _ description: String = "TestFile", _ block: () -> Void) {
let parentTransaction = SentrySDK.startTransaction(name: "Transaction", operation: "Test", bindToScope: true)

block()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,21 @@ class SentryUIViewControllerSwizzlingTests: XCTestCase {
}

func testSwizzle_fromApplication_noWindowMethod() {
XCTAssertFalse(fixture.sut.swizzleRootViewController(from: MockApplication(MockApplication.MockApplicationDelegateNoWindow())))
let mockApplicationDelegate = MockApplication.MockApplicationDelegateNoWindow()
let mockApplication = MockApplication(mockApplicationDelegate)
XCTAssertFalse(fixture.sut.swizzleRootViewController(from: mockApplication))
}

func testSwizzle_fromApplication_noWindow() {
XCTAssertFalse(fixture.sut.swizzleRootViewController(from: MockApplication(MockApplication.MockApplicationDelegate(nil))))
let mockApplicationDelegate = MockApplication.MockApplicationDelegate(nil)
let mockApplication = MockApplication(mockApplicationDelegate)
XCTAssertFalse(fixture.sut.swizzleRootViewController(from: mockApplication))
}

func testSwizzle_fromApplication_noRootViewController_InWindow() {
XCTAssertFalse(fixture.sut.swizzleRootViewController(from: MockApplication(MockApplication.MockApplicationDelegate(UIWindow()))))
let mockApplicationDelegate = MockApplication.MockApplicationDelegate(UIWindow())
let mockApplication = MockApplication(mockApplicationDelegate)
XCTAssertFalse(fixture.sut.swizzleRootViewController(from: mockApplication))
}

func testSwizzle_fromApplication() {
Expand Down
2 changes: 1 addition & 1 deletion Tests/SentryTests/Networking/TestRequestManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation
@available(OSX 10.12, *)
public class TestRequestManager: NSObject, RequestManager {

private var nextResponse : () -> HTTPURLResponse? = { return nil }
private var nextResponse: () -> HTTPURLResponse? = { return nil }
var nextError: NSError?
public var isReady: Bool

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TestSentryDispatchQueueWrapper: SentryDispatchQueueWrapper {
}

var blockOnMainInvocations = Invocations<() -> Void>()
var blockBeforeMainBlock : () -> Bool = { true }
var blockBeforeMainBlock: () -> Bool = { true }

override func dispatch(onMainQueue block: @escaping () -> Void) {
blockOnMainInvocations.record(block)
Expand Down
2 changes: 1 addition & 1 deletion Tests/SentryTests/SentryScreenShotTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class SentryScreenShotTests: XCTestCase {
}

class TestWindow: UIWindow {
var onDrawHierarchy : (() -> Void)?
var onDrawHierarchy: (() -> Void)?

override func drawHierarchy(in rect: CGRect, afterScreenUpdates afterUpdates: Bool) -> Bool {
onDrawHierarchy?()
Expand Down
2 changes: 1 addition & 1 deletion Tests/SentryTests/Transaction/SentrySpanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class SentrySpanTests: XCTestCase {
func testSpanWithoutTracer_StartChild_ReturnsNoOpSpan() {
// Span has a weak reference to tracer. If we don't keep a reference
// to the tracer ARC will deallocate the tracer.
let sutGenerator : () -> Span = {
let sutGenerator: () -> Span = {
let tracer = SentryTracer()
return SentrySpan(tracer: tracer, context: SpanContext(operation: ""))
}
Expand Down