Skip to content

Example App fixups #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Examples/apps/BasicExample/BasicExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
//

import UIKit
import Segment

class ViewController: UIViewController {
var analytics = UIApplication.shared.delegate?.analytics
var analytics: Analytics? {
return UIApplication.shared.delegate?.analytics
}

var usage: TimeInterval = 0
var timer: Timer? = nil
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "469F7B03266011690038E773"
BuildableName = "DestinationsExample.app"
BlueprintName = "DestinationsExample"
ReferencedContainer = "container:DestinationsExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "469F7B03266011690038E773"
BuildableName = "DestinationsExample.app"
BlueprintName = "DestinationsExample"
ReferencedContainer = "container:DestinationsExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "469F7B03266011690038E773"
BuildableName = "DestinationsExample.app"
BlueprintName = "DestinationsExample"
ReferencedContainer = "container:DestinationsExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class ViewController: UIViewController {
@IBOutlet weak var propertiesStepper: UIStepper?
@IBOutlet weak var eventField: UITextField?

var analytics = UIApplication.shared.delegate?.analytics
var analytics: Analytics? {
return UIApplication.shared.delegate?.analytics
}

private var keysFields = [UITextField]()
private var propertiesFields = [UITextField]()
Expand Down
12 changes: 8 additions & 4 deletions Examples/apps/MacExample/MacExample/MacExample.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
</plist>
5 changes: 4 additions & 1 deletion Examples/apps/MacExample/MacExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
//

import Cocoa
import Segment

class ViewController: NSViewController {
var analytics = NSApplication.shared.delegate?.analytics
var analytics: Analytics? {
return NSApplication.shared.delegate?.analytics
}

override func viewDidLoad() {
super.viewDidLoad()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ExtensionDelegate: NSObject, WKExtensionDelegate {

func applicationDidFinishLaunching() {
// Perform any final initialization of your application.
let configuration = Configuration(writeKey: "lAtKCqFrmtnhIVV7LDPTrgoCbL0ujlBe")
let configuration = Configuration(writeKey: "WRITE KEY")
.trackApplicationLifecycleEvents(true)
.flushInterval(10)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import Segment


class InterfaceController: WKInterfaceController {
var analytics = WKExtension.shared().delegate?.analytics
var analytics: Analytics? {
return WKExtension.shared().delegate?.analytics
}

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