Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3f4fc10

Browse filesBrowse files
Update SDK version
1 parent 9d80058 commit 3f4fc10
Copy full SHA for 3f4fc10

File tree

4 files changed

+77
-70
lines changed
Filter options

4 files changed

+77
-70
lines changed
+56-49Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,59 @@
11
{
2-
"object": {
3-
"pins": [
4-
{
5-
"package": "Gifu",
6-
"repositoryURL": "https://github.com/kaishin/Gifu",
7-
"state": {
8-
"branch": null,
9-
"revision": "51f2eab32903e336f590c013267cfa4d7f8b06c4",
10-
"version": "3.3.1"
11-
}
12-
},
13-
{
14-
"package": "Nuke",
15-
"repositoryURL": "https://github.com/kean/Nuke.git",
16-
"state": {
17-
"branch": null,
18-
"revision": "472a03c15f39592007d94f25abe554350bc8aa2b",
19-
"version": "10.5.1"
20-
}
21-
},
22-
{
23-
"package": "NukeUI",
24-
"repositoryURL": "https://github.com/kean/NukeUI.git",
25-
"state": {
26-
"branch": null,
27-
"revision": "08e953d8d80b409bebcd95ba0635fdd748934ce0",
28-
"version": "0.7.0"
29-
}
30-
},
31-
{
32-
"package": "StreamChat",
33-
"repositoryURL": "https://github.com/GetStream/stream-chat-swift.git",
34-
"state": {
35-
"branch": null,
36-
"revision": "2b868ca255658dbed2806ae6bde94f8793b4703c",
37-
"version": "4.6.0"
38-
}
39-
},
40-
{
41-
"package": "StreamChatSwiftUI",
42-
"repositoryURL": "https://github.com/getstream/stream-chat-swiftui",
43-
"state": {
44-
"branch": "main",
45-
"revision": "a1e63903333bc6c0ba6a48c1c28e0e5bb5c8dabf",
46-
"version": null
47-
}
2+
"pins" : [
3+
{
4+
"identity" : "difference",
5+
"kind" : "remoteSourceControl",
6+
"location" : "https://github.com/krzysztofzablocki/Difference.git",
7+
"state" : {
8+
"revision" : "02fe1111edc8318c4f8a0da96336fcbcc201f38b",
9+
"version" : "1.0.1"
4810
}
49-
]
50-
},
51-
"version": 1
11+
},
12+
{
13+
"identity" : "nuke",
14+
"kind" : "remoteSourceControl",
15+
"location" : "https://github.com/kean/Nuke.git",
16+
"state" : {
17+
"revision" : "93c8dc78fbc0aa3538a0db460eb389d4180af242",
18+
"version" : "11.3.1"
19+
}
20+
},
21+
{
22+
"identity" : "stream-chat-swift",
23+
"kind" : "remoteSourceControl",
24+
"location" : "https://github.com/GetStream/stream-chat-swift.git",
25+
"state" : {
26+
"revision" : "7efe79171c24c8eb312401f87c453c15f77fbba9",
27+
"version" : "4.31.0"
28+
}
29+
},
30+
{
31+
"identity" : "stream-chat-swift-test-helpers",
32+
"kind" : "remoteSourceControl",
33+
"location" : "https://github.com/GetStream/stream-chat-swift-test-helpers.git",
34+
"state" : {
35+
"revision" : "237da98e4946ed8e2dac51d9e82e713b0d47a298",
36+
"version" : "0.2.5"
37+
}
38+
},
39+
{
40+
"identity" : "stream-chat-swiftui",
41+
"kind" : "remoteSourceControl",
42+
"location" : "https://github.com/getstream/stream-chat-swiftui",
43+
"state" : {
44+
"branch" : "main",
45+
"revision" : "4d7fa3d08de8ce5f955df89f75973f5241d77e3f"
46+
}
47+
},
48+
{
49+
"identity" : "swifter",
50+
"kind" : "remoteSourceControl",
51+
"location" : "https://github.com/httpswift/swifter",
52+
"state" : {
53+
"revision" : "9483a5d459b45c3ffd059f7b55f9638e268632fd",
54+
"version" : "1.5.0"
55+
}
56+
}
57+
],
58+
"version" : 2
5259
}

‎SwiftUIChatDemo/SwiftUIChatDemo/AppDelegate.swift

Copy file name to clipboardExpand all lines: SwiftUIChatDemo/SwiftUIChatDemo/AppDelegate.swift
+13-13Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import UIKit
44
import SwiftUI
55

66
class AppDelegate: NSObject, UIApplicationDelegate {
7-
7+
88
var streamChat: StreamChat?
99

1010
var chatClient: ChatClient = {
@@ -14,10 +14,10 @@ class AppDelegate: NSObject, UIApplicationDelegate {
1414
let client = ChatClient(config: config)
1515
return client
1616
}()
17-
17+
1818
func application(_ application: UIApplication,
1919
didFinishLaunchingWithOptions launchOptions:
20-
[UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
20+
[UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
2121
var colors = ColorPalette()
2222
let streamBlue = UIColor(red: 0, green: 108.0 / 255.0, blue: 255.0 / 255.0, alpha: 1)
2323
colors.tintColor = Color(streamBlue)
@@ -31,23 +31,23 @@ class AppDelegate: NSObject, UIApplicationDelegate {
3131

3232
let appearance = Appearance(colors: colors, images: images, fonts: fonts)
3333

34-
let channelNamer: ChatChannelNamer = { channel, currentUserId in
34+
let channelNamer: ChatChannelNamer = { channel, _ in
3535
"This is our custom name: \(channel.name ?? "no name")"
3636
}
37-
37+
3838
let customResolver = CustomMessageResolver()
3939
let utils = Utils(messageTypeResolver: customResolver, channelNamer: channelNamer)
40-
40+
4141
streamChat = StreamChat(chatClient: chatClient, appearance: appearance, utils: utils)
4242

4343
connectUser()
44-
44+
4545
return true
4646
}
47-
47+
4848
private func connectUser() {
4949
let token = try! Token(rawValue: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoibHVrZV9za3l3YWxrZXIifQ.kFSLHRB5X62t0Zlc7nwczWUfsQMwfkpylC6jCUZ6Mc0")
50-
50+
5151
chatClient.connectUser(
5252
userInfo: .init(id: "luke_skywalker",
5353
name: "Luke Skywalker",
@@ -64,13 +64,13 @@ class AppDelegate: NSObject, UIApplicationDelegate {
6464

6565
class CustomViewFactory: ViewFactory {
6666
@Injected(\.chatClient) public var chatClient
67-
67+
6868
func makeMessageTextView(for message: ChatMessage,
6969
isFirst: Bool,
7070
availableWidth: CGFloat) -> some View {
7171
return CustomMessageTextView(message: message, isFirst: isFirst)
7272
}
73-
73+
7474
func makeCustomAttachmentViewType(
7575
for message: ChatMessage,
7676
isFirst: Bool,
@@ -88,10 +88,10 @@ class CustomViewFactory: ViewFactory {
8888
struct CustomMessageTextView: View {
8989
@Injected(\.colors) var colors
9090
@Injected(\.fonts) var fonts
91-
91+
9292
var message: ChatMessage
9393
var isFirst: Bool
94-
94+
9595
public var body: some View {
9696
Text(message.text)
9797
.padding()

‎SwiftUIChatDemo/SwiftUIChatDemo/CustomAttachment.swift

Copy file name to clipboardExpand all lines: SwiftUIChatDemo/SwiftUIChatDemo/CustomAttachment.swift
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,32 @@ import StreamChat
77
import StreamChatSwiftUI
88

99
class CustomMessageResolver: MessageTypeResolving {
10-
10+
1111
func hasCustomAttachment(message: ChatMessage) -> Bool {
1212
let messageComponents = message.text.components(separatedBy: CharacterSet.whitespacesAndNewlines)
1313
return messageComponents.filter { component in
1414
isValidEmail(component)
1515
}
1616
.count > 0
1717
}
18-
18+
1919
private func isValidEmail(_ email: String) -> Bool {
2020
let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}"
2121

22-
let emailPred = NSPredicate(format:"SELF MATCHES %@", emailRegEx)
22+
let emailPred = NSPredicate(format: "SELF MATCHES %@", emailRegEx)
2323
return emailPred.evaluate(with: email)
2424
}
25-
25+
2626
}
2727

2828
struct CustomAttachmentView: View {
29-
29+
3030
@State var envelopeTapped = false
31-
31+
3232
let message: ChatMessage
3333
let width: CGFloat
3434
let isFirst: Bool
35-
35+
3636
var body: some View {
3737
HStack {
3838
Image(systemName: "envelope").onTapGesture {

‎SwiftUIChatDemo/SwiftUIChatDemo/SwiftUIChatDemoApp.swift

Copy file name to clipboardExpand all lines: SwiftUIChatDemo/SwiftUIChatDemo/SwiftUIChatDemoApp.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import StreamChatSwiftUI
1212
@main
1313
struct SwiftUIChatDemoApp: App {
1414
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
15-
15+
1616
var body: some Scene {
1717
WindowGroup {
1818
ChatChannelListView(viewFactory: CustomViewFactory())

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.