Created
July 8, 2018 19:08
-
-
Save KaneCheshire/4b871955d78b4b13a64a6867792561ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Step { | |
@discardableResult | |
init(I handler: () -> Void) { | |
runActivity(for: handler) | |
} | |
@discardableResult | |
init(I handler: @autoclosure () -> Void) { | |
runActivity(for: handler) | |
} | |
private func runActivity(for handler: () -> Void) { | |
let activityName = // Somehow turn the handler into a descriptive string for the activity name | |
XCTContext.runActivity(named: activityName) { _ in | |
handler() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment