Skip to content

Instantly share code, notes, and snippets.

@mattyohe
Created March 10, 2015 21:57
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 mattyohe/4f685131b0674e4354c4 to your computer and use it in GitHub Desktop.
Save mattyohe/4f685131b0674e4354c4 to your computer and use it in GitHub Desktop.
uncompiled swift code (probably has errors!)
class PlayerView : UIView {
var player: AVPlayer {
get{
var layer = self.layer as AVPlayerLayer
return layer.player
}
set {
var layer: AVPlayerLayer = self.layer as AVPlayerLayer
layer.player = newValue
}
}
override class func layerClass() -> AnyClass {
return AVPlayerLayer.self
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment