@IntentParameterDependency Always Returns nil in iOS 18

The following code works perfectly fine in iOS 17, where I can retrieve the desired dependency value through @IntentParameterDependency as expected. However, in iOS 18, addTransaction always returns nil.

struct CategoryEntityQuery: EntityStringQuery {
    
    @Dependency
    private var persistentController: PersistentController
    
    @IntentParameterDependency<AddTransactionIntent>(
        \.$categoryType
    )
    var addTransaction
    
    func entities(matching string: String) async throws -> [CategoryEnitity] {
        guard let addTransaction else {
            return []
        }
        
        // ...
    }
    
    func entities(for identifiers: [CategoryEnitity.ID]) async throws -> [CategoryEnitity] {
        guard let addTransaction else {
            return []
        }
        
       // ...
    }
    
    func suggestedEntities() async throws -> [CategoryEnitity] {
        guard let addTransaction else {
            return []
        }
        
       // ...
    }
    
}

Has anyone else encountered the same issue? Any insights or potential workarounds would be greatly appreciated.

  • iOS: 18.0 (22A3354)
  • Xcode 16.0 (16A242d)

Same issue, do you have any workaround?

Same issues!

Same Issues!

@IntentParameterDependency Always Returns nil in iOS 18
 
 
Q