Engage with the WWDC20 community and connect with Apple engineers during the conference.

Posts under WWDC20 tag

36 Posts

Post

Replies

Boosts

Views

Activity

Migrating existing SwiftUI apps to the new multi platform template
I have an iOS 13 app that I’m hoping to release soon that is written entirely in SwiftUI. If I was starting from scratch today, I’d obviously use the new multi platform template which looks awesome.... But since I’m not starting from scratch, what are the recommendations/best practices for existing apps? Is there a path for migrating existing apps to take advantage of the new app structure (below) when moving to iOS 14? @main struct HelloWorld: App { var body: some Scene { WindowGroup { Text(“Hello, world!”).padding() } } }
2
0
2.3k
Jul ’24
launchApplicationAtURL - Launched Application "Verifying" since Catalina
We have a test tool our engineers use to launch various versions of our application during development and verification. Each daily build of our application is stored on a server. As well, each push of a change generates a new build of our application that is stored on a server. These are added to a database and the developer application accesses the server via REST to find the desired version to run, retrieves a server path and launches the application. This tool is valuable in finding pushes that introduced regressions. The developer application (Runner) is using the launchApplicationAtURL:options:configuration:error: (deprecated I know) to launch the app. Prior to Catalina, this was working great. However, as of Catalina, this process is taking a VERY long time due to the app needing to be "verified". the app seems to need to be copied to the users machine and verified. It only occurs the first launch, but as most of the time the users are running new push or daily builds, it has made the app useless. With the new remote work environment it is even worse as VPN copy can take forever. I have switched to using NSTask with a shell script to open the executable in the bundle. If I add the developer tool (Runner) to the Developer Tools in Privacy this seems to launch the application without the need for verification. However this just seems wrong. It also provides little feedback to know when the application is up and running, which makes my user experience poor. As well many of the systems we use this tool on for verification do not have Developer Tools installed. They are VMs. Is there a way for me to use the launchApplicationAtURL:options:configuration:error: (or the new openApplicationAtURL:configuration:completionHandler:) to launch these versions of the application without the need for the lengthy verification process? Adding our application to the Developer Tools did not seem to help.
2
0
1.5k
Jun ’24
How to correctly load video selected with PHPickerViewController?
Hello! I am playing around with the PHPickerViewController and so far I was able to get the selected images by loading them into UIImage instances but I don't know how to get the selected video. Below is the relevant implementation of the method: func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]): let provider = result.itemProvider guard provider.hasItemConformingToTypeIdentifier(AVFileType.mov.rawValue) else { return } 						provider.loadItem(forTypeIdentifier: AVFileType.mov.rawValue, options: nil) { (fileURL, error) in 								if let error = error { 										print(error) 										return 								} 								guard let videoURL = fileURL as? URL else { return } 								DispatchQueue.main.async { 										let fm = FileManager.default 										let destination = fm.temporaryDirectory.appendingPathComponent("video123.mov") 										try! fm.copyItem(at: videoURL, to: destination) 										let playerVC = AVPlayerViewController() 										playerVC.player = AVPlayer(url: destination) 										self.present(playerVC, animated: true, completion: nil) 								} 						} I get crash trying to copy the item. It says the source file does not exists but the path looks real to me. "The file “3C2BCCBC-4474-491B-90C2-93DF848AADF5.mov” couldn’t be opened because there is no such file." I tried it without copying first and just passing the URL to AVPlayer but nothing would play. I am testing this on a simulator. Thanks for help!
13
0
10k
Sep ’23
Sports Analysis Code
I'm trying to get the WWDC2020 Sports Analysis code running. It's the project named BuildingAFeatureRichAppForSportsAnalysis. It seems that now the boardDetectionRequest fails when trying to run the code in the simulator. The main error that I get is Error Domain=com.apple.vis Code=3 "The VNCoreMLTransform request failed" UserInfo={NSLocalizedDescription=The VNCoreMLTransform request failed, NSUnderlyingError=0x6000024991d0 {Error Domain=com.apple.CoreML Code=0 "Failed to evaluate model 0 in pipeline" UserInfo={NSLocalizedDescription=Failed to evaluate model 0 in pipeline}}}. The problem is that I can't tell why the VNImageRequestHandler is failing when trying to detect the board. It doesn't say that it got a bad image. It doesn't say that it didn't detect a board. I'm running the code against the sample movie provided. I believe this used to work. The other error that I see is upon initialization in Common.warmUpVisionPipeline when trying to load I get 2023-09-07 12:58:59.239614-0500 ActionAndVision[3499:34083] [coreml] Failed to get the home directory when checking model path. From what I can tell in the debugger though the board detection model did load. Thanks.
0
0
816
Sep ’23
Voiceover and Accessibility APIs
Hi, I'm trying to locate documentation that outlines the relationship between the various assistive technologies like Voice Control, Voiceover, Switch,Access, etc. For testing purposes I'm trying to determine if testing with all three is redundant since there's a WWDC video that says that testing with voiceover should be enough coverage for any app not doing anything unique or custom that requires switch access support: https://developer.apple.com/videos/play/wwdc2020/10019/?time=271
0
0
972
Feb ’23
Custom app options to add customer IDs
We want to provide a version of our subscription app to on Apple business, which doesn’t support subscriptions. If we offer a non-subscription version of our app as a custom app it seems that it must be made available to at least one business customer ID before submitting to review. Is that correct? Can additional business customer IDs be subsequently added to the AppStoreConnect list so that more Apple business users can access and buy the same app? Or does each customer need a new app submitting?
0
0
681
Sep ’22
PHPickerViewController has leak?
Code from wwdc20-10652 is used. Open PHPickerViewController Choose 1 photo Do nothing and dismiss Leak is shown as below. @IBAction private func chooseImagePressed(_ sender: Any) {     if #available(iOS 14, *) {       var configuration = PHPickerConfiguration()       configuration.filter = .images       let picker = PHPickerViewController(configuration: configuration)       picker.delegate = self       present(picker, animated: true)     } else {       // Fallback on earlier versions     } } extension PhotosVC: PHPickerViewControllerDelegate {   @available(iOS 14, *)   func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {     dismiss(animated: true)   } }
1
0
1.4k
Jun ’22
Is List in SwiftUI also lazy loading content in iOS 14 like LazyVStack?
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 } }
3
0
13k
May ’22
SearchController displaying two keyboards
After restarting the Apple TV, Siri remote is not yet connected, I have opened UISearchController using IR Remote, Now UISearchController is displaying both regular horizontal keyboard an also Grid Keyboard, and these two keyboards are getting overlapped. Please note that, once Siri is connected to the AppleTV, this issue is resolved. #WWDC20-10634
1
0
837
Mar ’22
UISplitViewController - showDetailViewController(_ vc: UIViewController, sender: Any?) stacking view controllers.
Using UISplitViewController for displaying contact list and contact details screen. Primary, I have UITableViewController. On didSelectRow: set segue/programatically handle delegate to call showDetailViewControler. it always pushes viewController. Question is instead of replacing secondary why need to push. Most of solution I found that hide back button and keep on push and increasing navigation stack. Print this self.viewController(for: .secondary)?.navigationController?.viewControllers.count on segue/didSelectRow delegate. count keeps on increasing.
0
0
984
Feb ’22
How to call an API while app is in background when app timeout period is exceeded
In my app timeout time on no user activity is set to 10 minutes.. after 10 minutes of idle time is over , user is logged out of app ... We have recently added a chat page in our app.. Now when app goes into background & app timeout period has exceeded since app went to idle mode even if app is in background we need to call an API to server to end active chat session from server end. So requirements in short are 1)Keep track of idle app time in foreground & even app moves into background.(should we use background processing modes to keep track of time in background mode as well?) 2)Whenever idle app timeout period is exceed(10 minutes) while app is in background hit an api call to end active chat session.(Its working fine in foreground)
1
0
1k
Feb ’22
How to obtain UIImage from PHLivePhoto?
Inside func picker(_ picker: didFinishPicking results:) I am trying to obtain a UIImage from a Live Photo. I have parsed the results and filtered by regular still photos and live photos. For the still photos, I already have the UIImage but for the live photos I do not understand how to get from a PHLivePhoto to the PHAsset. if let livePhoto = object as? PHLivePhoto {   DispatchQueue.main.async { // what code do I insert here to get from PHLivePhoto to a UIImage? I need to extract a UIImage from a PHLivePhoto } } Thanks for the help in advance!
1
0
1.9k
Jan ’22
Joining threads to CoreAudio HAL AudioWorkgroup
We're trying to join our audio worker threads to a CoreAudio HAL audio workgroup, but haven't managed to this working yet. Here's what we do: Fetch audio workgroup handle from the CoreAudio device: UInt32 Count = sizeof(os_workgroup_t); os_workgroup_t pWorkgroup = NULL; ::AudioDeviceGetProperty(SomeCoreAudioDeviceHandle, kAudioUnitScope_Global, 0, kAudioDevicePropertyIOThreadOSWorkgroup, &Count, &pWorkgroup); This succeeds on a M1 Mini for the "Apple Inc.: Mac mini Speakers" on OSX 11.1. The returned handle looks fine as well: [(NSObject*)pWorkgroup debugDescription] returns "{xref = 2, ref = 1, name = AudioHALC Workgroup}" Join some freshly created worker threads to the workgroup via: os_workgroup_join_token_s JoinToken; int Result = ::os_workgroup_join(pWorkgroup, &JoinToken); The problem: Result from os_workgroup_join always is EINVAL, Invalid argument - whatever we do. Both arguments, the workgroup handle and the join token are definitely valid. And the device hasn't been stopped or reinitialized here, so the workgroup should not be cancelled? Has anyone else managed to get this working? All examples out there seem to successfully use the AUHAL workgroup instead of the audio device HAL API.
1
0
1k
Jan ’22
UIConfigurationStateCustomKey with UIContentView.
I'm trying to implement additional UICollectionViewCell's state using UIConfigurationStateCustomKey. I've already read this post regarding practices for managing custom properties with cells configurations Seems like I can implement custom state for a UICollectionView's cell. Here is my implementation of additional state protocol CustomTypesAccessable: AnyObject {   var isMoving: Bool { get set } } extension UIConfigurationStateCustomKey {   static let isMoving = UIConfigurationStateCustomKey("com.myApp.cell.isMoving") } extension UICellConfigurationState {   var isMoving: Bool {     get { self[.isMoving] as? Bool ?? false }     set { self[.isMoving] = newValue }   } } extension BaseBlockView: CustomTypesAccessable {   var isMoving: Bool {     get {       currentConfiguration.currentConfigurationState?.isMoving ?? false     }     set {       currentConfiguration.currentConfigurationState?.isMoving = newValue     }   } } My BaseBlockView class: class BaseBlockView<Configuration: BlockConfigurationProtocol>: UIView, UIContentView {   var configuration: UIContentConfiguration {     get { currentConfiguration }     set {       guard let newConfiguration = newValue as? Configuration,          currentConfiguration != newConfiguration else { return }       currentConfiguration = newConfiguration     }   }   var currentConfiguration: Configuration {     didSet {       guard didSetupSubviews else { return }       update(with: currentConfiguration)     }   } I want to update this state from my view controller in the same way CollectionView can make cell selected - (void)selectItemAtIndexPath:(nullable NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UICollectionViewScrollPosition)scrollPosition; So I'm trying to change isMoving value this way:   let cell = cellForItem(at: indexPath)     let contentView = cell?.contentView as? CustomTypesAccessable     contentView?.isMoving = isMoving Everything works fine in that case, but after reusing cell UICellConfigurationState's isMoving property changes back to false. Is it a UIKit bug?
2
0
1.2k
Dec ’21
Migrating existing SwiftUI apps to the new multi platform template
I have an iOS 13 app that I’m hoping to release soon that is written entirely in SwiftUI. If I was starting from scratch today, I’d obviously use the new multi platform template which looks awesome.... But since I’m not starting from scratch, what are the recommendations/best practices for existing apps? Is there a path for migrating existing apps to take advantage of the new app structure (below) when moving to iOS 14? @main struct HelloWorld: App { var body: some Scene { WindowGroup { Text(“Hello, world!”).padding() } } }
Replies
2
Boosts
0
Views
2.3k
Activity
Jul ’24
launchApplicationAtURL - Launched Application "Verifying" since Catalina
We have a test tool our engineers use to launch various versions of our application during development and verification. Each daily build of our application is stored on a server. As well, each push of a change generates a new build of our application that is stored on a server. These are added to a database and the developer application accesses the server via REST to find the desired version to run, retrieves a server path and launches the application. This tool is valuable in finding pushes that introduced regressions. The developer application (Runner) is using the launchApplicationAtURL:options:configuration:error: (deprecated I know) to launch the app. Prior to Catalina, this was working great. However, as of Catalina, this process is taking a VERY long time due to the app needing to be "verified". the app seems to need to be copied to the users machine and verified. It only occurs the first launch, but as most of the time the users are running new push or daily builds, it has made the app useless. With the new remote work environment it is even worse as VPN copy can take forever. I have switched to using NSTask with a shell script to open the executable in the bundle. If I add the developer tool (Runner) to the Developer Tools in Privacy this seems to launch the application without the need for verification. However this just seems wrong. It also provides little feedback to know when the application is up and running, which makes my user experience poor. As well many of the systems we use this tool on for verification do not have Developer Tools installed. They are VMs. Is there a way for me to use the launchApplicationAtURL:options:configuration:error: (or the new openApplicationAtURL:configuration:completionHandler:) to launch these versions of the application without the need for the lengthy verification process? Adding our application to the Developer Tools did not seem to help.
Replies
2
Boosts
0
Views
1.5k
Activity
Jun ’24
How to correctly load video selected with PHPickerViewController?
Hello! I am playing around with the PHPickerViewController and so far I was able to get the selected images by loading them into UIImage instances but I don't know how to get the selected video. Below is the relevant implementation of the method: func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]): let provider = result.itemProvider guard provider.hasItemConformingToTypeIdentifier(AVFileType.mov.rawValue) else { return } &#9;&#9;&#9;&#9;&#9;&#9;provider.loadItem(forTypeIdentifier: AVFileType.mov.rawValue, options: nil) { (fileURL, error) in &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if let error = error { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;print(error) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;return &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;guard let videoURL = fileURL as? URL else { return } &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DispatchQueue.main.async { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;let fm = FileManager.default &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;let destination = fm.temporaryDirectory.appendingPathComponent("video123.mov") &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;try! fm.copyItem(at: videoURL, to: destination) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;let playerVC = AVPlayerViewController() &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;playerVC.player = AVPlayer(url: destination) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;self.present(playerVC, animated: true, completion: nil) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;} I get crash trying to copy the item. It says the source file does not exists but the path looks real to me. "The file “3C2BCCBC-4474-491B-90C2-93DF848AADF5.mov” couldn’t be opened because there is no such file." I tried it without copying first and just passing the URL to AVPlayer but nothing would play. I am testing this on a simulator. Thanks for help!
Replies
13
Boosts
0
Views
10k
Activity
Sep ’23
Sports Analysis Code
I'm trying to get the WWDC2020 Sports Analysis code running. It's the project named BuildingAFeatureRichAppForSportsAnalysis. It seems that now the boardDetectionRequest fails when trying to run the code in the simulator. The main error that I get is Error Domain=com.apple.vis Code=3 "The VNCoreMLTransform request failed" UserInfo={NSLocalizedDescription=The VNCoreMLTransform request failed, NSUnderlyingError=0x6000024991d0 {Error Domain=com.apple.CoreML Code=0 "Failed to evaluate model 0 in pipeline" UserInfo={NSLocalizedDescription=Failed to evaluate model 0 in pipeline}}}. The problem is that I can't tell why the VNImageRequestHandler is failing when trying to detect the board. It doesn't say that it got a bad image. It doesn't say that it didn't detect a board. I'm running the code against the sample movie provided. I believe this used to work. The other error that I see is upon initialization in Common.warmUpVisionPipeline when trying to load I get 2023-09-07 12:58:59.239614-0500 ActionAndVision[3499:34083] [coreml] Failed to get the home directory when checking model path. From what I can tell in the debugger though the board detection model did load. Thanks.
Replies
0
Boosts
0
Views
816
Activity
Sep ’23
Presenting PHPicker with SwiftUI
Does someone have an example of displaying a PHPicker from a SwifUI App?
Replies
4
Boosts
0
Views
8.2k
Activity
Feb ’23
Voiceover and Accessibility APIs
Hi, I'm trying to locate documentation that outlines the relationship between the various assistive technologies like Voice Control, Voiceover, Switch,Access, etc. For testing purposes I'm trying to determine if testing with all three is redundant since there's a WWDC video that says that testing with voiceover should be enough coverage for any app not doing anything unique or custom that requires switch access support: https://developer.apple.com/videos/play/wwdc2020/10019/?time=271
Replies
0
Boosts
0
Views
972
Activity
Feb ’23
How to group and control field order when using Switch Control in SwiftUI?
As mentioned in #wwdc-10019, you can use assessibilityNavigationStyle and assessibilityElements in UIKit to group fields and control the field tapping order when the user is using Switch Control. How can this be done in SwiftUI?
Replies
2
Boosts
0
Views
913
Activity
Nov ’22
Custom app options to add customer IDs
We want to provide a version of our subscription app to on Apple business, which doesn’t support subscriptions. If we offer a non-subscription version of our app as a custom app it seems that it must be made available to at least one business customer ID before submitting to review. Is that correct? Can additional business customer IDs be subsequently added to the AppStoreConnect list so that more Apple business users can access and buy the same app? Or does each customer need a new app submitting?
Replies
0
Boosts
0
Views
681
Activity
Sep ’22
PHPickerViewController has leak?
Code from wwdc20-10652 is used. Open PHPickerViewController Choose 1 photo Do nothing and dismiss Leak is shown as below. @IBAction private func chooseImagePressed(_ sender: Any) {     if #available(iOS 14, *) {       var configuration = PHPickerConfiguration()       configuration.filter = .images       let picker = PHPickerViewController(configuration: configuration)       picker.delegate = self       present(picker, animated: true)     } else {       // Fallback on earlier versions     } } extension PhotosVC: PHPickerViewControllerDelegate {   @available(iOS 14, *)   func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {     dismiss(animated: true)   } }
Replies
1
Boosts
0
Views
1.4k
Activity
Jun ’22
which chip is recommended by Apple for 3rd party "Airtags+"
Which UWB chip is recommended by Apple to be used, if one wants to build an interactive Airtags device? Is there a support for 3rd party tag vendors at all?
Replies
1
Boosts
0
Views
1.7k
Activity
May ’22
Is List in SwiftUI also lazy loading content in iOS 14 like LazyVStack?
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 } }
Replies
3
Boosts
0
Views
13k
Activity
May ’22
How to implement PKIssuerProvisioningExtensionHandler in my code
Hi, i don't understand how to implemente PKIssuerProvisioningExtensionHandler in my code. I want to provisioning a card in Wallet and confirm in my app.
Replies
0
Boosts
0
Views
748
Activity
Apr ’22
SearchController displaying two keyboards
After restarting the Apple TV, Siri remote is not yet connected, I have opened UISearchController using IR Remote, Now UISearchController is displaying both regular horizontal keyboard an also Grid Keyboard, and these two keyboards are getting overlapped. Please note that, once Siri is connected to the AppleTV, this issue is resolved. #WWDC20-10634
Replies
1
Boosts
0
Views
837
Activity
Mar ’22
UISplitViewController - showDetailViewController(_ vc: UIViewController, sender: Any?) stacking view controllers.
Using UISplitViewController for displaying contact list and contact details screen. Primary, I have UITableViewController. On didSelectRow: set segue/programatically handle delegate to call showDetailViewControler. it always pushes viewController. Question is instead of replacing secondary why need to push. Most of solution I found that hide back button and keep on push and increasing navigation stack. Print this self.viewController(for: .secondary)?.navigationController?.viewControllers.count on segue/didSelectRow delegate. count keeps on increasing.
Replies
0
Boosts
0
Views
984
Activity
Feb ’22
How to call an API while app is in background when app timeout period is exceeded
In my app timeout time on no user activity is set to 10 minutes.. after 10 minutes of idle time is over , user is logged out of app ... We have recently added a chat page in our app.. Now when app goes into background & app timeout period has exceeded since app went to idle mode even if app is in background we need to call an API to server to end active chat session from server end. So requirements in short are 1)Keep track of idle app time in foreground & even app moves into background.(should we use background processing modes to keep track of time in background mode as well?) 2)Whenever idle app timeout period is exceed(10 minutes) while app is in background hit an api call to end active chat session.(Its working fine in foreground)
Replies
1
Boosts
0
Views
1k
Activity
Feb ’22
How to obtain UIImage from PHLivePhoto?
Inside func picker(_ picker: didFinishPicking results:) I am trying to obtain a UIImage from a Live Photo. I have parsed the results and filtered by regular still photos and live photos. For the still photos, I already have the UIImage but for the live photos I do not understand how to get from a PHLivePhoto to the PHAsset. if let livePhoto = object as? PHLivePhoto {   DispatchQueue.main.async { // what code do I insert here to get from PHLivePhoto to a UIImage? I need to extract a UIImage from a PHLivePhoto } } Thanks for the help in advance!
Replies
1
Boosts
0
Views
1.9k
Activity
Jan ’22
Joining threads to CoreAudio HAL AudioWorkgroup
We're trying to join our audio worker threads to a CoreAudio HAL audio workgroup, but haven't managed to this working yet. Here's what we do: Fetch audio workgroup handle from the CoreAudio device: UInt32 Count = sizeof(os_workgroup_t); os_workgroup_t pWorkgroup = NULL; ::AudioDeviceGetProperty(SomeCoreAudioDeviceHandle, kAudioUnitScope_Global, 0, kAudioDevicePropertyIOThreadOSWorkgroup, &Count, &pWorkgroup); This succeeds on a M1 Mini for the "Apple Inc.: Mac mini Speakers" on OSX 11.1. The returned handle looks fine as well: [(NSObject*)pWorkgroup debugDescription] returns "{xref = 2, ref = 1, name = AudioHALC Workgroup}" Join some freshly created worker threads to the workgroup via: os_workgroup_join_token_s JoinToken; int Result = ::os_workgroup_join(pWorkgroup, &JoinToken); The problem: Result from os_workgroup_join always is EINVAL, Invalid argument - whatever we do. Both arguments, the workgroup handle and the join token are definitely valid. And the device hasn't been stopped or reinitialized here, so the workgroup should not be cancelled? Has anyone else managed to get this working? All examples out there seem to successfully use the AUHAL workgroup instead of the audio device HAL API.
Replies
1
Boosts
0
Views
1k
Activity
Jan ’22
local network alert with cellular data?
I have a local network alert with cellular data. why? How can I locate the cause?
Replies
4
Boosts
0
Views
1.3k
Activity
Jan ’22
Reliability of Local Push Notifications connectivity for restricted networks
I know that APNS is a "best effort" service but could somebody tell me if the Local Push Notifications connectivity for restricted networks is more reliable?
Replies
0
Boosts
0
Views
512
Activity
Jan ’22
UIConfigurationStateCustomKey with UIContentView.
I'm trying to implement additional UICollectionViewCell's state using UIConfigurationStateCustomKey. I've already read this post regarding practices for managing custom properties with cells configurations Seems like I can implement custom state for a UICollectionView's cell. Here is my implementation of additional state protocol CustomTypesAccessable: AnyObject {   var isMoving: Bool { get set } } extension UIConfigurationStateCustomKey {   static let isMoving = UIConfigurationStateCustomKey("com.myApp.cell.isMoving") } extension UICellConfigurationState {   var isMoving: Bool {     get { self[.isMoving] as? Bool ?? false }     set { self[.isMoving] = newValue }   } } extension BaseBlockView: CustomTypesAccessable {   var isMoving: Bool {     get {       currentConfiguration.currentConfigurationState?.isMoving ?? false     }     set {       currentConfiguration.currentConfigurationState?.isMoving = newValue     }   } } My BaseBlockView class: class BaseBlockView<Configuration: BlockConfigurationProtocol>: UIView, UIContentView {   var configuration: UIContentConfiguration {     get { currentConfiguration }     set {       guard let newConfiguration = newValue as? Configuration,          currentConfiguration != newConfiguration else { return }       currentConfiguration = newConfiguration     }   }   var currentConfiguration: Configuration {     didSet {       guard didSetupSubviews else { return }       update(with: currentConfiguration)     }   } I want to update this state from my view controller in the same way CollectionView can make cell selected - (void)selectItemAtIndexPath:(nullable NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UICollectionViewScrollPosition)scrollPosition; So I'm trying to change isMoving value this way:   let cell = cellForItem(at: indexPath)     let contentView = cell?.contentView as? CustomTypesAccessable     contentView?.isMoving = isMoving Everything works fine in that case, but after reusing cell UICellConfigurationState's isMoving property changes back to false. Is it a UIKit bug?
Replies
2
Boosts
0
Views
1.2k
Activity
Dec ’21