Skip to content

Commit 2f5f203

Browse files
committed
Add experimental flag
1 parent 6473c4b commit 2f5f203

20 files changed

+29
-1
lines changed

DemoApp/Screens/DemoAppTabBarController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44

55
import Combine
6+
@_spi(ExperimentalLocation)
67
import StreamChat
78
import StreamChatUI
89
import UIKit

DemoApp/StreamChat/Components/CustomAttachments/DemoComposerVC.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44

55
import CoreLocation
6+
@_spi(ExperimentalLocation)
67
import StreamChat
78
import StreamChatUI
89
import UIKit

DemoApp/StreamChat/Components/CustomAttachments/DemoQuotedChatMessageView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright © 2025 Stream.io Inc. All rights reserved.
33
//
44

5+
@_spi(ExperimentalLocation)
56
import StreamChat
67
import StreamChatUI
78
import UIKit

DemoApp/StreamChat/Components/CustomAttachments/LocationAttachment/LocationAttachmentViewDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright © 2025 Stream.io Inc. All rights reserved.
33
//
44

5+
@_spi(ExperimentalLocation)
56
import StreamChat
67
import StreamChatUI
78
import UIKit

DemoApp/StreamChat/Components/CustomAttachments/LocationAttachment/LocationAttachmentViewInjector.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright © 2025 Stream.io Inc. All rights reserved.
33
//
44

5+
@_spi(ExperimentalLocation)
56
import StreamChat
67
import StreamChatUI
78
import UIKit

DemoApp/StreamChat/Components/CustomAttachments/LocationAttachment/LocationDetailViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44

55
import MapKit
6+
@_spi(ExperimentalLocation)
67
import StreamChat
78
import StreamChatUI
89
import UIKit

DemoApp/StreamChat/Components/DemoChatChannelListItemView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Copyright © 2025 Stream.io Inc. All rights reserved.
33
//
44

5+
@_spi(ExperimentalLocation)
6+
import StreamChat
57
import StreamChatUI
68
import UIKit
79

DemoApp/StreamChat/Components/DemoChatMessageActionsVC.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44

55
import Foundation
6+
@_spi(ExperimentalLocation)
67
import StreamChat
78
import StreamChatUI
89
import UIKit

