First of all I would like to say that I'm not that advanced in swift. But I wanted to build a custom videoplayer on top of the player library which can be found here:
https://github.com/piemonte/Player
While including it in my swift 3.0 project I ran into some problems that I can't solve myself so I would like to ask you guys for a bit of help. I'm receiving the following error:
Expression pattern of type 'Int' cannot match values of type UnsafeMutablePointer<Void>?
This happens in the following bit of code. (I excluded all irrelevant pieces, so the code might jump from time to time.):
private var PlayerObserverContext = 0
private func commonInit() {
self.player.addObserver(self, forKeyPath: PlayerRateKey, options: ([NSKeyValueObservingOptions.new, NSKeyValueObservingOptions.old]) , context: &PlayerObserverContext)
}
deinit {
self.player.removeObserver(self, forKeyPath: PlayerRateKey, context: &PlayerObserverContext)
}
override public func observeValue(forKeyPath keyPath: String?, of object: AnyObject?, change: [NSKeyValueChangeKey : AnyObject]?, context: UnsafeMutablePointer<Void>?) {
switch (keyPath, context) {
case (.some(PlayerRateKey), PlayerObserverContext):
true
default:
true
}
The error takes place on the line:
case (.some(PlayerRateKey), PlayerObserverContext):
I hope this is enough. If you have any questions or want me to clarify some things a bit more let me know! Thanks in advance.