Skip to content

Commit b1e643c

Browse files
feat: rename files and classes for consistency
Renamed various files and classes to improve naming consistency across the project. Updated references in the README.md and source files to reflect these changes. This includes renaming classes like QueueITApiClient to ApiClient, QueueITWaitingRoomProvider to WaitingRoomProvider, and others.
1 parent 2d152b2 commit b1e643c

15 files changed

+83
-76
lines changed

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,29 +168,29 @@ When the user clicks back, the same check needs to be done.
168168

169169
### Getting the status of a waiting room
170170

171-
If you're using version ```3.1.14``` or newer, it's possible to get the state of the waiting room using the new ```QueueITWaitingRoomProvider``` with one of the following methods:
171+
If you're using version ```3.1.14``` or newer, it's possible to get the state of the waiting room using the new ```WaitingRoomProvider``` with one of the following methods:
172172

173173
* ```TryPass```
174174
* ```TryPassWithEnqueueToken```
175175
* ```TryPassWithEnqueueKey```
176176

177177
Calling one of the above methods will trigger either the ```notifyProviderSuccess``` callback on success, or ```notifyProviderFailure``` callback on failure.
178178

179-
When using the ```notifyProviderQueueITUnavailable``` from the ```ProviderSuccessDelegate``` it'll provide with a ```QueueTryPassResult``` depending on the ```isPassThrough``` result:
179+
When using the ```notifyProviderQueueITUnavailable``` from the ```ProviderSuccessDelegate``` it'll provide with a ```TryPassResult``` depending on the ```isPassThrough``` result:
180180

