stream-chat-swift icon indicating copy to clipboard operation
stream-chat-swift copied to clipboard

[POC] Reuse ViewModels across SwiftUI and UIKit

Open nuno-vieira opened this issue 1 year ago โ€ข 3 comments

Summary

This is just a proof of concept to see how feasible it would be to reuse view models across the SwiftUI and UIKit SDK.

Spoiler Alert: It looks pretty promising ๐Ÿ‘Œ

Further work

  • We would need to make sure we do not import UIKit or SwiftUI in the ViewModels to make sure they do not depend on any UI framework
  • We would need to expose a constructor to replace the "@Injected" dependencies from SwiftUI
  • We would need to make the View Models, Formatters and all presentation logic part of LLC or create an additional framework
  • Maybe even move SwiftUI to this repo?

Demo

Loading Threads New Threads

nuno-vieira avatar Oct 15 '24 17:10 nuno-vieira

1 Message
:book: Skipping Danger since the Pull Request is classed as Draft/Work In Progress

Generated by :no_entry_sign: Danger

github-actions[bot] avatar Oct 15 '24 17:10 github-actions[bot]

SDK Size

title develop branch diff status
StreamChat 6.92 MB 6.92 MB 0 KB ๐ŸŸข
StreamChatUI 4.95 MB 5.07 MB +128 KB ๐ŸŸข

Stream-SDK-Bot avatar Oct 15 '24 17:10 Stream-SDK-Bot

Closing this one for now. But the PoC was a success and for sure validated that we can share view models between SwiftUI and UIKit in the future.

nuno-vieira avatar Nov 05 '24 18:11 nuno-vieira