Skip to content

Commit 9d11f22

Browse files
committed
Remove explicit construction of AnyHashable values in dictionary literal.
1 parent 8f3fc15 commit 9d11f22

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

PlaygroundSupport/PlaygroundSupport/PlaygroundPage.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public final class PlaygroundPage {
5050
///
5151
public var needsIndefiniteExecution: Bool = false {
5252
didSet {
53-
NotificationCenter.default.post(name: "PlaygroundPageNeedsIndefiniteExecutionDidChangeNotification" as NSString as NSNotification.Name, object: self, userInfo: [ AnyHashable("PlaygroundPageNeedsIndefiniteExecution") : needsIndefiniteExecution as AnyObject])
53+
NotificationCenter.default.post(name: "PlaygroundPageNeedsIndefiniteExecutionDidChangeNotification" as NSString as NSNotification.Name, object: self, userInfo: [ "PlaygroundPageNeedsIndefiniteExecution" : needsIndefiniteExecution as AnyObject])
5454
}
5555
}
5656

@@ -88,9 +88,9 @@ public final class PlaygroundPage {
8888
if let liveView = liveView {
8989
switch liveView.playgroundLiveViewRepresentation {
9090
case .viewController(let viewController):
91-
userInfo = [AnyHashable("PlaygroundPageLiveViewController") : viewController]
91+
userInfo = ["PlaygroundPageLiveViewController" : viewController]
9292
case .view(let view):
93-
userInfo = [AnyHashable("PlaygroundPageLiveView") : view]
93+
userInfo = ["PlaygroundPageLiveView" : view]
9494
}
9595
}
9696
else {

PlaygroundSupport/XCPlayground/XCPlaygroundPage.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public final class XCPlaygroundPage {
4545
/// - note: This function has been deprecated.
4646
@available(*,deprecated) public func captureValue<T>(value: T, withIdentifier identifier: String) {
4747
if let value = value as? AnyObject {
48-
NotificationCenter.default.post(name: "XCPCaptureValue" as NSString as NSNotification.Name, object: self, userInfo: [ AnyHashable("value") : value, AnyHashable("identifier"): identifier as AnyObject])
48+
NotificationCenter.default.post(name: "XCPCaptureValue" as NSString as NSNotification.Name, object: self, userInfo: [ "value" : value, "identifier": identifier as AnyObject])
4949
}
5050
}
5151

@@ -62,7 +62,7 @@ public final class XCPlaygroundPage {
6262
@available(*,deprecated,message:"Use 'PlaygroundPage.current.needsIndefiniteExecution' from the 'PlaygroundSupport' module instead")
6363
public var needsIndefiniteExecution: Bool = false {
6464
didSet {
65-
NotificationCenter.default.post(name: "XCPlaygroundPageNeedsIndefiniteExecutionDidChangeNotification" as NSString as NSNotification.Name, object: self, userInfo: [ AnyHashable("XCPlaygroundPageNeedsIndefiniteExecution") : needsIndefiniteExecution as AnyObject])
65+
NotificationCenter.default.post(name: "XCPlaygroundPageNeedsIndefiniteExecutionDidChangeNotification" as NSString as NSNotification.Name, object: self, userInfo: [ "XCPlaygroundPageNeedsIndefiniteExecution" : needsIndefiniteExecution as AnyObject])
6666
}
6767
}
6868

@@ -102,9 +102,9 @@ public final class XCPlaygroundPage {
102102
if let liveView = liveView {
103103
switch liveView.playgroundLiveViewRepresentation() {
104104
case .ViewController(let viewController):
105-
userInfo = [AnyHashable("XCPlaygroundPageLiveViewController") : viewController]
105+
userInfo = ["XCPlaygroundPageLiveViewController" : viewController]
106106
case .View(let view):
107-
userInfo = [AnyHashable("XCPlaygroundPageLiveView") : view]
107+
userInfo = ["XCPlaygroundPageLiveView" : view]
108108
}
109109
}
110110
else {

0 commit comments

Comments
 (0)