Post

Replies

Boosts

Views

Activity

Reply to AVPlayerLooper fails when there is a AVVideoComposition
Now I'm really pulling my hair out. I added this test to be 100% sure the video was properly constructed:let ret = videoComposition.isValid(for: asset, timeRange: timeRange, validationDelegate: self) print("VALIDATE", ret)All possible delegate calls implemented with print statemens - but it returns true and I got no delegate calls. But now, the looper is not failing! Sixteen loops so far and still going strong (will leave it on!). Grrrrr
Dec ’19
Reply to AVPlayerLooper fails when there is a AVVideoComposition
OK - never fails now if there is no filtering?!?! But if I add a filter (either of the two), then it fails at the next loop: let videoComposition = AVVideoComposition(asset: asset, applyingCIFiltersWithHandler: { request in var outputImage = request.sourceImage defer { request.finish(with: outputImage, context: nil) } do { var angle = self.hueAngle let radians = degrees2radians(angle) angle = (angle + 1) % 360 self.hueAngle = angle self.hueFilter.angle = radians self.hueFilter.inputImage = outputImage outputImage = self.hueFilter.outputImage! } do { var radius = self.radius let inc = self.inc radius += inc if radius > 5 { radius = 5 self.inc *= -1 } if radius < 0 { radius = 0 self.inc *= -1 } self.radius = radius self.blurFilter.radius = radius self.blurFilter.inputImage = outputImage outputImage = self.blurFilter.outputImage! } })Obviously validating the composition makes something better in the composition object.
Dec ’19
Reply to NavigationLinks only work once?
Experiencing the same thing on the Simulator. What is interesting is that if you alternate - select the first row, go back, select the second row, go back, then you can select the first row again. The issue is that you cannot select the same row again.Is there a bug report on this?
Jan ’20
Reply to Why does unwrapping an optional func change its signature?
I understand optional protocols. The compiler knows its optional, that's why "delegate.stream" cannot be called directly.I correctly guessed that I could add a "?" and use this "delegate.stream?(fetcher, handle: .openCompleted)", which compiles just fine.Then it occurred to me - why not try to get the function as its own variable, assuming it exists, with "let stream = delegate.stream" in the guard statement. That works fine.But when I go to use this function, I get a warning that the "handle:" parameter should not be there. It is this error I don' understand.
Jan ’20
Reply to How to use NWPathMonitor to assess overall network state?
Turns out the NWPath has an array of interfaces ("availableInterfaces)", they are hashable. So one can keep an array of interfaces and their state.That said, I did testing with my phone, turning WIFI and Cellular on and off, singly or together, to see when the block gets called. Based on that, I determine:1) the status of the last block is the overall status (satisfied or not)2 the last status message of "satisfied" returns the expensive state of the overall networking path: if the system believes it can use WIFI, then its false. If the only option is cellular, then its expensive.In other words, if you turn cellular on, then wifi, then wifi off, the last status message references cellular and expensive is set.
Jan ’20
Reply to Please clarify Combine Demand usage
Claude, I'm writing my own Publisher, Subscriber, and Subscriptions. Most everyone uses infinite demands so my questions don't apply, I really want to understand actual usage and with no demo code from Apple using it, no way to know.I recently wrote a small article on Combine, and there are a slew of them on the web, and each has a different take on the topic. So many are wrong, and it would just be great to get this clarified.
Apr ’20
Reply to WWDC 2018 Todays Internet: replacing Reachability with ...?
So I was going to post this question again, when I saw I already had done so 2 years ago!I poked around today and sort of answered my own question. The Network framework has this NWPathMonitor - it gives you notification when things change - WIFI state changes, celllular, even more.But what really helps if that you can find out if you can reach the "real" internet. You can probe if there is an active DNS and gateway(s).This is exactly what I had been looking for. Its not pinging the target host, but I now believe its as good as Reachability if not better (I understand Reachability is just confirming it can access the desired host entry in a DNS)What really cleared this up for me was an article written by Ross Butler : "Detecting Internet Access on iOS 12+". He also talks about how to use this framework to detect "Captive Portals" too.PS: my situation today is that the iOS device running my app will switch between internet wifi and a local hardware device. The above works perfect to know what the connection is!
May ’20
Reply to Indicate offset to Background URL file upload session?
FB8335267 A second idea, again probably flawed. I see that APFS supports file "clones", that when first created allows one file to be a clone of another. From then on, edits to the cloned file will change the area modified, but leave much of the file the same. The big question: how to "trim" leading bytes from the clone, while leaving the rest of the file pointing to the original. My guess is this is impossible, but maybe not - comments? David
Aug ’20