Skip to content

Commit ad44776

Browse files
Merge pull request #21 from prolificinteractive/chore/missing_documentation
[Chore] Missing Documentation
2 parents 2cd13a7 + 93d4a7c commit ad44776

File tree

7 files changed

+90
-20
lines changed

7 files changed

+90
-20
lines changed

Simcoe/Adobe/Adobe.swift

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,49 @@ import CoreLocation
1212
/// The adobe analytics provider.
1313
public class Adobe {
1414

15+
/// The name of the tracker.
1516
public let name = "Adobe Omniture"
1617

18+
/// The default initializer.
1719
public init() { }
1820

21+
/// Starts tracking analytics.
1922
public func start() {
2023
ADBMobile.collectLifecycleData()
2124
}
2225

2326
}
2427

25-
extension Adobe: PageViewTracking {
26-
27-
public func trackPageView(pageView: String, withAdditionalProperties properties: Properties?) -> TrackingResult {
28-
ADBMobile.trackState(pageView, data: properties)
29-
return .Success
30-
}
31-
32-
}
28+
// MARK: - EventTracking
3329

3430
extension Adobe: EventTracking {
3531

32+
/// Tracks the given event with optional additional properties.
33+
///
34+
/// - Parameters:
35+
/// - event: The event to track.
36+
/// - properties: The optional additional properties.
37+
/// - Returns: A tracking result.
3638
public func trackEvent(event: String, withAdditionalProperties properties: Properties?) -> TrackingResult {
3739
ADBMobile.trackAction(event, data: properties)
3840
return .Success
3941
}
40-
42+
4143
}
4244

45+
// MARK: - LifetimeValueIncreasing
46+
4347
extension Adobe: LifetimeValueIncreasing {
4448

49+
/**
50+
Increases the lifetime value of the key by the specified amount.
51+
52+
- parameter amount: The amount to increase that lifetime value for.
53+
- parameter item: The optional item to extend.
54+
- parameter properties: The optional additional properties.
55+
56+
- returns: A tracking result.
57+
*/
4558
public func increaseLifetimeValue(byAmount amount: Double, forItem item: String?, withAdditionalProperties properties: Properties?) -> TrackingResult {
4659
var data = properties ?? [String: AnyObject]()
4760
if let item = item {
@@ -54,12 +67,40 @@ extension Adobe: LifetimeValueIncreasing {
5467

5568
}
5669

70+
// MARK: - LocationTracking
71+
5772
extension Adobe: LocationTracking {
5873

74+
/**
75+
Tracks location.
76+
77+
- parameter location: The location to track.
78+
- parameter properties: The optional additional properties.
79+
80+
- returns: A tracking result.
81+
*/
5982
public func trackLocation(location: CLLocation,
60-
withAdditionalProperties properties: [String: AnyObject]?) -> TrackingResult {
61-
ADBMobile.trackLocation(location, data: properties)
62-
return .Success
83+
withAdditionalProperties properties: [String: AnyObject]?) -> TrackingResult {
84+
ADBMobile.trackLocation(location, data: properties)
85+
return .Success
86+
}
87+
88+
}
89+
90+
// MARK: - PageViewTracking
91+
92+
extension Adobe: PageViewTracking {
93+
94+
/**
95+
Tracks the page view.
96+
97+
- parameter pageView: The page view to track.
98+
99+
- returns: A tracking result.
100+
*/
101+
public func trackPageView(pageView: String, withAdditionalProperties properties: Properties?) -> TrackingResult {
102+
ADBMobile.trackState(pageView, data: properties)
103+
return .Success
63104
}
64105

65106
}

Simcoe/Analytics Tracking Protocols/EventTracking.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111
*/
1212
public protocol EventTracking: AnalyticsTracking {
1313

14-
/**
15-
Tracks the given event with optional additional properties.
16-
17-
- parameter event: The event to tack.
18-
- parameter properties: The optional additional properties.
19-
20-
- returns: A tracking result.
21-
*/
14+
/// Tracks the given event with optional additional properties.
15+
///
16+
/// - Parameters:
17+
/// - event: The event to track.
18+
/// - properties: The optional additional properties.
19+
/// - Returns: A tracking result.
2220
func trackEvent(event: String, withAdditionalProperties properties: Properties?) -> TrackingResult
2321

2422
}

Simcoe/EmptyProvider.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88

99
import CoreLocation
1010

11+
/// The empty provider.
1112
internal final class EmptyProvider {
1213

14+
/// The name of the tracker.
1315
let name = "Analytics"
1416

1517
}

Simcoe/Properties.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
//
77
//
88

9+
/// The properties.
910
public typealias Properties = [String: AnyObject]

Simcoe/RemoteOutput.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Foundation
1313
*/
1414
internal struct RemoteOutput: Output {
1515

16+
/// The token.
1617
let token: String
1718

1819
private let baseUrl = NSURL(string: "https://panalytics.herokuapp.com/")!
@@ -21,12 +22,18 @@ internal struct RemoteOutput: Output {
2122
return NSURL(string: token, relativeToURL: baseUrl)!
2223
}
2324

25+
/// The default initializer.
26+
///
27+
/// - Parameter token: The token.
2428
init(token: String) {
2529
self.token = token
2630

2731
Swift.print ("Simcoe now logging remotely to URL: \(url.absoluteString)")
2832
}
2933

34+
/// Prints a message.
35+
///
36+
/// - Parameter message: The message.
3037
func print(message: String) {
3138
let request = NSMutableURLRequest(URL: url)
3239
request.HTTPMethod = "POST"

Simcoe/WriteEvent.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
// Copyright © 2016 Prolific Interactive. All rights reserved.
77
//
88

9+
/// The write event.
910
internal struct WriteEvent {
1011

12+
/// The provider
1113
let provider: AnalyticsTracking
14+
15+
/// The tracking result.
1216
let trackingResult: TrackingResult
1317

1418
}

Simcoe/mParticle/mParticle.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class mParticle {
1313

1414
private static let unknownErrorMessage = "An unknown error occurred."
1515

16+
/// The name of the tracker.
1617
public let name = "mParticle"
1718

1819
/**
@@ -175,6 +176,15 @@ extension mParticle: EventTracking {
175176

176177
extension mParticle: LifetimeValueIncreasing {
177178

179+
/**
180+
Increases the lifetime value of the key by the specified amount.
181+
182+
- parameter amount: The amount to increase that lifetime value for.
183+
- parameter item: The optional item to extend.
184+
- parameter properties: The optional additional properties.
185+
186+
- returns: A tracking result.
187+
*/
178188
public func increaseLifetimeValue(byAmount amount: Double, forItem item: String?,
179189
withAdditionalProperties properties: Properties?) -> TrackingResult {
180190
MParticle.sharedInstance().logLTVIncrease(amount, eventName: (item ?? ""), eventInfo: properties)
@@ -227,6 +237,13 @@ extension mParticle: LocationTracking {
227237

228238
extension mParticle: PageViewTracking {
229239

240+
/**
241+
Tracks the page view.
242+
243+
- parameter pageView: The page view to track.
244+
245+
- returns: A tracking result.
246+
*/
230247
public func trackPageView(pageView: String, withAdditionalProperties properties: Properties?) -> TrackingResult {
231248
MParticle.sharedInstance().logScreen(pageView, eventInfo: properties)
232249

0 commit comments

Comments
 (0)