Skip to content

Commit

Permalink
Expose the swift Snapshot class to Objective-C (#11291)
Browse files Browse the repository at this point in the history
Explicitly annotate the Snapshot class with `@objcMembers` since Swift 3 `@objc` inference is deprecated in Swift 4.

This is required for Objective-C developers to be able to use [Snapshot snapshot:@"Screenshot" timeWaitingForIdle:20];

It is not required to add `@objcMembers` in the SnapshotHelperXcode8Version.swift file since Xcode < 9 does not support Swift 4.
  • Loading branch information
0xced authored and KrauseFx committed Dec 20, 2017
1 parent 7873a04 commit f504b91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion snapshot/lib/assets/SnapshotHelper.swift
Expand Up @@ -58,6 +58,7 @@ enum SnapshotError: Error, CustomDebugStringConvertible {
}
}

@objcMembers
open class Snapshot: NSObject {
static var app: XCUIApplication!
static var cacheDirectory: URL!
Expand Down Expand Up @@ -242,4 +243,4 @@ private extension CGFloat {

// Please don't remove the lines below
// They are used to detect outdated configuration files
// SnapshotHelperVersion [1.7]
// SnapshotHelperVersion [1.8]

0 comments on commit f504b91

Please sign in to comment.