Wednesday, October 28, 2026
HomeiOS DevelopmentSwift: getting the values of <Dictionary<AnyHashable, Any>>

Swift: getting the values of <Dictionary<AnyHashable, Any>>

[ad_1]

I’ve this implementation:

NotificationCenter.default.writer(for: .NSManagedObjectContextObjectsDidChange)
            .sink { _ in
                print("sink")
            } receiveValue: { worth in
                guard let userInfo = worth.userInfo else {
                    print("person information")
                    return
                }
                
            }.retailer(in: &cancellables)

The place the worth is:

po worth.userInfo
▿ Optionally available<Dictionary<AnyHashable, Any>>
  ▿ some : 2 parts
    ▿ 0 : 2 parts
      ▿ key : AnyHashable("managedObjectContext")
        - worth : "managedObjectContext"
      - worth : <_PFWeakReference: 0x60000349ad60>
    ▿ 1 : 2 parts
      ▿ key : AnyHashable("inserted")
        - worth : "inserted"
      ▿ worth : 1 aspect
        - 0 : <Todo: 0x6000017b40a0> (entity: Todo; id: 0x600003498600 <x-coredata:///Todo/t8CE8CFA3-2C32-4279-BDEF-0A7E4810FDDB2>; information: {
    date = "2022-03-31 23:43:35 +0000";
    title = "new todo 2022-03-31 23:43:35 +0000";
})

My query is how can I get this worth to match it with the Entity of Todo:

<Todo: 0x6000017b40a0> (entity: Todo; id: 0x600003498600 <x-coredata:///Todo/t8CE8CFA3-2C32-4279-BDEF-0A7E4810FDDB2>

I will actually admire your assist.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments