Skip to content

Commit 3561365

Browse files
committed
chore: run swiftlint
1 parent 79669d3 commit 3561365

File tree

19 files changed

+243
-234
lines changed

19 files changed

+243
-234
lines changed

OneSignalSwiftUIExample/OneSignalSwiftUIExample/App/OneSignalSwiftUIExampleApp.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import OneSignalLocation
3434
struct OneSignalSwiftUIExampleApp: App {
3535
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
3636
@StateObject private var viewModel = OneSignalViewModel()
37-
37+
3838
var body: some Scene {
3939
WindowGroup {
4040
ContentView()
@@ -46,38 +46,38 @@ struct OneSignalSwiftUIExampleApp: App {
4646
// MARK: - App Delegate
4747

4848
class AppDelegate: NSObject, UIApplicationDelegate {
49-
49+
5050
func application(
5151
_ application: UIApplication,
5252
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
5353
) -> Bool {
5454
// Initialize OneSignal
5555
OneSignalService.shared.initialize(launchOptions: launchOptions)
56-
56+
5757
// Set up notification lifecycle listeners
5858
setupNotificationListeners()
59-
59+
6060
// Set up in-app message listeners
6161
setupInAppMessageListeners()
62-
62+
6363
return true
6464
}
65-
65+
6666
private func setupNotificationListeners() {
6767
// Foreground notification display
6868
OneSignal.Notifications.addForegroundLifecycleListener(NotificationLifecycleHandler.shared)
69-
69+
7070
// Notification click handling
7171
OneSignal.Notifications.addClickListener(NotificationClickHandler.shared)
7272
}
73-
73+
7474
private func setupInAppMessageListeners() {
7575
// In-app message lifecycle
7676
OneSignal.InAppMessages.addLifecycleListener(InAppMessageLifecycleHandler.shared)
77-
77+
7878
// In-app message click handling
7979
OneSignal.InAppMessages.addClickListener(InAppMessageClickHandler.shared)
80-
80+
8181
// Start with IAM paused
8282
OneSignal.InAppMessages.paused = true
8383
}
@@ -87,7 +87,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
8787

8888
class NotificationLifecycleHandler: NSObject, OSNotificationLifecycleListener {
8989
static let shared = NotificationLifecycleHandler()
90-
90+
9191
func onWillDisplay(event: OSNotificationWillDisplayEvent) {
9292
print("[OneSignal] Notification will display: \(event.notification.title ?? "No title")")
9393
// Optionally modify display behavior
@@ -98,7 +98,7 @@ class NotificationLifecycleHandler: NSObject, OSNotificationLifecycleListener {
9898

9999
class NotificationClickHandler: NSObject, OSNotificationClickListener {
100100
static let shared = NotificationClickHandler()
101-
101+
102102
func onClick(event: OSNotificationClickEvent) {
103103
print("[OneSignal] Notification clicked: \(event.notification.title ?? "No title")")
104104
// Handle notification click - navigate to specific screen, etc.
@@ -109,27 +109,27 @@ class NotificationClickHandler: NSObject, OSNotificationClickListener {
109109

110110
class InAppMessageLifecycleHandler: NSObject, OSInAppMessageLifecycleListener {
111111
static let shared = InAppMessageLifecycleHandler()
112-
112+
113113
func onWillDisplay(event: OSInAppMessageWillDisplayEvent) {
114114
print("[OneSignal] IAM will display: \(event.message.messageId)")
115115
}
116-
116+
117117
func onDidDisplay(event: OSInAppMessageDidDisplayEvent) {
118118
print("[OneSignal] IAM did display: \(event.message.messageId)")
119119
}
120-
120+
121121
func onWillDismiss(event: OSInAppMessageWillDismissEvent) {
122122
print("[OneSignal] IAM will dismiss: \(event.message.messageId)")
123123
}
124-
124+
125125
func onDidDismiss(event: OSInAppMessageDidDismissEvent) {
126126
print("[OneSignal] IAM did dismiss: \(event.message.messageId)")
127127
}
128128
}
129129

130130
class InAppMessageClickHandler: NSObject, OSInAppMessageClickListener {
131131
static let shared = InAppMessageClickHandler()
132-
132+
133133
func onClick(event: OSInAppMessageClickEvent) {
134134
print("[OneSignal] IAM clicked: \(event.result.actionId ?? "No action ID")")
135135
// Handle IAM click - navigate, track event, etc.

OneSignalSwiftUIExample/OneSignalSwiftUIExample/Models/AppModels.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ enum NotificationType: String, CaseIterable, Identifiable {
4848
case newPost = "New Post"
4949
case reEngagement = "Re-Engagement"
5050
case rating = "Rating"
51-
51+
5252
var id: String { rawValue }
53-
53+
5454
var iconName: String {
5555
switch self {
5656
case .general: return "bell.fill"
@@ -73,9 +73,9 @@ enum InAppMessageType: String, CaseIterable, Identifiable {
7373
case bottomBanner = "Bottom Banner"
7474
case centerModal = "Center Modal"
7575
case fullScreen = "Full Screen"
76-
76+
7777
var id: String { rawValue }
78-
78+
7979
var iconName: String {
8080
switch self {
8181
case .topBanner: return "rectangle.topthird.inset.filled"
@@ -96,7 +96,7 @@ enum AddItemType {
9696
case tag
9797
case trigger
9898
case externalUserId
99-
99+
100100
var title: String {
101101
switch self {
102102
case .alias: return "Add Alias"
@@ -107,14 +107,14 @@ enum AddItemType {
107107
case .externalUserId: return "Login User"
108108
}
109109
}
110-
110+
111111
var requiresKeyValue: Bool {
112112
switch self {
113113
case .alias, .tag, .trigger: return true
114114
case .email, .sms, .externalUserId: return false
115115
}
116116
}
117-
117+
118118
var keyPlaceholder: String {
119119
switch self {
120120
case .alias: return "Alias Label"
@@ -123,7 +123,7 @@ enum AddItemType {
123123
default: return "Key"
124124
}
125125
}
126-
126+
127127
var valuePlaceholder: String {
128128
switch self {
129129
case .alias: return "Alias ID"
@@ -134,7 +134,7 @@ enum AddItemType {
134134
case .externalUserId: return "External User ID"
135135
}
136136
}
137-
137+
138138
var keyboardType: UIKeyboardType {
139139
switch self {
140140
case .email: return .emailAddress

0 commit comments

Comments
 (0)