Skip to content

Instantly share code, notes, and snippets.

@mikesurowiec
Created February 25, 2017 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikesurowiec/b8abe9edb9302304caff870058e08f4f to your computer and use it in GitHub Desktop.
Save mikesurowiec/b8abe9edb9302304caff870058e08f4f to your computer and use it in GitHub Desktop.
// AudioManager.swift
import Foundation
@objc(AudioManager)
class AudioManager: RCTEventEmitter {
// ...
@objc func setPlaying(_ shouldPlay: Bool,
resolver resolve: RCTPromiseResolveBlock,
rejecter reject: RCTPromiseRejectBlock) -> Void {
let isPlaying = setPlaying(shouldPlay)
resolve(isPlaying)
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment