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
Post
Replies
Boosts
Views
Activity
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.
Entered a bug on Swift.org, it was accepted, and as a result two other bugs were found :-)https://bugs.swift.org/browse/SR-11934
It just seems I can do better with my own Text() view in a HStack, but haven't tried. The Stepper could be shown in an iPad with a huge amount of space, or in a small iPhone, so no easy way to apply a frame to it. It sure seems odd to me that the text size shrinks with the minimumScaleFactor regardless of the number of characters.
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?
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.
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.
BTW, those warnings (and I'm dealing with them too in an open source lib) are now hard errors in Xcode 11.4-beta. FYI.
Thank you so much for this! One question - does xcodebuild examine each library to determine what architecture (and in the case of x86/arm) determine what the target device is? So no need for some manifest telling it this info I guess.Again - thanks so much!
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.
Combine is Apple proprietary, so I didn't think it appropriate (but did see another one there).Done: forums.swift.org / t / need-help-using-combine-demand-back-pressure / 35015
I finally tracked the problem down. A framework Bugsee installed a video monitor in a displayLink. It probably got frames and then released them immediately, but the memory trashing took Instruments down. When I disabled most of Bugsee features relating to video/screen capture, this problem went away.
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!
To anyone else reading this: its not obvious, just click on your profile to the left of the Edit button - don't hit the edit button. Took me a while to figure that out.
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