Skip to content

Commit 18a1a3f

Browse files
committed
rename UserReportUser / UserReportSettings class
1 parent a7a0b8d commit 18a1a3f

File tree

12 files changed

+39
-39
lines changed

12 files changed

+39
-39
lines changed

Example/Example/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1212

1313
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1414

15-
let settings = Settings()
15+
let settings = UserReportSettings()
1616
settings.sessionScreensView = 14
1717

1818
// Initialize UserReport SDK
19-
let user = User()
19+
let user = UserReportUser()
2020
user.email = "[email protected]"
2121
UserReport.configure(sakId: "audienceproject", mediaId: "3402b774-b7a8-448c-997a-ef6cd59efc41", user: user, settings: settings)
2222

Example_Objective-C/Example_Objective-C/AppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ @implementation AppDelegate
1515
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
1616

1717
// Initialize UserReport SDK
18-
User *user = [[User alloc] init];
18+
UserReportUser *user = [[UserReportUser alloc] init];
1919
[user setEmail:@"[email protected]"];
2020
[UserReport configureWithSakId:@"audienceproject" mediaId:@"3402b774-b7a8-448c-997a-ef6cd59efc41" user:user settings:nil];
2121
return YES;

Example_Objective-C/Example_Objective-C/ViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ - (void)updateSessionInfo {
7676
}
7777

