Posts

Post marked as solved
3 Replies
4.6k Views
There is LazyVStack to work with a large amount of content inside a ScrollView and ensure good scrolling performance. I like to work with List in my apps as it provides some more functionality than just a ScrollView with a stack of content inside. Does List in SwiftUI now also use lazy loading of content elements in iOS 14? If it does not support this by default is there any way to make it work with lazy loaded content? I tried this code but it caused rendering issues: List { LazyVStack { Text("1") // [...] hundreds of Text views for testing } }
Posted Last updated
.
Post marked as solved
46 Replies
15k Views
I get this error each time when I try to upload my iOS 11 only App to iTunes Connect:ERROR ITMS-90502: "Invalid Bundle. Apps that only contain the arm64 slice must also have 'arm64' in the list of UIRequiredDeviceCapabilities in Info.plist."I have added<key>UIRequiredDeviceCapabilities</key> <array> <string>arm64</string> </array>to every Info.plist of my targets already!I also have set valid architectures in my build configuration to arm64 only.I am using Xcode 9 beta 5.Any idea how to fix that? Why does it not work even though I added UIRequiredDeviceCapabilities?
Posted Last updated
.
Post not yet marked as solved
0 Replies
779 Views
I use a very basic WKInterfaceTable in my WatchKit based app. It displays multiple rows which contain two labels. The labels can have varying length content therefore the rows have to scale accordingly with the content. This works perfectly in the simulator. On device it works correctly most of the time, but somtimes the rows do not scale correctly with the content like demonstrated in these screenshots: https://imgur.com/a/Cjylq65This leads to clipping content of the labels. I see this happening in watchOS 4 and watchOS 5 on different Apple Watch models. I see this issue only in this special WKInterfaceTable, never seen it in any other views of my app.I configure the WKInterfaceTable like this:import WatchKit import Foundation import PollenflugShared_watchOS class DayDetailInterfaceController: WKInterfaceController { @IBOutlet var table: WKInterfaceTable! override func awake(withContext context: Any?) { super.awake(withContext: context) guard let day = context as? ForecastDay else { return } guard let data = PollenKit.shared.loadDataFromCache() else { return } guard let region = PollenKit.shared.userRegionFrom(pollenflug: data) else { return } setTitle(day.localizedString) // sort user allergenes by name let allergenes = User.allergenes.sorted() table.setRowTypes(["allergeneRow"]) table.setNumberOfRows(allergenes.count, withRowType: "allergeneRow") for index in 0.. if let rowController = table.rowController(at: index) as? PollenflugDetailRowController { let allergene = allergenes[index] var score = PollenKit.shared.scoreFor(region: region, allergene: allergene, day: day) if score == nil { score = Score.init(score: -1) } rowController.allergeneLabel.setText(allergene.localizedString) rowController.warningLevelLabel.setText(score?.localizedDescription) rowController.warningLevelLabel.setTextColor(score?.color) } } } }Has anyone ever seen this issue? I am really out of ideas what I am doing wrong.
Posted Last updated
.
Post marked as solved
1 Replies
674 Views
I implemented the new Apple Watch 4 complications today to support them as soon as possible. The app builds fine and runs perfectly as expected in the simulator.However I can not upload the build to App Store Connect because it gets rejected. The error message tells me that the keys for the new complication types in Info.plist are not accepted.I think Apple has not updated their backend to support the new keys yet. I hope they fix this soon.Anyone else experiencing this?
Posted Last updated
.
Post not yet marked as solved
0 Replies
471 Views
I have just read about the fact that siri shortcuts will not be available on older devices like iPhone 6: http://www.iphonehacks.com/2018/09/siri-shortcuts-not-available-for-iphone-6-5s.htmlIn my app I have implemented a button to create a siri shortcut and set a custom phrase. As far as I understand this button will not work on older devices running iOS 12.How can I check in code if the Siri Shortcuts funcationality is available on the device I am running on? Checking the device identifier does not feel like a very reliable solution because Apple might change the Siri Shortcuts availability in the future.
Posted Last updated
.
Post not yet marked as solved
0 Replies
548 Views
I created an App Store preview video for my app. I used the iMovie template for app previews and exported the video. It looks perfekt when I play the exported video locally. Then I uploaded it to iTunes connect and published my app. In the App Store the app preview video now looks very bad. Kinda like it uses a very low Bitrate and even the colours seem to be reduced. Why does this happen? When I play other videos for other apps on the App Store they look nice on my phone. Except the videos I uploaded for my apps. What am I doing wrong?
Posted Last updated
.
Post marked as solved
14 Replies
8.9k Views
I have a MapView with many MKMarkerAnnotationViews (about 300). iOS 11 clustering support enabled. After some scrolling and zooming through the MapView my app crashes because MapKit crashes.When I see the crashlog I am sure this is not a crash in my code but in MapKit itself. Do you think this estimation is correct? Does anyone see this crash too?This is the crashlog:Last Exception Backtrace: 0 CoreFoundation 0x186f4bd38 __exceptionPreprocess + 124 1 libobjc.A.dylib 0x186460528 objc_exception_throw + 55 2 CoreFoundation 0x186ee4c44 _CFThrowFormattedException + 111 3 CoreFoundation 0x186e19ff4 -[__NSDictionaryM setObject:forKey:] + 855 4 MapKit 0x197329930 -[MKNewAnnotationContainerView _existingClusterViewsForClusterID:] + 171 5 MapKit 0x1973291ec -[MKNewAnnotationContainerView addAnnotationView:allowAnimation:] + 171 6 MapKit 0x1972b9040 -[MKMapView addAnnotationRepresentation:allowAnimation:] + 687 7 MapKit 0x197277d14 -[MKAnnotationManager _addRepresentationForAnnotation:] + 843 8 MapKit 0x19729b63c -[MKAnnotationManager addRepresentationsForAnnotations:] + 351 9 MapKit 0x1972b1f7c -[MKMapView annotationContainer:requestAddingClusterForAnnotationViews:] + 631 10 MapKit 0x197329ad8 -[MKNewAnnotationContainerView _updateClusterableAnnotationViews:withID:] + 395 11 CoreFoundation 0x186e1a6cc -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 231 12 MapKit 0x19732a698 -[MKNewAnnotationContainerView updateAnnotationViewsForReason:] + 295 13 MapKit 0x197279cfc -[MKAnnotationContainerView finishAddingAnnotationViews] + 31 14 MapKit 0x1972b9658 -[MKMapView annotationManager:didAddAnnotationRepresentations:] + 59 15 MapKit 0x1972769b0 -[MKAnnotationManager updateVisibleAnnotations] + 1491 16 MapKit 0x197291620 -[MKMapView _didChangeRegionMidstream:] + 243 17 MapKit 0x1972addf0 -[MKMapView mapLayer:didChangeRegionAnimated:] + 71 18 VectorKit 0x196c60690 -[VKMapView map:didChangeRegionAnimated:] + 143 19 MapKit 0x197321430 -[MKMapGestureController _handleStandardPan:] + 1579 20 MapKit 0x197295cfc -[MKMapGestureController handlePan:] + 19 21 UIKit 0x1909e7f78 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 63 22 UIKit 0x1909ec4dc _UIGestureRecognizerSendTargetActions + 123 23 UIKit 0x1904d6dc8 _UIGestureRecognizerSendActions + 319 24 UIKit 0x19038b748 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 731 25 UIKit 0x1909d63fc _UIGestureEnvironmentUpdate + 1055 26 UIKit 0x1909d5f88 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 403 27 UIKit 0x1909d50e4 -[UIGestureEnvironment _updateGesturesForEvent:window:] + 275 28 UIKit 0x190389a54 -[UIWindow sendEvent:] + 3179 29 UIKit 0x19035b078 -[UIApplication sendEvent:] + 339 30 UIKit 0x190c9af98 __dispatchPreprocessedEventFromEventQueue + 2363 31 UIKit 0x190c9d408 __handleEventQueueInternal + 4759 32 UIKit 0x190c96574 __handleHIDEventFetcherDrain + 151 33 CoreFoundation 0x186ef4358 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 23 34 CoreFoundation 0x186ef42d8 __CFRunLoopDoSource0 + 87 35 CoreFoundation 0x186ef3b60 __CFRunLoopDoSources0 + 203 36 CoreFoundation 0x186ef1738 __CFRunLoopRun + 1047 37 CoreFoundation 0x186e122d8 CFRunLoopRunSpecific + 435 38 GraphicsServices 0x188ca3f84 GSEventRunModal + 99 39 UIKit 0x1903be880 UIApplicationMain + 207 40 Bookshelf 0x10086ce14 0x100850000 + 118292 41 libdyld.dylib 0x18693656c start + 3This happens on a iPhone 5s with iOS 11. I can reproduce this for all iOS 11 releases including the current ios 11.1 beta 2.
Posted Last updated
.
Post marked as solved
3 Replies
3.0k Views
I start a download in an action extension (`ActionRequestHandler`) like this: private lazy var urlSession: URLSession = { let config = URLSessionConfiguration.background(withIdentifier: "de.stefantrauth.Downloader") config.sharedContainerIdentifier = "group.de.stefantrauth.Downloader" return URLSession(configuration: config, delegate: self, delegateQueue: OperationQueue.main) }() private func initiateDownloadOfFileFrom(url: URL) { urlSession.downloadTask(with: url).resume() completeRequest() // this tells the system the action extension is done with its work }Then the download is processed by iOS in the background.I now want to handle the finished download in my main application `AppDelegate`, because that is what iOS calls when the download has finished. func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) { print("handleEventsForBackgroundURLSession") urlSessionBackgroundCompletionHandler = completionHandler }This method gets called in background after some time as expected.My `AppDelegate` also implements `URLSessionDelegate` and `URLSessionDownloadDelegate` to process updates for the download.Especially interesting are func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { DispatchQueue.main.async { print("urlSessionDidFinishEvents") self.urlSessionBackgroundCompletionHandler?() self.urlSessionBackgroundCompletionHandler = nil } }and func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) { print("download finished to \(location.absoluteString)") do { let documentsURL = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false) let savedURL = documentsURL.appendingPathComponent(location.lastPathComponent) try FileManager.default.moveItem(at: location, to: savedURL) print("moved file to: \(savedURL.absoluteString)") } catch { print ("file error: \(error)") } }Both `urlSessionDidFinishEvents` and `didFinishDownloadingTo` are not being called after `handleEventsForBackgroundURLSession` got called in background. Only after relaunching the app into foreground the delegate methods get called.Why are they not getting called and what can I do to fix that?I tried creating the `URLSession` in `handleEventsForBackgroundURLSession`like this: private func initUrlSessionWith(identifier: String) { let config = URLSessionConfiguration.background(withIdentifier: identifier) config.sharedContainerIdentifier = "group.de.stefantrauth.Downloader" urlSession = URLSession(configuration: config, delegate: self, delegateQueue: OperationQueue.main) } func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) { print("handleEventsForBackgroundURLSession") initUrlSessionWith(identifier: identifier) urlSessionBackgroundCompletionHandler = completionHandler }However this did not fix the problem.Before you ask: Yes I am testing this on a real device because the simulator has problems with background task handling.
Posted Last updated
.