-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CIS-363] Sample app improvements #549
Conversation
Codecov Report
@@ Coverage Diff @@
## main #549 +/- ##
=======================================
Coverage 88.59% 88.59%
=======================================
Files 155 155
Lines 5655 5655
=======================================
Hits 5010 5010
Misses 645 645 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! What was the fix in Sample app: fix logged assertion warnings
about? I didn't get it from the commit.
] | ||
|
||
if let user = users.randomElement() { | ||
if let user = Configuration.TestUser.defaults.shuffled().first(where: { $0.id != userId }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice trick 👍 I'd do filter { $0.id != userId}.randomElement()
but yours is probably more efficient :)
@available(iOS 14, *) | ||
struct ChatView: View { | ||
/// The `ChannelController` used to interact with this channel. Will be synchronized in `onAppear`. | ||
@StateObject var channel: ChatChannelController.ObservableObject | ||
/// The `text` written in the message composer. | ||
@State var text: String = "" | ||
/// Binding for message actions and channel actions ActionSheet. | ||
@State var actionSheetTrigger: Bool = false | ||
/// Message being edited. | ||
@State var editingMessage: ChatMessage? | ||
import Combine | ||
import StreamChatClient | ||
import SwiftUI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I don't think we need to intend code wrapped inside #if endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, seems like formatter indented it, not me. I agree with you, let me check if I can disable that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: should we also build sample app in iOS12?
I'd say yes just because we have so many#if
checks in there :)
Fixed in 5e88f6b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f2b0892
/// Protocol conformance needed for ActionSheet presenting. | ||
extension ChatUser: Identifiable {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already commented somewhere that this should live inside the SDK. Someone must have ignored it 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 63e1bca
|
We were hiding the token cell in override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
switch tableView.cellForRow(at: indexPath) {
case jwtCell:
return heightForJwtCell()
default:
return super.tableView(tableView, heightForRowAt: indexPath)
}
} calling |
16df8a3
to
5e88f6b
Compare
Sources_v3/Models/User.swift
Outdated
/// Protocol conformance needed for ActionSheet presenting. | ||
extension ChatUser: Identifiable {} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Think this should be in some iOS13 only user-related file like
UserController+SwiftUI.swift
- It should be public
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 04964ff
Doesn't need to be public since the original typealias is public
Also mainlined how we're using test data/users
We're switching to SPM from Carthage since Carthage pre-building frameworks uses different swift versions for different Xcodes. Also refactored github actions to not use Carthage anymore for v3
04964ff
to
076e070
Compare
Question: should we also build sample app in iOS12?
Currently, Github Actions has Xcode11.7 as default. Default Xcode will be changed to Xcode 12.0 on October, 20, but we should still be fine.