181-
* ```true``` means that the ```QueueItToken``` is *not* empty, and more information is available in the ```QueueTryPassResult```
182-
* ```false``` means that the waiting room is *active*. You can show the visitor the waiting room by calling ```show``` from the ```QueueITWaitingRoomView```, by providing a ```queueUrl``` and ```targetUrl``` *([Read more about it here](#showing-the-queue-page-to-visitors))*
181+
* ```true``` means that the ```QueueItToken``` is *not* empty, and more information is available in the ```TryPassResult```
182+
* ```false``` means that the waiting room is *active*. You can show the visitor the waiting room by calling ```show``` from the ```WaitingRoomView```, by providing a ```queueUrl``` and ```targetUrl``` *([Read more about it here](#showing-the-queue-page-to-visitors))*
183183

184184
### Showing the queue page to visitors
185185

186-
If you're using version ```3.1.14``` or newer, the ```QueueITWaitingRoomView``` class is available.
186+
If you're using version ```3.1.14``` or newer, the ```WaitingRoomView``` class is available.
187187

188-
When the waiting room is queueing visitors, each visitor has to visit it once. Using the ```show``` method you can do this, you have to provide the ```queueUrl```, and the ```targetUrl``` which is returned by the ```notifyProviderSuccess``` from ```QueueITWaitingRoomProvider``` class, given the waiting room is *active* ([Read more about it here](#getting-the-status-of-a-waiting-room))
188+
When the waiting room is queueing visitors, each visitor has to visit it once. Using the ```show``` method you can do this, you have to provide the ```queueUrl```, and the ```targetUrl``` which is returned by the ```notifyProviderSuccess``` from ```WaitingRoomProvider``` class, given the waiting room is *active* ([Read more about it here](#getting-the-status-of-a-waiting-room))
189189

190190

191191
#### Sample code showing the queue page:
192192
``` objc
193-
-(void)notifyProviderSuccess:(QueueTryPassResult* _Nonnull) queuePassResult {
193+
-(void)notifyProviderSuccess:(TryPassResult* _Nonnull) queuePassResult {
194194
[self.waitingRoomView show:queuePassResult.queueUrl targetUrl:queuePassResult.targetUrl];
195195
}
196196
```

Sources/QueueITLib/NewQueueITApiClient.swift renamed to Sources/QueueITLib/ApiClient.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import Foundation
33
typealias QueueServiceSuccess = (Data) -> Void
44
typealias QueueServiceFailure = (Error, String) -> Void
55

6-
class QueueITApiClient {
6+
class ApiClient {
77
static let API_ROOT = "https://%@.queue-it.net/api/mobileapp/queue"
88
static let TESTING_API_ROOT = "https://%@.test.queue-it.net/api/mobileapp/queue"
99
private static var testingIsEnabled = false
10-
private static var sharedInstance: QueueITApiClient?
10+
private static var sharedInstance: ApiClient?
1111

12-
static func getInstance() -> QueueITApiClient {
12+
static func getInstance() -> ApiClient {
1313
if sharedInstance == nil {
1414
sharedInstance = Connection()
1515
}
@@ -30,7 +30,7 @@ class QueueITApiClient {
3030
language: String?,
3131
enqueueToken: String?,
3232
enqueueKey: String?,
33-
success: @escaping (QueueStatus?) -> Void,
33+
success: @escaping (Status?) -> Void,
3434
failure: @escaping QueueServiceFailure
3535
) {
3636
var bodyDict: [String: Any] = [
@@ -55,7 +55,7 @@ class QueueITApiClient {
5555
bodyDict["enqueueKey"] = enqueueKey
5656
}
5757

58-
let apiRoot = QueueITApiClient.testingIsEnabled ? QueueITApiClient.TESTING_API_ROOT : QueueITApiClient.API_ROOT
58+
let apiRoot = ApiClient.testingIsEnabled ? ApiClient.TESTING_API_ROOT : ApiClient.API_ROOT
5959
var urlAsString = String(format: apiRoot, customerId)
6060
urlAsString += "/\(customerId)"
6161
urlAsString += "/\(eventOrAliasId)"
@@ -70,8 +70,8 @@ class QueueITApiClient {
7070
with: data,
7171
options: []
7272
) as? [String: Any] {
73-
let queueStatus = QueueStatus(dictionary: userDict)
74-
success(queueStatus)
73+
let Status = Status(dictionary: userDict)
74+
success(Status)
7575
} else {
7676
success(nil)
7777
}
@@ -91,7 +91,7 @@ class QueueITApiClient {
9191
) {
9292
guard let url = URL(string: path) else {
9393
let error = NSError(
94-
domain: "QueueITApiClient",
94+
domain: "ApiClient",
9595
code: -1,
9696
userInfo: [NSLocalizedDescriptionKey: "Invalid URL"]
9797
)

Sources/QueueITLib/NewConnection.swift renamed to Sources/QueueITLib/Connection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
final class Connection: QueueITApiClient {
3+
final class Connection: ApiClient {
44
private var connectionRequest: ConnectionRequest?
55

66
override func submitRequest(
File renamed without changes.

Sources/QueueITLib/NewQueueConsts.swift renamed to Sources/QueueITLib/Constants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
enum QueueConsts {
1+
enum Constants {
22
static let queueCloseUrl = "queueit://close"
33
static let queueRestartSessionUrl = "queueit://restartSession"
44
static let sdkVersion = "iOS-3.4.4"

Sources/QueueITLib/NewQueueITEngine.swift renamed to Sources/QueueITLib/QueueITEngine.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ public final class QueueItEngine {
5353
public weak var queueViewDidAppearDelegate: QueueViewDidAppearDelegate?
5454

5555
public weak var host: UIViewController?
56-
private var waitingRoomProvider: QueueITWaitingRoomProvider
57-
private var waitingRoomView: QueueITWaitingRoomView
56+
private var waitingRoomProvider: WaitingRoomProvider
57+
private var waitingRoomView: WaitingRoomView
5858

5959
public init(host: UIViewController, customerId: String, eventOrAliasId: String, layoutName: String?, language: String?) {
6060
self.host = host
6161

62-
waitingRoomProvider = QueueITWaitingRoomProvider(
62+
waitingRoomProvider = WaitingRoomProvider(
6363
customerId: customerId,
6464
eventOrAliasId: eventOrAliasId,
6565
layoutName: layoutName,
6666
language: language
6767
)
68-
waitingRoomView = QueueITWaitingRoomView(host: host, eventId: eventOrAliasId)
68+
waitingRoomView = WaitingRoomView(host: host, eventId: eventOrAliasId)
6969
waitingRoomView.delegate = self
7070
waitingRoomProvider.delegate = self
7171
}
@@ -95,7 +95,7 @@ public final class QueueItEngine {
9595
}
9696
}
9797

98-
extension QueueItEngine: QueueITWaitingRoomViewDelegate {
98+
extension QueueItEngine: WaitingRoomViewDelegate {
9999
func notifyViewUserExited() {
100100
queueUserExitedDelegate?.notifyUserExited()
101101
}
@@ -126,8 +126,8 @@ extension QueueItEngine: QueueITWaitingRoomViewDelegate {
126126
}
127127
}
128128

129-
extension QueueItEngine: QueueITWaitingRoomProviderDelegate {
130-
func notifyProviderSuccess(queuePassResult: QueueTryPassResult) {
129+
extension QueueItEngine: WaitingRoomProviderDelegate {
130+
func notifyProviderSuccess(queuePassResult: TryPassResult) {
131131
switch queuePassResult.redirectType {
132132
case "safetynet":
133133
let queuePassedInfo = QueuePassedInfo(queueitToken: queuePassResult.queueToken)
File renamed without changes.

Sources/QueueITLib/NewQueueITReachability.swift renamed to Sources/QueueITLib/Reachability.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,33 @@ extension Notification.Name {
77
static let reachabilityChanged = Notification.Name("kNetworkReachabilityChangedNotification")
88
}
99

10-
final class QueueITReachability {
10+
final class Reachability {
1111
private var monitor: NWPathMonitor?
1212
private var isMonitoringLocalWiFi: Bool = false
1313
private var queue = DispatchQueue.global(qos: .background)
1414

1515
private init() {}
1616

17-
static func reachabilityWithHostName(_ hostName: String) -> QueueITReachability {
18-
let reachability = QueueITReachability()
17+
static func reachabilityWithHostName(_ hostName: String) -> Reachability {
18+
let reachability = Reachability()
1919
reachability.startMonitoringHost(hostName: hostName)
2020
return reachability
2121
}
2222

23-
static func reachabilityWithAddress(_ hostAddress: sockaddr_in) -> QueueITReachability {
24-
let reachability = QueueITReachability()
23+
static func reachabilityWithAddress(_ hostAddress: sockaddr_in) -> Reachability {
24+
let reachability = Reachability()
2525
reachability.startMonitoringIP(address: hostAddress)
2626
return reachability
2727
}
2828

29-
static func reachabilityForInternetConnection() -> QueueITReachability {
30-
let reachability = QueueITReachability()
29+
static func reachabilityForInternetConnection() -> Reachability {
30+
let reachability = Reachability()
3131
reachability.startMonitoringInternet()
3232
return reachability
3333
}
3434

35-
static func reachabilityForLocalWiFi() -> QueueITReachability {
36-
let reachability = QueueITReachability()
35+
static func reachabilityForLocalWiFi() -> Reachability {
36+
let reachability = Reachability()
3737
reachability.startMonitoringWiFi()
3838
return reachability
3939
}
@@ -74,15 +74,15 @@ final class QueueITReachability {
7474
}
7575
}
7676

77-
extension QueueITReachability {
77+
extension Reachability {
7878
enum NetworkStatus: Int {
7979
case notReachable = 0
8080
case reachableViaWiFi
8181
case reachableViaWWAN
8282
}
8383
}
8484

85-
private extension QueueITReachability {
85+
private extension Reachability {
8686
func startMonitoringHost(hostName _: String) {
8787
monitor = NWPathMonitor(requiredInterfaceType: .other)
8888
monitor?.pathUpdateHandler = { _ in

Sources/QueueITLib/NewQueueStatus.swift renamed to Sources/QueueITLib/Status.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
struct QueueStatus {
1+
struct Status {
22
let queueId: String
33
let queueUrlString: String
44
let eventTargetUrl: String
@@ -21,7 +21,7 @@ struct QueueStatus {
2121
}
2222
}
2323

24-
private extension QueueStatus {
24+
private extension Status {
2525
enum Constants {
2626
static let KEY_QUEUE_ID = "QueueId"
2727
static let KEY_QUEUE_URL = "QueueUrl"

0 commit comments

Comments
 (0)