Post

Replies

Boosts

Views

Activity

Subscribe to an existing JMS provider
I need to connect to a JMS that publishes data that I need to collect. I am trying one solution: RabbitMQ with the JMS plugin. I succeeded to install RabbitMQ and send messages from one process to another. However, I need to consume a JMS that an external party publishes. Can anybody tell me how I should configure the Host, Port, Username, Password and Queue name for RabbitMQ/JMS so that I can consume (or subscribe to) that JMS? Or does anybody know another way to consume (or subscribe to) a JMS from Swift? I have no idea which of the provided Tags I should select. Thanks! Wouter
5
0
182
Oct ’24
Use Vision framework to detect a graph in Swift
I would like to offer the functionality that the user aims the camera at a graph (including axes and scales) and the app detects the graph and the app replicates the graph using the image. I have the whole camera setup finished with a AVCaptureSession, VNDetectContoursRequest, VNImageRequestHandler, etc. However, now I get many many results so I guess I will now need to tell the image processing process what I am looking for. i.e. filter the VNContoursObservations. I 'think' I first need to detect two perpendicular lines (the two axes). How do I do that? If I do not see them, I can just ignore that input and wait for the next VNContoursObservation. When I found the axes of the graph, I will need to find the curve (graph) that I need to scan. Any tips on how I can find that curve and turn that curve into a bunch of coordinates? Thanks! Wouter
1
0
304
Oct ’24
Disable the keyboard suggestions for a UITextField
I have a UITableView with a bunch of UITextFields in 'em. (in a custom UITableViewCell subclass) For every UITextField I have set: cell.textField.textContentType = .none I even tried: cell.textField.inlinePredictionType = .no // iOS >= 17 and: cell.textField.keyboardType = .default cell.textField.autocorrectionType = .no cell.textField.spellCheckingType = .no cell.textField.autocapitalizationType = .none Still, when I tap in one of them, I get a 'suggestion' in a bar just above the Keyboard that I can fill in my phone number. How can I prevent that? I am using: xcode 15.4, iOS 17.5.1. Compiling for iOS 13.0 and later.
3
0
1.3k
May ’24
In MKMapView, show (some) annotations only when zoomed in
I have a UIKit app with an MKMapview. In that mapview, I show icons on the location of Airfields. When zooming out to Europe (or USA for that matter), the whole map is covered with the annotations, so I want to only show these annotations when zoomed in beyond some level. How can that be achieved? I did find a way like this: class MapViewController: UIViewController { var isAtBigZoom = true { didSet { guard oldValue != isAtBigZoom else { return } for case let annot in mapView.annotations { mapView.view(for: annot)?.alpha = isAtBigZoom ? 1 : 0 } } } } extension MapViewController: MKMapViewDelegate { func mapView(_ mapView: MKMapView, regionWillChangeAnimated animated: Bool) { isAtBigZoom = mapView.region.span.latitudeDelta < self.airportThreshold } } But I have 2 problems with that: Seems like a lot of processing power It only takes effect after a pan. So I zoom beyond the limit, alpha has the 'old' value. Only after I pan, the alpha is suddenly represented in the MapView. Does anybody know a better solution?
3
0
464
Aug ’24
Couldn't read values in CFPrefsPlistSource when presenting UIActivityViewController
When I try to display a UIActivityViewController, I get funky logging in the xcode console. This is my code: @IBAction func shareAction(_ sender: Any) { // text to share let text = "Some very interesting text!" let url = Constants.URL.appStore.absoluteString guard let logo = UIImage(named: "App Logo")? .circle() .resize(333, 333) else { return } // set up activity view controller let itemsToShare: [Any] = [ logo, text, url ] let activityViewController = UIActivityViewController(activityItems: itemsToShare, applicationActivities: nil) activityViewController.popoverPresentationController?.sourceView = self.view // exclude some activity types from the list if #available(iOS 15.4, *) { activityViewController.excludedActivityTypes = [ .airDrop, .sharePlay ] } else { activityViewController.excludedActivityTypes = [ .airDrop ] } // present the Share Sheet self.present(activityViewController, animated: true, completion: nil) } The logging emerges in the console as soon as the code calls: self.present(activityViewController, animated: true, completion: nil) When I set a break point on that line, no logging occurs. If I add a completion block to that call with a break point on the first line, the logging occurs before it hits that break point. so all logging seems to be generated while displaying the UIActivityViewController. This is my logging Cannot issue sandbox extension for URL:https://apps.apple.com/app/id Couldn't read values in CFPrefsPlistSource<0x303b38900> (Domain: com.apple.country.carrier_1, User: kCFPreferencesCurrentUser, ByHost: No, Container: /var/mobile/Library/CountryBundles/, Contents Need Refresh: No): accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.primitiveattribute AND originator doesn't have entitlement com.apple.runningboard.assertions.frontboard AND target is not running or doesn't have entitlement com.apple.runningboard.trustedtarget AND Target not hosted by originator)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.primitiveattribute AND originator doesn't have entitlement com.apple.runningboard.assertions.frontboard AND target is not running or doesn't have entitlement com.apple.runningboard.trustedtarget AND Target not hosted by originator)}> (501) personaAttributesForPersonaType for type:0 failed with error Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.mobile.usermanagerd.xpc was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.mobile.usermanagerd.xpc was invalidated: failed at lookup with error 159 - Sandbox restriction.} Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false} elapsedCPUTimeForFrontBoard couldn't generate a task port Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false} elapsedCPUTimeForFrontBoard couldn't generate a task port Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false} elapsedCPUTimeForFrontBoard couldn't generate a task port <0x10640ca30> Gesture: System gesture gate timed out. Line 2, 5, 7, 9 are red the other lines are yellah I have been looking on the internet and found nothing. I have been looking in this forum, and found one possible match (without a solution): https://forums.developer.apple.com/forums/thread/746721 When looking through the logging: 'entitlement com.apple.runningboard.primitiveattribute' Should I add something to my entitlements to be allowed to show a UIActivityViewController? Is that the solution? If so: How do I add that entitlement? (or any of the other entitlements mentioned there) And since when is that required?? The app (and this feature) seem to work like a charm ... so I could ignore. Only I find it difficult to ignore RED logging by xcode. If it is red, it is bound to be kinda serious, right? Or is there a whole other reason / cause why I suddenly get this? Now running: xcode Version 15.3 (15E204a) iOS 17.4.1
1
0
919
Mar ’24
Mapkit SwiftUI add Polygon with 'thickness'
I have viewed the WWDC video about MapKit in SwiftUI AWESOME! I want to work with that! I noticed that you can view the map at an angle, so that you can for instance look under a bridge. I saw in the video that it is possible to add a MapPolygon. But when the MapView apparently has a 3rd dimension ... is it possible to add a MapPolygon with a certain thickness? Or perhaps let a MapPolygon only occupy space from say 10 to 20 meters high? Thanks!! Wouter
0
0
654
Sep ’23
Can I store files on the 'Lightning to USB Camera Adapter' from my Swift app when I put a USB Thumb drive in it?
Hi, I am writing an app for iPhone and iPad that requires to write text files to a USB thumb Drive and an SD Card. I notice Apple sells a Lightning to USB Camera adapter. If I stick a USB Thumb drive in that Lightning to USB Camera adapter, will I ba able to write a file on that file system? It would be fine if I have to do that via the 'Share sheet', but it would be even better if I can select the file system myself and write to that. When I view the product online, I see the following on the product page: "After you connect the Lightning to USB Camera Adapter, your iPad or iPhone automatically opens the Photos app, which lets you choose which photos and videos to import, then organizes them into albums." So ... will I (as a developer) be able to access the USB file system, or is it reserved for the Photos app?? Will I have to use the 'External Accessory framework' or is that only for writing software that connects to proprietary hardware connected to the port? Same question for the Apple USB-C to USB adapter (for iPads) Same question for the Apple Lightning to SD Card Camera adapter Same question for the Apple USB-C to SD Card reader Thanks very much!! Kind regards, Wouter Wessels
1
0
906
Jan ’23
Debug situation 'at wakeup' of an iPad
Hi, We seem to have an issue in our app that only seems to occur at wakeup of the iPad. So: Wakeup iPad Launch my App Push 'on/off button' of iPad to put it to sleep Wait 'a bit' (like 15 minutes) for iPadOS to truly sleep Wake up the iPad (press on/off button again and enter pin code) (app is still/again in front) Now the behaviour of the app is incorrect How do I debug this with xcode? The connection between xcode and the app is also terminated when the iPad sleeps. Thanks for your advice! Kind regards, Wouter Wessels
1
0
726
Nov ’22
Suddenly my app uses non-public api
Hi, For the first time today, I got a warning about non-public api. This is the warning: The app references non-public selectors in Payload/AppName.app/AppName: removeParts: However: Since the previous version, I changed only the way I call reloadData on my UITableviews, to fix a crash in my app When searching for the string 'removeParts' I get zero hits in my app and the framework that I use. How can I find the offending private api reference in my code? Is there a log or something that might tell me which call to change? Kind regards, Wouter Wessels
4
0
957
Sep ’22
Cloud Managed Apple Apple Distribution certificate expires in one week
Hi, I see some posts about this, from 6 years ago, but I would like to know how this message would impact my App. So when uploading an Archive to Apple for distributing to the App Store, I see that the 'Cloud Managed Apple Distribution' certificate is set to expire in 10 days. Also (probably connected) the iOS Team Provisioning Profile will also expire at the same date. Should I do something myself? Or will the renewing be done automagically by xcode? If I upload now (without renewing), will my app still be available in the App Store after the certificate has expired? If I upload now (without renewing) will the apps still work on all devices that have downloaded this version or previous versions of the app? Kind regards, Wouter Wessels
2
1
2.9k
Sep ’22
Buffered Remote logging in Swift
I would like to implement remote logging in my Swift app for iOS. Log lines will need to be sent to a server so that I can analyse problems when the app is actually being used 'in the field'. This is the easy part. For user privacy, this might be limited to TestFlight versions of the app. The app is sometimes used in an area of poor or non-existent connectivity. So sendng the logs to our servers may fail. Therefore, I would like to see that the logs are buffered when connecting to our log server failed. The easiest way to buffer is in Memory (Array of 'LogEntry'), but when a bug we are trying to track involves a crash ... all memory is lost, so I would like the logs to be buffered on disk. Is there a way to do that? Perhaps using OSLog, or perhaps some other way? I understand that on iOS, the app does not (yet) have access to its logs. That would solve my problem, cos then I can read back the logs that I made and send them to the server when needed. I have thought about creating my own Log file, and (when there is a server connection) I read lines from the start of the file, and send that to the server. However, I have found no way to 'read and delete the first line of a file' without reading the whole file, and writing 'everything except the first line'. Seems like CoreData would not be such a bad idea, albeit a bit heavy for such a small task. Any suggestions? Any existing components that I can include in my project? (using cocoapods, SPM?) Thanks! Wouter
1
0
1.9k
Aug ’22
Can I implement my own free trial in Auto Renewable Subscriptions?
I would like to implement a free trial for my Auto renewable subscription.However, As a user, I hate to have to commit to anything before I see what it is ... even when the first period is free. I know myself, I tend to forget to cancel the subscription ...So, I thought that I might be able to store the 'first launch date' in the KeyChain and only start checking the subscriptions after the initial free period that I define (and show the user).I know that I might lose a bit of money (for instance if a user downloads the app on a second device and uses a second free trial period), but I think some users will appreciate the fact that they do not have to commit to a subscription before they see what the app can do for them.Is it allowed to do it this way?When I look in the documentation about free trials, I see text like:"You can set up introductory offers for your apps that contain auto-renewable subscriptions in App Store Connect."But I cannot find: "You can only implement introductory offers in App Store Connect"Any thoughts?Kind regards,Wouter Wessels
15
0
11k
Feb ’20