Files
swift-mirror/stdlib/public/SDK/WatchKit/WatchKit.swift
Jordan Rose 81905be8dd Rename _BridgedNSError._NSErrorDomain to _nsErrorDomain.
This isn't strictly necessary, since it's an implementation detail, but
it's consistent with the following changes.
2016-02-24 17:46:10 -08:00

44 lines
1.5 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
@_exported import WatchKit
import Foundation
@available(iOS 8.2, *)
extension WatchKitErrorCode : _BridgedNSError {
public static var _nsErrorDomain: String { return WatchKitErrorDomain }
}
@available(iOS, introduced=8.2)
extension WKInterfaceController {
// Swift convenience type (class) method for
// reloadRootControllersWithNames:contexts: that takes an array of tuples
public class func reloadRootControllers(
namesAndContexts: [(name: String, context: AnyObject)]
) {
WKInterfaceController.reloadRootControllers(
names: namesAndContexts.map { $0.name },
contexts: namesAndContexts.map { $0.context })
}
// Swift convenience method for presentControllerWithNames:contexts: that
// takes an array of tuples
public func presentController(
namesAndContexts: [(name: String, context: AnyObject)]
) {
self.present(
names: namesAndContexts.map { $0.name },
contexts: namesAndContexts.map { $0.context })
}
}