stream-chat-swift
stream-chat-swift copied to clipboard
[POC] Reuse ViewModels across SwiftUI and UIKit
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 |
|---|---|
| 1 Message | |
|---|---|
| :book: | Skipping Danger since the Pull Request is classed as Draft/Work In Progress |
Generated by :no_entry_sign: Danger
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 | ๐ข |
Quality Gate passed
Issues
164 New issues
0 Accepted issues
Measures
0 Security Hotspots
84.4% Coverage on New Code
0.1% Duplication on New Code
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.