Skip to content

Commit 5d5167c

Browse files
committed
organize imports
1 parent 0581fa7 commit 5d5167c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+126
-30
lines changed

Sources/CHeaders/Header.h

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
//
2-
// Header.h
3-
//
4-
//
5-
// Created by David Liu on 6/17/22.
6-
//
1+
/*
2+
* Copyright 2022 LiveKit
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
716

817
#include <unistd.h>

Sources/LiveKit/Broadcast/BroadcastScreenCapturer.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
// Created by Alex-Dan Bumbu on 06/01/2021.
66
//
77

8-
#if os(iOS)
9-
108
import Foundation
119
import WebRTC
1210
import Promises
11+
12+
#if canImport(UIKit)
1313
import UIKit
14+
#endif
15+
16+
#if os(iOS)
1417

1518
class BroadcastScreenCapturer: BufferCapturer {
1619
static let kRTCScreensharingSocketFD = "rtc_SSFD"

Sources/LiveKit/Broadcast/BroadcastServerSocketConnection.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import Foundation
1010
import Darwin
11+
1112
#if canImport(CHeaders)
1213
import CHeaders
1314
#endif

Sources/LiveKit/Broadcast/Uploader/LKSampleHandler.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77

88
#if os(iOS)
99

10-
import ReplayKit
1110
import Promises
1211
import OSLog
1312
import Logging
1413

14+
#if canImport(ReplayKit)
15+
import ReplayKit
16+
#endif
17+
1518
open class LKSampleHandler: RPBroadcastSampleHandler {
1619

1720
private var clientConnection: BroadcastUploadSocketConnection?

Sources/LiveKit/Broadcast/Uploader/SampleUploader.swift

+3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
#if os(iOS)
1010

1111
import Foundation
12+
13+
#if canImport(ReplayKit)
1214
import ReplayKit
15+
#endif
1316

1417
private enum Constants {
1518
static let bufferMaxLength = 10240

Sources/LiveKit/Core/Engine.swift

+3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
import Foundation
1818
import WebRTC
1919
import Promises
20+
21+
#if canImport(Network)
2022
import Network
23+
#endif
2124

2225
internal class Engine: MulticastDelegate<EngineDelegate> {
2326

Sources/LiveKit/Core/Room.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
*/
1616

1717
import Foundation
18-
import Network
19-
import Promises
2018
import WebRTC
19+
import Promises
20+
21+
#if canImport(Network)
22+
import Network
23+
#endif
2124

