Skip to content

Commit 04e911f

Browse files
2 parents 4f2cda8 + 93f5446 commit 04e911f

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

DemoAppSwiftUI/CustomAttachment.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import StreamChatSwiftUI
99
class CustomMessageResolver: MessageTypeResolving {
1010

1111
func hasCustomAttachment(message: ChatMessage) -> Bool {
12-
let messageComponents = message.text.components(separatedBy: " ")
12+
let messageComponents = message.text.components(separatedBy: CharacterSet.whitespacesAndNewlines)
1313
return messageComponents.filter { component in
1414
isValidEmail(component)
1515
}

DemoAppSwiftUI/ViewFactoryExamples.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CustomFactory: ViewFactory {
6565

6666

6767
// Example for an injected action. Uncomment to see it in action.
68-
func suppotedMoreChannelActions(
68+
func supportedMoreChannelActions(
6969
for channel: ChatChannel,
7070
onDismiss: @escaping () -> Void,
7171
onError: @escaping (Error) -> Void

Sources/StreamChatSwiftUI/ChatChannel/Reactions/ReactionsOverlayView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
3232
self.currentSnapshot = currentSnapshot
3333
self.messageDisplayInfo = messageDisplayInfo
3434
self.onBackgroundTap = onBackgroundTap
35-
messageActionsCount = factory.suppotedMessageActions(
35+
messageActionsCount = factory.supportedMessageActions(
3636
for: messageDisplayInfo.message,
3737
onDismiss: {},
3838
onError: { _ in }

Sources/StreamChatSwiftUI/DefaultViewFactory.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extension ViewFactory {
2828
DefaultChannelListHeaderModifier(title: title)
2929
}
3030

31-
public func suppotedMoreChannelActions(
31+
public func supportedMoreChannelActions(
3232
for channel: ChatChannel,
3333
onDismiss: @escaping () -> Void,
3434
onError: @escaping (Error) -> Void
@@ -48,7 +48,7 @@ extension ViewFactory {
4848
) -> MoreChannelActionsView {
4949
MoreChannelActionsView(
5050
channel: channel,
51-
channelActions: suppotedMoreChannelActions(
51+
channelActions: supportedMoreChannelActions(
5252
for: channel,
5353
onDismiss: onDismiss,
5454
onError: onError
@@ -370,7 +370,7 @@ extension ViewFactory {
370370
AssetsAccessPermissionView()
371371
}
372372

373-
public func suppotedMessageActions(
373+
public func supportedMessageActions(
374374
for message: ChatMessage,
375375
onDismiss: @escaping () -> Void,
376376
onError: @escaping (Error) -> Void
@@ -388,7 +388,7 @@ extension ViewFactory {
388388
onDismiss: @escaping () -> Void,
389389
onError: @escaping (Error) -> Void
390390
) -> some View {
391-
let messageActions = suppotedMessageActions(
391+
let messageActions = supportedMessageActions(
392392
for: message,
393393
onDismiss: onDismiss,
394394
onError: onError

Sources/StreamChatSwiftUI/ViewFactory.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public protocol ViewFactory: AnyObject {
6262
/// - onDismiss: handler when the more actions view is dismissed.
6363
/// - onError: handler when an error happened.
6464
/// - Returns: list of `ChannelAction` items.
65-
func suppotedMoreChannelActions(
65+
func supportedMoreChannelActions(
6666
for channel: ChatChannel,
6767
onDismiss: @escaping () -> Void,
6868
onError: @escaping (Error) -> Void
@@ -369,7 +369,7 @@ public protocol ViewFactory: AnyObject {
369369
/// - onDismiss: handler when the more actions view is dismissed.
370370
/// - onError: handler when an error happened.
371371
/// - Returns: list of `MessageAction` items.
372-
func suppotedMessageActions(
372+
func supportedMessageActions(
373373
for message: ChatMessage,
374374
onDismiss: @escaping () -> Void,
375375
onError: @escaping (Error) -> Void

docusaurus/docs/iOS/swiftui/components/attachments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Next, you need to define a custom rule in our `MessageTypeResolving` protocol, w
114114
class CustomMessageResolver: MessageTypeResolving {
115115

116116
func hasCustomAttachment(message: ChatMessage) -> Bool {
117-
let messageComponents = message.text.components(separatedBy: " ")
117+
let messageComponents = message.text.components(separatedBy: CharacterSet.whitespacesAndNewlines)
118118
return messageComponents.filter { component in
119119
isValidEmail(component)
120120
}

docusaurus/docs/iOS/swiftui/components/message-reactions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public func makeMessageReactionView(
3636

3737
## Customizing the reactions overlay view
3838

39-
The reactions overlay view (shown on long press of a message), also provides access to the message actions. If you want to replace / extend the default message actions, you can do so via the `suppotedMessageActions` method in the `ViewFactory`. As an inspiration, here's a glimpse on how the default message actions are configured.
39+
The reactions overlay view (shown on long press of a message), also provides access to the message actions. If you want to replace / extend the default message actions, you can do so via the `supportedMessageActions` method in the `ViewFactory`. As an inspiration, here's a glimpse on how the default message actions are configured.
4040

4141
```swift
42-
public func suppotedMessageActions(
42+
public func supportedMessageActions(
4343
for message: ChatMessage,
4444
onDismiss: @escaping () -> Void,
4545
onError: @escaping (Error) -> Void
@@ -185,7 +185,7 @@ public func makeMessageActionsView(
185185
onDismiss: @escaping () -> Void,
186186
onError: @escaping (Error) -> Void
187187
) -> some View {
188-
let messageActions = suppotedMessageActions(
188+
let messageActions = supportedMessageActions(
189189
for: message,
190190
onDismiss: onDismiss,
191191
onError: onError

docusaurus/docs/iOS/swiftui/components/swipe-actions-channels.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ The SwiftUI SDK allows you to either use the same view, with additional actions
1212

1313
First, we will explore how you can extend the existing channel actions view with your own actions. The default actions provided by the SDK are leaving group, muting/unmuting group and users, as well as deleting the conversation.
1414

15-
Let's now add additional action that will freeze the channel. In order to do this, we need to create our own view factory, which will provide its own implementation of the `suppotedMoreChannelActions` method of the SDK. This method returns an array of the channel actions displayed when the ellipsis button is tapped in the swiped state of a channel.
15+
Let's now add additional action that will freeze the channel. In order to do this, we need to create our own view factory, which will provide its own implementation of the `supportedMoreChannelActions` method of the SDK. This method returns an array of the channel actions displayed when the ellipsis button is tapped in the swiped state of a channel.
1616

1717
```swift
18-
func suppotedMoreChannelActions(
18+
func supportedMoreChannelActions(
1919
for channel: ChatChannel,
2020
onDismiss: @escaping () -> Void,
2121
onError: @escaping (Error) -> Void

0 commit comments

Comments
 (0)