Mustafa Ozhan

    Mustafa Ozhan

    1 year ago
    Is there any way to extend a kotlin class in common from
    Combine > ObservedObject
    so that we can use as
    @ObservedObject
    in SwiftUI views ? Or do we have to create a wrapper for each viewModel ?
    John O'Reilly

    John O'Reilly

    1 year ago
    Just my 2c but I think in that case there's isn't a lot of value in having view models in shared code....what you might have though are what I think of as "view model helper" classes that are then used by "native" view model (based on ObservableObject on iOS and AAC ViewModel on Android)
    Mustafa Ozhan

    Mustafa Ozhan

    1 year ago
    Thank you for you reply, yes i read this one, it is really interesting one and has many benefits, but I do not like the idea of creating view model in each platform for each screen. Because we can achieve viewModel for Android and JS in common probably it will be better to duplicate only on IOS side. On the other hand I am really wondering if I really need to use
    Combine, ObservedObject
    with
    @ObservedObject
    and
    @Published
    vars on IOS side or better to use straightforward approach like here: https://github.com/kuuuurt/jokes-app-multiplatform/blob/master/ios/JokesApp/ViewController.swift
    saket

    saket

    1 year ago
    Mustafa Ozhan

    Mustafa Ozhan

    1 year ago
    this one was interesting too will try this also thanks a lot!