Giter Site home page Giter Site logo

UIKit support about decompose HOT 9 OPEN

moffpage avatar moffpage commented on May 28, 2024 1
UIKit support

from decompose.

Comments (9)

arkivanov avatar arkivanov commented on May 28, 2024 1

Decompose is primarily designed for declarative UI frameworks, like Compose, SwiftUI, React, etc. Also it is not possible to publish such an iOS framework (see the following thread for more information on this). All I can do here is to try to create a sample iOS app. However it might be difficult for me, as I'm not an iOS developer. Would it help you? I might need some help from community in this case.

from decompose.

moffpage avatar moffpage commented on May 28, 2024 1

That'd be ok for now.

from decompose.

fnc12 avatar fnc12 commented on May 28, 2024

I am confirming. I also need UIKit support in my nice project using this great library. I am an experienced iOS developer and can help you but my kotlin XP is not so rich. How can I help you?

from decompose.

moffpage avatar moffpage commented on May 28, 2024

@arkivanov I though Decompose didn't rely on MVIKotlin, why is it important? Sample iOS app would be very much appreciated! It'd help me a lot. I could help as far as I can myself.

from decompose.

fnc12 avatar fnc12 commented on May 28, 2024

SwiftUI can work with UIKit very well. Example so I am sure that it is very easy to add UIKit projects support and it also will make this beautiful lib even more popular cause a lot of legacy projects will be able to migrate to it

from decompose.

arkivanov avatar arkivanov commented on May 28, 2024

@moffpage Decompose does not depend on MVIKotlin in any way, and I didn't mention MVIKotlin either. Why such a question?

from decompose.

arkivanov avatar arkivanov commented on May 28, 2024

@fnc12 I will appreciate your help here! There is Counter sample in this repository. For Android it has two separate UIs: one using Jetpack Compose, and another one using normal Android Views. They both integrated in the MainActivity, depending on a flag. For iOS there is only SwiftUI. So I think we can do similarly to Android here and add UIKit, either in the same app with a flag (if possible), or as a separate app/target.

The Counter sample demonstrates nested Routers, and also multiple Routers in a component. But it would be also good to demonstrate UI state preservation while navigating between components. E.g. scrolling position should be restored when navigating to a previous component. There is currently no UI state which requires restoration in the Counter sample. So ideally we should add something for this, maybe some scrollable list, etc. I will update the Counter sample soon, so there will be UI state restoration as well.

UI state preservation is very important. It is supported by extensions-compose-xxx and extensions-android modules. And ideally it should work the same way in iOS. So let me first update the Counter sample, and then we can add UIKit. Does it sound good?

from decompose.

moffpage avatar moffpage commented on May 28, 2024

@arkivanov Sorry, I didn't mean anything related to MVIKotlin, just wanted to clarify if Decompose somehow depends on Reaktive? If not, what's the issue? Do we have to to have adapters for RxSwift? Since Value<*> has subscribe and unsubscribe methods, couldn't we just subscribe and unsubscribe in UIViewController's (or UIView(?)'s) appropriate lifecycle methods? And I believe we could still use Combine with UIKit, which Decompose has compatibility with through extensions.

from decompose.

arkivanov avatar arkivanov commented on May 28, 2024

@moffpage I provided the link to the similar discussion we had in Reaktive. It explains why it is not really possible to create and publish a separate iOS Framework with Swift extensions and helpers. E.g. for Android we have extensions-xxx modules published, which can be used by consumers to bind UI with Decompose components. But for iOS we can't publish anything like this, as explained in the linked issue. So the only way at the moment is to copy-paste solutions from samples, etc.

from decompose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.