Skip to content

ViewModel is not cleared on iOS 17.4 #80

@osrl

Description

@osrl

I was testing on iOS 17.0 before and everything was working fine.

I'm using @StateViewModel. If there's anything more I can provide please let me know.

Edit: My code works fine on 17.2 and doesn't work on 17.4. But I couldn't reproduce it on the sample app. Looks like it's a bug on my code. It might be related to koin but I'm not sure.

Do you have any idea @rickclephas

Edit: It's not related to koin either. I've copied your TimeTravelViewModel and inited it just like you did

struct ChatScreen: View {
    @StateViewModel var timeViewModel = TimeTravelViewModel()
   
    let printer = DeallocPrinter()
}
class DeallocPrinter {
    deinit {
        print("ChatScreen deallocated")
    }
}

Even if the ChatScreen is deallocated, timeViewModel is not deallocated and not cleared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions