Skip to content

Commit 19460c3

Browse files
bsneedBrandon Sneed
andauthored
Example App fixups (#49)
* Correct some errors in mac sample * Corrected some errors in destination example * Corrected errors in watchos example Co-authored-by: Brandon Sneed <[email protected]>
1 parent c60d6f2 commit 19460c3

File tree

7 files changed

+101
-9
lines changed

7 files changed

+101
-9
lines changed

Examples/apps/BasicExample/BasicExample/ViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
//
77

88
import UIKit
9+
import Segment
910

1011
class ViewController: UIViewController {
11-
var analytics = UIApplication.shared.delegate?.analytics
12+
var analytics: Analytics? {
13+
return UIApplication.shared.delegate?.analytics
14+
}
1215

1316
var usage: TimeInterval = 0
1417
var timer: Timer? = nil
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1250"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "469F7B03266011690038E773"
18+
BuildableName = "DestinationsExample.app"
19+
BlueprintName = "DestinationsExample"
20+
ReferencedContainer = "container:DestinationsExample.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "469F7B03266011690038E773"
48+
BuildableName = "DestinationsExample.app"
49+
BlueprintName = "DestinationsExample"
50+
ReferencedContainer = "container:DestinationsExample.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "469F7B03266011690038E773"
65+
BuildableName = "DestinationsExample.app"
66+
BlueprintName = "DestinationsExample"
67+
ReferencedContainer = "container:DestinationsExample.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>

Examples/apps/DestinationsExample/DestinationsExample/ViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ class ViewController: UIViewController {
4040
@IBOutlet weak var propertiesStepper: UIStepper?
4141
@IBOutlet weak var eventField: UITextField?
4242

43-
var analytics = UIApplication.shared.delegate?.analytics
43+
var analytics: Analytics? {
44+
return UIApplication.shared.delegate?.analytics
45+
}
4446

4547
private var keysFields = [UITextField]()
4648
private var propertiesFields = [UITextField]()

Examples/apps/MacExample/MacExample/MacExample.entitlements

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>com.apple.security.app-sandbox</key>
6-
<true/>
7-
<key>com.apple.security.files.user-selected.read-only</key>
8-
<true/>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.files.user-selected.read-only</key>
8+
<true/>
9+
<key>com.apple.security.network.client</key>
10+
<true/>
11+
<key>com.apple.security.network.server</key>
12+
<true/>
913
</dict>
1014
</plist>

Examples/apps/MacExample/MacExample/ViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
//
77

88
import Cocoa
9+
import Segment
910

1011
class ViewController: NSViewController {
11-
var analytics = NSApplication.shared.delegate?.analytics
12+
var analytics: Analytics? {
13+
return NSApplication.shared.delegate?.analytics
14+
}
1215

1316
override func viewDidLoad() {
1417
super.viewDidLoad()

Examples/apps/watchOSExample/watchOSExample WatchKit Extension/ExtensionDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ExtensionDelegate: NSObject, WKExtensionDelegate {
1313

1414
func applicationDidFinishLaunching() {
1515
// Perform any final initialization of your application.
16-
let configuration = Configuration(writeKey: "lAtKCqFrmtnhIVV7LDPTrgoCbL0ujlBe")
16+
let configuration = Configuration(writeKey: "WRITE KEY")
1717
.trackApplicationLifecycleEvents(true)
1818
.flushInterval(10)
1919

Examples/apps/watchOSExample/watchOSExample WatchKit Extension/InterfaceController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import Segment
1111

1212

1313
class InterfaceController: WKInterfaceController {
14-
var analytics = WKExtension.shared().delegate?.analytics
14+
var analytics: Analytics? {
15+
return WKExtension.shared().delegate?.analytics
16+
}
1517

1618
override func awake(withContext context: Any?) {
1719
// Configure interface objects here.

0 commit comments

Comments
 (0)