Thread
#multiplatform
    Lucas Schiavini

    Lucas Schiavini

    5 months ago
    And would a Stop the world pause break the swift UI necessarily?
    r

    ribesg

    5 months ago
    I have a pretty big iOS app written entirely in Kotlin. The switch to the new memory model didn’t seem to change anything, but it’s still recent. Didn’t notice any new lag/freezing. I just had the compilation time tripled and I don’t have to care about freezing stuff anymore.
    I’m not using Swift UI (you can’t in Kotlin afaik) but didn’t notice anything different in my usage of UIKit
    Lucas Schiavini

    Lucas Schiavini

    5 months ago
    Whoa whoa whoa, I use all my apps with swift ui and it works with kotlin multiplatform seamlessly
    @ribesg But that is my point exactly, with their new garbage collector, pauses should be less frequent, but longer. I want to be able to avoid pauses without sacrificing developer experience
    r

    ribesg

    5 months ago
    I kinda hope you didn’t misunderstand me and there actually is a way to use Swift UI in Kotlin but I think you misunderstood. I’m using UIKit in Kotlin. I don’t have any Swift or XML code for the UI, only Kotlin
    Last time I checked you couldn’t use any pure Swift lib in Kotlin, and Swift UI is pure Swift
    Lucas Schiavini

    Lucas Schiavini

    5 months ago
    Ohhhhhhhh That is cool, I didn't know you could do that lol
    r

    ribesg

    5 months ago
    It’s insanely cool, switching language all the time breaks my brain so it actually saves me a lot of time. Plus with some neat extension functions the UI code can be pretty tidy (especially on the constraints part). And not having to use XCode is a huge plus too
    My only use of XCode currently is launching simulators and reading log, and rarely using the UI debugger thingy
    Here’s a Kotlin view for example:
    class EventListUIView(frame: CValue<CGRect>, header: UIView) : UIView(frame), UITextFieldDelegateProtocol {
    
        val collectionViewWrapper = EventListUICollectionViewWrapper()
    
        val loader = uiActivityIndicatorView(UIColor.wizParma) {
            large()
        }
    
        init {
            backgroundColor = UIColor.backgroundGray
    
            addSubview(collectionViewWrapper.view)
            addSubview(loader)
            addSubview(header)
    
            setupConstraints {
                with(header) {
                    topToTopOf(parent, useSafeArea = true)
                    fitHorizontallyTo(parent)
                }
    
                with(collectionViewWrapper.view) {
                    topToTopOf(parent, useSafeArea = true)
                    bottomToBottomOf(parent)
                    fitHorizontallyTo(parent)
                }
    
                with(loader) {
                    centerIn(parent)
                }
            }
        }
    
    }