7878
// Get current settings for appear survey
79-
Settings *settings = session.settings;
79+
UserReportSettings *settings = session.settings;
8080
if (settings) {
8181
self.expectedTotalScreensLabel.text = [NSString stringWithFormat:@"%li screens", settings.inviteAfterTotalScreensViewed];
8282
self.expectedSessionScreensLabel.text = [NSString stringWithFormat:@"%li screens", settings.sessionScreensView];

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Your `SAK_ID` and `MEDIA_ID` can be found on the Media Setting page in UserRepor
9696
9797
```swift
9898
// Create user object (optional)
99-
let user = User()
99+
let user = UserReportUser()
100100
user.email = "[email protected]"
101101
102102
// You can also specify a email hash
@@ -109,7 +109,7 @@ user.facebookId = "FACEBOOK_ID"
109109
110110
//It is possible to override the default rules for when a survey will appear.
111111
//However, the settings parameter is optional.
112-
let settings = Settings()
112+
let settings = UserReportSettings()
113113
settings.sessionScreensView = 5
114114
settings.inviteAfterNSecondsInApp = 20
115115
@@ -132,9 +132,9 @@ UserReport.setDisplayMode(.fullscreen)
132132
133133
### Change settings
134134
To update the default rules for appear the survey use follow:
135-
Though, it is recommended to pass `Settings` to configure method instead, use this method only when you want to change rules for already launched app
135+
Though, it is recommended to pass `UserReportSettings` to configure method instead, use this method only when you want to change rules for already launched app
136136
```swift
137-
let settings = Settings()
137+
let settings = UserReportSettings()
138138
settings.sessionScreensView = 5
139139
settings.inviteAfterNSecondsInApp = 20
140140
@@ -154,7 +154,7 @@ UserReport.mute = true
154154
When changing user data, you should also send the updated data to the UserReport iOS SDK.
155155
156156
```swift
157-
let user = User()
157+
let user = UserReportUser()
158158
user.email = "[email protected]"
159159
160160
UserReport.updateUser(user)

UserReport.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "UserReport"
19-
s.version = "1.1.0"
19+
s.version = "1.2.0"
2020
s.summary = "UserReport SDK for iOS."
2121

2222
# This description is used to generate tags and improve search results.

UserReport/UserReport/Models/Info.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal struct Info {
1818
var mediaSettings: MediaSettings?
1919

2020
/// Information about the current user
21-
var user: User!
21+
var user: UserReportUser!
2222

2323
/// Information about the current device
2424
var device: Device
@@ -33,7 +33,7 @@ internal struct Info {
3333
*
3434
* - returns: The new `Info` instance.
3535
*/
36-
init(media: Media, user: User) {
36+
init(media: Media, user: UserReportUser) {
3737
self.media = media
3838
self.user = user
3939
self.device = Device()

UserReport/UserReport/Models/MediaSettings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal struct MediaSettings {
1616
var kitTcode: String?
1717

1818
/// Rules after which the survey will be displayed on the screen
19-
var settings: Settings = Settings()
19+
var settings: UserReportSettings = UserReportSettings()
2020

2121
var sections: Dictionary<String, String>?
2222
}

UserReport/UserReport/Models/Settings.swift renamed to UserReport/UserReport/Models/UserReportSettings.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import UIKit
77
/**
88
* A set of rules after which the survey will be displayed on the screen
99
*/
10-
public class Settings: NSObject {
10+
public class UserReportSettings: NSObject {
1111

1212
private var _localQuarantineDays : Int?
1313

1414
/// Number of days through which the survey will be appear again
1515
@objc public var localQuarantineDays: Int {
1616
get {
17-
return _localQuarantineDays ?? Settings.defaultInstance?._localQuarantineDays ?? 7
17+
return _localQuarantineDays ?? UserReportSettings.defaultInstance?._localQuarantineDays ?? 7
1818
}
1919
set {
2020
_localQuarantineDays = newValue
@@ -26,7 +26,7 @@ public class Settings: NSObject {
2626
/// Number of seconds need to spent in the application for all time
2727
@objc public var inviteAfterNSecondsInApp: TimeInterval {
2828
get {
29-
return _inviteAfterNSecondsInApp ?? Settings.defaultInstance?._inviteAfterNSecondsInApp ?? 60
29+
return _inviteAfterNSecondsInApp ?? UserReportSettings.defaultInstance?._inviteAfterNSecondsInApp ?? 60
3030
}
3131
set {
3232
_inviteAfterNSecondsInApp = newValue
@@ -38,7 +38,7 @@ public class Settings: NSObject {
3838
/// Number of screens need to view at in all session
3939
@objc public var inviteAfterTotalScreensViewed: Int {
4040
get {
41-
return _inviteAfterTotalScreensViewed ?? Settings.defaultInstance?._inviteAfterTotalScreensViewed ?? 5
41+
return _inviteAfterTotalScreensViewed ?? UserReportSettings.defaultInstance?._inviteAfterTotalScreensViewed ?? 5
4242
}
4343
set {
4444
_inviteAfterTotalScreensViewed = newValue
@@ -50,7 +50,7 @@ public class Settings: NSObject {
5050
/// Number of screens need to view at in current session
5151
@objc public var sessionScreensView: Int {
5252
get {
53-
return _sessionScreensView ?? Settings.defaultInstance?._sessionScreensView ?? 3
53+
return _sessionScreensView ?? UserReportSettings.defaultInstance?._sessionScreensView ?? 3
5454
}
5555
set {
5656
_sessionScreensView = newValue
@@ -62,14 +62,14 @@ public class Settings: NSObject {
6262
/// Number of seconds need to spent in the application for current session
6363
@objc public var sessionNSecondsLength: TimeInterval {
6464
get {
65-
return _sessionNSecondsLength ?? Settings.defaultInstance?._sessionNSecondsLength as TimeInterval? ?? 3
65+
return _sessionNSecondsLength ?? UserReportSettings.defaultInstance?._sessionNSecondsLength as TimeInterval? ?? 3
6666
}
6767
set {
6868
_sessionNSecondsLength = newValue
6969
}
7070
}
7171

7272
/// Settings that came from the server
73-
internal static var defaultInstance: Settings?
73+
internal static var defaultInstance: UserReportSettings?
7474

7575
}

UserReport/UserReport/Models/User.swift renamed to UserReport/UserReport/Models/UserReportUser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Foundation
66
import AdSupport
77

88
/// Model describing user
9-
public class User: NSObject {
9+
public class UserReportUser: NSObject {
1010

1111
// MARK: - Property
1212

UserReport/UserReport/Session/Session.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class Session: NSObject {
2020
internal var rulesPassed: SessionRulesPassedHandler?
2121

2222
/// Settings used for the current session
23-
@objc public private(set) var settings: Settings?
23+
@objc public private(set) var settings: UserReportSettings?
2424

2525
/// Number of screen viewed in current session
2626
@objc public private(set) var screenView: Int = 0
@@ -67,7 +67,7 @@ public class Session: NSObject {
6767
*
6868
* - returns: The new `Session` instance.
6969
*/
70-
internal convenience init(settings: Settings? = nil, rulesPassed: @escaping SessionRulesPassedHandler) {
70+
internal convenience init(settings: UserReportSettings? = nil, rulesPassed: @escaping SessionRulesPassedHandler) {
7171
self.init()
7272

7373
// DI
@@ -110,7 +110,7 @@ public class Session: NSObject {
110110
/**
111111
* Set new settings.
112112
*/
113-
internal func updateSettings(_ settings: Settings) {
113+
internal func updateSettings(_ settings: UserReportSettings) {
114114
self.settings = settings
115115
self.validate()
116116
}

0 commit comments

Comments
 (0)