Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Camji55 committed May 30, 2023
1 parent 35a9f35 commit 61b9c59
Show file tree
Hide file tree
Showing 22 changed files with 1,800 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Common/LocalizedString.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// LocalizedString.swift
// MixpanelServiceKitPlugin
//
// Created by Cameron Ingham on 5/29/23.
//

import Foundation

private class FrameworkBundle {
static let main = Bundle(for: FrameworkBundle.self)
}

func LocalizedString(_ key: String, tableName: String? = nil, value: String? = nil, comment: String) -> String {
if let value = value {
return NSLocalizedString(key, tableName: tableName, bundle: FrameworkBundle.main, value: value, comment: comment)
} else {
return NSLocalizedString(key, tableName: tableName, bundle: FrameworkBundle.main, comment: comment)
}
}
51 changes: 51 additions & 0 deletions Extentions/OSLog.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// OSLog.swift
// MixpanelServiceKitPlugin
//
// Created by Cameron Ingham on 5/29/23.
//

import os.log

extension OSLog {

convenience init(category: String) {
self.init(subsystem: "com.loopkit.MixpanelService", category: category)
}

func debug(_ message: StaticString, _ args: CVarArg...) {
log(message, type: .debug, args)
}

func info(_ message: StaticString, _ args: CVarArg...) {
log(message, type: .info, args)
}

func `default`(_ message: StaticString, _ args: CVarArg...) {
log(message, type: .default, args)
}

func error(_ message: StaticString, _ args: CVarArg...) {
log(message, type: .error, args)
}

private func log(_ message: StaticString, type: OSLogType, _ args: [CVarArg]) {
switch args.count {
case 0:
os_log(message, log: self, type: type)
case 1:
os_log(message, log: self, type: type, args[0])
case 2:
os_log(message, log: self, type: type, args[0], args[1])
case 3:
os_log(message, log: self, type: type, args[0], args[1], args[2])
case 4:
os_log(message, log: self, type: type, args[0], args[1], args[2], args[3])
case 5:
os_log(message, log: self, type: type, args[0], args[1], args[2], args[3], args[4])
default:
os_log(message, log: self, type: type, args)
}
}

}
951 changes: 951 additions & 0 deletions MixpanelService.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "mixpanel-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mixpanel/mixpanel-swift.git",
"state" : {
"branch" : "master",
"revision" : "9b5738fb2ed8d3311ee0b4dc284483ad9d789698"
}
}
],
"version" : 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "84F28B1A2A25CB350080127C"
BuildableName = "MixpanelServiceKit.framework"
BlueprintName = "MixpanelServiceKit"
ReferencedContainer = "container:MixpanelService.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</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">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "84F28B1A2A25CB350080127C"
BuildableName = "MixpanelServiceKit.framework"
BlueprintName = "MixpanelServiceKit"
ReferencedContainer = "container:MixpanelService.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "849523B52A25DCD3003AC2FD"
BuildableName = "MixpanelServiceKitPlugin.loopplugin"
BlueprintName = "MixpanelServiceKitPlugin"
ReferencedContainer = "container:MixpanelService.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</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">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "849523B52A25DCD3003AC2FD"
BuildableName = "MixpanelServiceKitPlugin.loopplugin"
BlueprintName = "MixpanelServiceKitPlugin"
ReferencedContainer = "container:MixpanelService.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "84F28B272A25CB600080127C"
BuildableName = "MixpanelServiceKitUI.framework"
BlueprintName = "MixpanelServiceKitUI"
ReferencedContainer = "container:MixpanelService.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</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">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "84F28B272A25CB600080127C"
BuildableName = "MixpanelServiceKitUI.framework"
BlueprintName = "MixpanelServiceKitUI"
ReferencedContainer = "container:MixpanelService.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>MixpanelServiceKit.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>38</integer>
</dict>
<key>MixpanelServiceKitPlugin.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>40</integer>
</dict>
<key>MixpanelServiceKitUI.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>39</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>849523B52A25DCD3003AC2FD</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>84F28B1A2A25CB350080127C</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>84F28B272A25CB600080127C</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>84F28B332A25CB7D0080127C</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
2 changes: 2 additions & 0 deletions MixpanelServiceKit/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* The title of the Mixpanel service */
"Mixpanel" = "Mixpanel";
Loading

0 comments on commit 61b9c59

Please sign in to comment.