Sources/StreamChat/Controllers/ChannelController/ChannelController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ public class ChatChannelController: DataController, DelegateCallable, DataStoreP
841841
/// - quotedMessageId: The id of the quoted message, in case the location is an inline reply.
842842
/// - extraData: Additional extra data of the message object.
843843
/// - completion: Called when saving the message to the local DB finishes, not when the message reaches the server.
844+
@_spi(ExperimentalLocation)
844845
public func sendStaticLocation(
845846
_ location: LocationAttachmentInfo,
846847
text: String? = nil,
@@ -901,6 +902,7 @@ public class ChatChannelController: DataController, DelegateCallable, DataStoreP
901902
/// - extraData: Additional extra data of the message object.
902903
/// - completion: Called when saving the message to the local DB finishes,
903904
/// not when the message reaches the server.
905+
@_spi(ExperimentalLocation)
904906
public func startLiveLocationSharing(
905907
_ location: LocationAttachmentInfo,
906908
text: String? = nil,
@@ -963,6 +965,7 @@ public class ChatChannelController: DataController, DelegateCallable, DataStoreP
963965
}
964966

965967
/// Stops sharing the live location message in the channel.
968+
@_spi(ExperimentalLocation)
966969
public func stopLiveLocationSharing(completion: ((Result<MessageId, Error>) -> Void)? = nil) {
967970
guard let cid = cid, isChannelAlreadyCreated else {
968971
channelModificationFailed { error in

Sources/StreamChat/Controllers/CurrentUserController/CurrentUserController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ public extension CurrentChatUserController {
271271
/// The updates are throttled to avoid sending too many requests.
272272
///
273273
/// - Parameter location: The new location to be updated.
274+
@_spi(ExperimentalLocation)
274275
func updateLiveLocation(_ location: LocationAttachmentInfo) {
275276
guard let messages = activeLiveLocationMessagesObserver?.items, !messages.isEmpty else {
276277
return
@@ -482,17 +483,20 @@ public protocol CurrentChatUserControllerDelegate: AnyObject {
482483
)
483484

484485
/// The controller observed a change in the active live location messages.
486+
@_spi(ExperimentalLocation)
485487
func currentUserController(
486488
_ controller: CurrentChatUserController,
487489
didChangeActiveLiveLocationMessages messages: [ChatMessage]
488490
)
489491

490492
/// The current user started sharing his location in message attachments.
493+
@_spi(ExperimentalLocation)
491494
func currentUserControllerDidStartSharingLiveLocation(
492495
_ controller: CurrentChatUserController
493496
)
494497

495498
/// The current user has no active live location attachments.
499+
@_spi(ExperimentalLocation)
496500
func currentUserControllerDidStopSharingLiveLocation(
497501
_ controller: CurrentChatUserController
498502
)

Sources/StreamChat/Controllers/MessageController/MessageController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ public class ChatMessageController: DataController, DelegateCallable, DataStoreP
938938
///
939939
/// - Parameters:
940940
/// - completion: Called when the server updates the message.
941+
@_spi(ExperimentalLocation)
941942
public func stopLiveLocationSharing(completion: ((Result<ChatMessage, Error>) -> Void)? = nil) {
942943
guard let locationAttachment = message?.liveLocationAttachments.first else {
943944
callback {

Sources/StreamChat/Models/Attachments/Location/ChatMessageLiveLocationAttachment.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import Foundation
77
/// A type alias for an attachment with `LiveLocationAttachmentPayload` payload type.
88
///
99
/// Live location attachments are used to represent a live location sharing in a chat message.
10+
@_spi(ExperimentalLocation)
1011
public typealias ChatMessageLiveLocationAttachment = ChatMessageAttachment<LiveLocationAttachmentPayload>
1112

1213
/// The payload for attachments with `.liveLocation` type.
14+
@_spi(ExperimentalLocation)
1315
public struct LiveLocationAttachmentPayload: AttachmentPayload {
1416
/// The type used to parse the attachment.
1517
public static var type: AttachmentType = .liveLocation

Sources/StreamChat/Models/Attachments/Location/ChatMessageStaticLocationAttachment.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import Foundation
77
/// A type alias for an attachment with `StaticLocationAttachmentPayload` payload type.
88
///
99
/// Static location attachments represent a location that doesn't change.
10+
@_spi(ExperimentalLocation)
1011
public typealias ChatMessageStaticLocationAttachment = ChatMessageAttachment<StaticLocationAttachmentPayload>
1112

1213
/// The payload for attachments with `.staticLocation` type.
14+
@_spi(ExperimentalLocation)
1315
public struct StaticLocationAttachmentPayload: AttachmentPayload {
1416
/// The type used to parse the attachment.
1517
public static var type: AttachmentType = .staticLocation

Sources/StreamChat/Models/ChatMessage.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,13 @@ public extension ChatMessage {
318318
}
319319

320320
/// Returns the attachments of `.staticLocation` type.
321+
@_spi(ExperimentalLocation)
321322
var staticLocationAttachments: [ChatMessageStaticLocationAttachment] {
322323
attachments(payloadType: StaticLocationAttachmentPayload.self)
323324
}
324325

325326
/// Returns the attachments of `.liveLocation` type.
327+
@_spi(ExperimentalLocation)
326328
var liveLocationAttachments: [ChatMessageLiveLocationAttachment] {
327329
attachments(payloadType: LiveLocationAttachmentPayload.self)
328330
}

TestTools/StreamChatTestTools/TestData/DummyData/MessageAttachmentPayload.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44

55
import Foundation
6-
@testable import StreamChat
6+
@testable @_spi(ExperimentalLocation) import StreamChat
77

88
extension MessageAttachmentPayload {
99
static func dummy(

Tests/StreamChatTests/Controllers/ChannelController/ChannelController_Tests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44

55
import CoreData
6+
@_spi(ExperimentalLocation)
67
@testable import StreamChat
78
@testable import StreamChatTestTools
89
import XCTest

Tests/StreamChatTests/Controllers/MessageController/MessageController_Tests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44

55
import CoreData
6+
@_spi(ExperimentalLocation)
67
@testable import StreamChat
78
@testable import StreamChatTestTools
89
import XCTest

Tests/StreamChatTests/Models/Attachments/LiveLocationAttachmentPayload_Tests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright © 2025 Stream.io Inc. All rights reserved.
33
//
44

5+
@_spi(ExperimentalLocation)
56
@testable import StreamChat
67
@testable import StreamChatTestTools
78
import XCTest

Tests/StreamChatTests/Models/Attachments/StaticLocationAttachmentPayload_Tests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright © 2025 Stream.io Inc. All rights reserved.
33
//
44

5+
@_spi(ExperimentalLocation)
56
@testable import StreamChat
67
@testable import StreamChatTestTools
78
import XCTest

Tests/StreamChatTests/Models/ChatMessage_Tests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright © 2025 Stream.io Inc. All rights reserved.
33
//
44

5+
@_spi(ExperimentalLocation)
56
@testable import StreamChat
67
@testable import StreamChatTestTools
78
import XCTest

0 commit comments

Comments
 (0)