This topic was touched on in the notes for the WWDC 2019 session on Binary Frameworks - I even watched the whole video but it wasn't covered there.It appears I should be able to wrap a static library - one that is created by its own (complex) build scripts - and have iOS, iOS Simulator and macOS versions. Also, that the header files can be included as well.I have been unable to find any information googling around on how one might do this. I would greatly appreciate any pointers to some blog/post that covers this.Thanks!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I didn't really find anything in Apple docs on how to debug my extension using Xcode (so not saying it doesn't exist).
I found a current Stack post on it, with several devs all stuck. In 2024 someone said run the Preview Extension, select Finder as the test app, then in a Finder window select a file of the correct type and tap space.
Nothin happens when I do this (I get the file icon showing).
Suggestions most welcome!
Just had a weird crash in development in Simulator - first of a kind. The crash was on this line:private lazy var regExTrimSet = NSCharacterSet(charactersInString: " \t\r\n_")and the error was some malloc() already released (grrr, should have copied it). Should that be thread safe? [Its being referenced by a bunch of concurrent blocks at one point]Also, I tried to find out where the Xcode console log might get written, but had no luck finding a link. Is there one that this error should be logged to?
I read today in the Swift book:__weak typeof(self) weakSelf = self;
self.block = ^{
__strong typeof(self) strongSelf = weakSelf;
[strongSelf doSomething];
}
// Excerpt From: Apple Inc. “Using Swift with Cocoa and Objective-C (Swift 3.1).”When I saw '__strong' I got a bit concerned - in the past I had always used "typeof(self) strongSelf = weakSelf;, think the typeof made strongSelf strong.Yikes! Did I get it wrong all these years???
What I'd like to do is provide a CVPixelBuffer as the dataInfo argument to CGDataProviderCreateWithData that has an initializer:init?(dataInfo info: UnsafeMutableRawPointer?,
data: UnsafeRawPointer,
size: Int,
releaseData: @escaping CGDataProviderReleaseDataCallback)My best (and probably wrong) approach to convert to a UnsafeRawPointer is:let pixelBuffer: CVPixelBuffer
...
let ptr: UnsafeMutableRawPointer = UnsafeMutableRawPointer(mutating: &pixelBuffer)However, the releaseData callback function is defined as:typealias CGDataProviderReleaseDataCallback = (UnsafeMutableRawPointer?, UnsafeRawPointer, Int) -> VoidI cannot think of any way to get the CVPixelBuffer back from the UnsafeMutableRawPointer. Clearly I need help!
Feedback FB7556677This is my code:private lazy var pmC = NWPathMonitor(requiredInterfaceType: .cellular)
private lazy var pmW = NWPathMonitor(requiredInterfaceType: .wifi)
pmC.pathUpdateHandler = { (path: NWPath) in
print("C PATH STATUS:", path.status)
path.availableInterfaces.forEach( { interfce in
DispatchQueue.main.async {
print(" C INTERFACE:", interfce, "Status:", path.status)
}
} )
}
pmC.start(queue: assetQueue)
pmW.pathUpdateHandler = { (path: NWPath) in
print("W PATH STATUS:", path.status)
path.availableInterfaces.forEach( { interfce in
DispatchQueue.main.async {
print(" W INTERFACE:", interfce, "Status:", path.status)
}
} )
}
pmW.start(queue: assetQueue)Do a test. Lauch with both cellular and wifi on. Works as expected. Turn WIFI off, works again. Turn WIFI back on - nothing. So as far as I know, I've only got an "expensive network" available, even though WIFI is on and I can use it in Safari.Console Log:// WIFI and CELLULAR ON, launch
C PATH STATUS: satisfied
W PATH STATUS: satisfied
C INTERFACE: pdp_ip0 Status: satisfied
W INTERFACE: en0 Status: satisfied
// Turn Cell off
C PATH STATUS: unsatisfied
// Turn WIFI off
W PATH STATUS: unsatisfied
// Turn Cell on
C PATH STATUS: satisfied
C INTERFACE: pdp_ip0 Status: satisfied
C PATH STATUS: satisfied
C INTERFACE: pdp_ip0 Status: satisfied
C PATH STATUS: satisfied
C INTERFACE: pdp_ip0 Status: satisfied
// WIFI on
... nothingEven switched to Safari, opened a web page, then switched back. Nothing after many minutes.Note: iOS 13.3 iPhone 6s+ I tried and tried to get a sysdiagnose - volume buttons and power button for 1+ seconds, nothing happens.
Combine has two related functions that support "demand", where Subscribers inform Publishers on the desired number of elements passed to them in a "receive" function. The below ignores infinite demand.1) func request(_ demand: Subscribers.Demand)Subscriptions provide this function, and as the Apple Docs say:"Tells a publisher that it may send more values to the subscriber."Matt Gallagher supposes in his excellent 22 Combine Tests article that each of these demands should be additive, and when the Subscription sends elements to the Subscriber, it decrements the count.2) func receive(_ input: Self.Input) -> Subscribers.DemandWhen a Subscriber receives data, it returns another demand, which the Apple docs state is:"A Subscribers.Demand instance indicating how many more elements the subscriber expects to receive."I have seen various interpretations on how these numbers relate, and I of course have my own that I'll postulate here.---A Publisher has a one element, and it gets a 'request(.max(10))' When it sends that to the Subscriber, and the return demand should be '.max(9)', a reminder to the Publisher (actually a Subscription created by the Publisher) that its expecting 9 more elements.If for some reason the Subscriber decides to send in another request for .max(10), and the Publisher gets one more element, and messages the Subscriber with that one element, the return will then be .max(18), meaning, Subscriber wanted 10, then it wanted 10 more, but it has only received 2.Alternate interpretations seem to be that the return from receive is additive to the running total. So any number other than 0 will increase what the Publisher can send.Would be super if anyone in the know could help clarify!!!
I read that since iOS13 its possible to read an external drive connected via the Lightning port.
Is it possible to read files from myApp? If so how.
Thanks!
My company's app uses the following code to look for services advertised by a Garmin VIRB 360 camera (now discontinued and unsupported).
In the past this code has worked fine. However, on my iPhone 12 Pro Max running iOS 15.0.2 it returns no services.
let serviceBrowser = NetServiceBrowser()
serviceBrowser.searchForServices(ofType: "_garmin-virb._tcp.", inDomain: "local.")
Did something change in iOS 15? Do I need some entitlement? Is the format of the strings incorrect?
My recollection is that the strings are from Garmin document (but its years old).
Any help greatly appreciated!
We had working code a few years ago, for a seldom used feature (streaming the camera image from a VIRB 360 camera).
Trying to get it working again, but when I use a URLSession Data task to try and connect to this URL:
rtsp://192.168.0.1/livePreviewStream?maxResolutionVertical=0
I get an error: Code=-1002 "unsupported URL"
I vaguely remember trying to add permissions in the Info.plist for the local network, but it turned out for "http" we didn't need .t (so it got removed).
But now I can't find a reference to it.
Does the above error code look like its related to permissions? If not what?
Thanks for any pointers!
David
App build with latest Xcode latest MacOS, deployment is iOS 14.
It seems that in one App update, the search bar moved from centered low near the bottom of the NavigationBar to the right of the rightBarButtons. Previously we saw this:
Now we get this with the exact same code:
I dug around the UINavigationItem documentation, and there is a new property that lets you set the preferred placement:
if (@available(iOS 16.0, *)) {
navigationItem.preferredSearchBarPlacement = UINavigationItemSearchBarPlacementStacked;
}
That restore what our users use to see. But it will only work if the user is on iOS 16 - is there someway to get the old behavior on iOS 14+?
We directly set the navItem's searchBar: navigationItem.searchController = searchController
David
PS: I have to believe something changed in the iOS frameworks that caused this - our code hasn't changed in this area for years.
Have an app with Storyboards that use a few customer fonts (Poppins and FontAwesome). No issues at all in Xcode 14.
Updated to Xcode 15, and can build clean and run no issues reported. But many of the buttons and labels have the incorrect custom Font assigned - instead of FontAwesome, the get assigned Poppin. In a few cases FontAwesome is used, but the incorrect weight (I log the button font in awakeFromNib.
I've looked at the Storyboard XML, it looks fine, and if I set the font to some system font all works fine. Setting it to a system font, then back to FontAwesome does not fix anything, and the XML looks identical to what it was before.
I'm at a total loss as to what to do next. Any suggestions most appreciated.
PS: in awakeFromNib, I can set the font to the correct FontAwsome font, and the control shows as it should. So the font works from code, not from the Storyboard.
Some confusion in my company on this scenario:
current users are on 1.0.0 - have been for months
Apple approves our latest build, say 1.1.0, and we release to the App Store with "Slow Rollout"
a few days later, one of the first 1% reports a serious bug
the dev team immediately fixes the bug, QA approves it, and we upload a new 1.1.1 release the same day
we ask Apple for expedited approval, and that happens in 3 hours
we select "Release 1.1.1 on Slow Rollout" on the App Store.
So what then?
My understanding is that once 1.1.1 is released, since 1.1.0 is the "Official Release", that anyone with auto update turned on will update quickly to 1.1.0, and that then some of those users will be put into the "1.1.1 slow roll out candidate pool)".
Others have opined that I'm wrong - that most users will stay at 1.0.0, and the new 1.1.1 candidate pool will be users on both 1.0.0 and 1.1.0.
Would love to hear someone reply who knows what Apple will really do.
I'm getting infrequent crashes when I try to show a newly created PDF. The PDF is file based, and shortly after UIGraphicsEndPDFContext its shown.
The crash reports make it appear that the file itself is being mutated after its displayed.
So my question: is the file (self.filePath) absolutely flushed and closed when UIGraphicsEndPDFContext returns?
If not, is there some way to detect when it has finished?
Thanks!
David
`func addPageNumbers() {
let url = URL(fileURLWithPath: filePath)
guard let document = CGPDFDocument(url as CFURL) else { return }
// You have to change the file path otherwise it can cause blank white pages to be drawn.
self.filePath = "\(filePath)-final.pdf"
UIGraphicsBeginPDFContextToFile(filePath, .zero, nil)
let pageCount = document.numberOfPages
for i in 1...pageCount {
...
}
}
UIGraphicsEndPDFContext()
}
I'm sorta baffled right now. I am trying to wonder how I might detect a updated SQL Store in an older app.
have a baseline app, and create a SQL-based repository
in an updated app, change the model and verify that you can see the updated model version. Using lightweight migration
re-run the older app (which will inherit the newer SQL repository).
YIKES - no error when creating the NSPersistenStoreCoordinator!
Nothing in the metadata to imply the store is newer than the model:
[_persistentStoreCoordinator metadataForPersistentStore:store]
My question: is there any way to detect this condition?
David