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
/// Export MPMediaItem to temporary file. | |
/// | |
/// - Parameters: | |
/// - assetURL: The `assetURL` of the `MPMediaItem`. | |
/// - completionHandler: Closure to be called when the export is done. The parameters are a boolean `success`, the `URL` of the temporary file, and an optional `Error` if there was any problem. The parameters of the closure are: | |
/// | |
/// - fileURL: The `URL` of the temporary file created for the exported results. | |
/// - error: The `Error`, if any, of the asynchronous export process. | |
func export(_ assetURL: URL, completionHandler: @escaping (_ fileURL: URL?, _ error: Error?) -> ()) { |
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
import WatchConnectivity | |
class WatchSessionManager: NSObject, WCSessionDelegate { | |
static let sharedManager = WatchSessionManager() | |
private override init() { | |
super.init() | |
} | |
private let session: WCSession? = WCSession.isSupported() ? WCSession.default : nil |