2225
@objc
2326
public class Room: NSObject, Loggable {

Sources/LiveKit/Core/SignalClient.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616

1717
import Foundation
18-
import Promises
1918
import WebRTC
19+
import Promises
2020

2121
internal class SignalClient: MulticastDelegate<SignalClientDelegate> {
2222

Sources/LiveKit/Core/Transport.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616

1717
import Foundation
18-
import Promises
1918
import WebRTC
19+
import Promises
2020
import SwiftProtobuf
2121

2222
internal typealias TransportOnOffer = (RTCSessionDescription) -> Promise<Void>

Sources/LiveKit/Extensions/LiveKit+AudioSession.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
1819

1920
/// Function type for `LiveKit.onShouldConfigureAudioSession`.

Sources/LiveKit/Extensions/RTCConfiguration.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
1819

1920
extension RTCConfiguration {

Sources/LiveKit/Extensions/RTCDataChannel+Util.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
1819

1920
extension RTCDataChannel {

Sources/LiveKit/Extensions/RTCPeerConnectionState.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
1819

1920
extension RTCPeerConnectionState: CustomStringConvertible {

Sources/LiveKit/Extensions/RTCVideoCapturerDelegate+Buffer.swift

+4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
19+
20+
#if canImport(ReplayKit)
1821
import ReplayKit
22+
#endif
1923

2024
extension FixedWidthInteger {
2125

Sources/LiveKit/LiveKit.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*/
1616

1717
import Foundation
18-
import Logging
19-
import Promises
2018
import WebRTC
19+
import Promises
20+
import Logging
2121

2222
internal let logger = Logger(label: "LiveKitSDK")
2323

Sources/LiveKit/ObjCSupport.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616

1717
import Foundation
18-
import Promises
1918
import WebRTC
19+
import Promises
2020

2121
// MARK: - Objective-C Support
2222

Sources/LiveKit/Participant/LocalParticipant.swift

+4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
1819
import Promises
20+
21+
#if canImport(ReplayKit)
1922
import ReplayKit
23+
#endif
2024

2125
@objc
2226
public class LocalParticipant: Participant {

Sources/LiveKit/Publications/RemoteTrackPublication.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
import Foundation
1818
import CoreGraphics
19-
import Promises
2019
import WebRTC
20+
import Promises
2121

2222
@objc
2323
public enum SubscriptionState: Int, Codable {

Sources/LiveKit/Support/AppStateListener.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
*/
1616

1717
import Foundation
18-
#if os(iOS)
18+
19+
#if canImport(UIKit)
1920
import UIKit
2021
#endif
2122

Sources/LiveKit/Support/NativeView.swift

+8-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@
1414
* limitations under the License.
1515
*/
1616

17-
#if os(iOS)
17+
import Foundation
18+
19+
#if canImport(UIKit)
1820
import UIKit
21+
#elseif canImport(AppKit)
22+
import AppKit
23+
#endif
24+
25+
#if os(iOS)
1926
public typealias NativeViewType = UIView
2027
#elseif os(macOS)
21-
// macOS
22-
import AppKit
2328
public typealias NativeViewType = NSView
2429
#endif
2530

Sources/LiveKit/Support/NativeViewRepresentable.swift

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,18 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import SwiftUI
1819

19-
#if os(iOS)
20+
#if canImport(UIKit)
2021
import UIKit
22+
#elseif canImport(AppKit)
23+
import AppKit
24+
#endif
25+
26+
#if os(iOS)
2127
public typealias NativeViewRepresentableType = UIViewRepresentable
2228
#elseif os(macOS)
23-
// macOS
24-
import AppKit
2529
public typealias NativeViewRepresentableType = NSViewRepresentable
2630
#endif
2731

Sources/LiveKit/Support/TextView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
import Foundation
1818

19-
#if os(iOS)
19+
#if canImport(UIKit)
2020
import UIKit
21-
#elseif os(macOS)
21+
#elseif canImport(AppKit)
2222
import AppKit
2323
#endif
2424

Sources/LiveKit/SwiftUI/ObservableParticipant.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import SwiftUI
1819
import WebRTC
1920

Sources/LiveKit/SwiftUI/ObservableRoom.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import SwiftUI
1819
import WebRTC
1920
import Promises

Sources/LiveKit/SwiftUI/SwiftUIVideoView.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import SwiftUI
1819

1920
/// This class receives ``TrackDelegate`` events since a struct can't be used for a delegate

Sources/LiveKit/Track/AudioTrack.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
1819

1920
@objc

Sources/LiveKit/Track/Capturers/CameraCapturer.swift

+3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
import Foundation
1818
import WebRTC
1919
import Promises
20+
21+
#if canImport(ReplayKit)
2022
import ReplayKit
23+
#endif
2124

2225
public class CameraCapturer: VideoCapturer {
2326

Sources/LiveKit/Track/Capturers/InAppCapturer.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
18-
import ReplayKit
1919
import Promises
2020

21+
#if canImport(ReplayKit)
22+
import ReplayKit
23+
#endif
24+
2125
@available(macOS 11.0, iOS 11.0, *)
2226
public class InAppScreenCapturer: VideoCapturer {
2327

Sources/LiveKit/Track/Capturers/MacOSScreenCapturer.swift

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import Foundation
1818
import WebRTC
19-
import ReplayKit
2019
import Promises
2120

2221
#if canImport(ScreenCaptureKit)

Sources/LiveKit/Track/Capturers/VideoCapturer.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
1819
import Promises
1920

Sources/LiveKit/Track/Local/LocalVideoTrack.swift

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import Foundation
1818
import WebRTC
1919
import Promises
20-
import ReplayKit
2120

2221
@objc
2322
public class LocalVideoTrack: Track, LocalTrack, VideoTrack {

Sources/LiveKit/Track/Remote/RemoteAudioTrack.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
1819
import Promises
1920

Sources/LiveKit/Track/Remote/RemoteVideoTrack.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
1819
import Promises
1920

Sources/LiveKit/Track/Support/Extensions.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
import WebRTC
17+
import Foundation
18+
import CoreImage
19+
20+
#if canImport(ReplayKit)
1821
import ReplayKit
22+
#endif
1923

2024
extension CIImage {
2125

Sources/LiveKit/Track/Track.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import Foundation
1718
import WebRTC
1819
import Promises
1920

0 commit comments

Comments
 (0)