Skip to content

Commit e949535

Browse files
authored
Merge pull request #10 from mulot/developpement
Developpement
2 parents 68384d2 + 4da41b9 commit e949535

31 files changed

+1246
-153
lines changed

BeatTime.xcodeproj/project.pbxproj

Lines changed: 71 additions & 38 deletions
Large diffs are not rendered by default.

BeatTime.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BeatTime.xcodeproj/xcshareddata/xcschemes/BeatTime.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1410"
3+
LastUpgradeVersion = "1500"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

BeatTime.xcodeproj/xcshareddata/xcschemes/BeatTimeTvOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1410"
3+
LastUpgradeVersion = "1500"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

BeatTime.xcodeproj/xcshareddata/xcschemes/BeatTimeWatchOS WatchKit App (Complication).xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1410"
3+
LastUpgradeVersion = "1500"
44
version = "2.0">
55
<BuildAction
66
parallelizeBuildables = "YES"

BeatTime.xcodeproj/xcshareddata/xcschemes/BeatTimeWatchOS WatchKit App (Notification).xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1410"
3+
LastUpgradeVersion = "1500"
44
version = "2.0">
55
<BuildAction
66
parallelizeBuildables = "YES"

BeatTime.xcodeproj/xcshareddata/xcschemes/BeatTimeWatchOS WatchKit App.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1410"
3+
LastUpgradeVersion = "1500"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

BeatTime.xcodeproj/xcshareddata/xcschemes/BeatTimeWatchOS WatchKit Extension.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1410"
3+
LastUpgradeVersion = "1500"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

BeatTime.xcodeproj/xcshareddata/xcschemes/BeatTimeWidgetExtension.xcscheme

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1410"
3+
LastUpgradeVersion = "1500"
44
wasCreatedForAppExtension = "YES"
55
version = "2.0">
66
<BuildAction
@@ -57,16 +57,27 @@
5757
debugServiceExtension = "internal"
5858
allowLocationSimulation = "YES"
5959
launchAutomaticallySubstyle = "2">
60-
<BuildableProductRunnable
61-
runnableDebuggingMode = "0">
60+
<RemoteRunnable
61+
runnableDebuggingMode = "1"
62+
BundleIdentifier = "com.apple.widgetkit.simulator"
63+
RemotePath = "/System/Library/CoreServices/WidgetKit Simulator.app/Contents/MacOS/WidgetKit Simulator">
64+
<BuildableReference
65+
BuildableIdentifier = "primary"
66+
BlueprintIdentifier = "9476F3242639D65A006FBF66"
67+
BuildableName = "BeatTimeWidgetExtension.appex"
68+
BlueprintName = "BeatTimeWidgetExtension"
69+
ReferencedContainer = "container:BeatTime.xcodeproj">
70+
</BuildableReference>
71+
</RemoteRunnable>
72+
<MacroExpansion>
6273
<BuildableReference
6374
BuildableIdentifier = "primary"
6475
BlueprintIdentifier = "94DA1E842634757300F83E86"
6576
BuildableName = "BeatTime.app"
6677
BlueprintName = "BeatTime"
6778
ReferencedContainer = "container:BeatTime.xcodeproj">
6879
</BuildableReference>
69-
</BuildableProductRunnable>
80+
</MacroExpansion>
7081
<EnvironmentVariables>
7182
<EnvironmentVariable
7283
key = "_XCWidgetKind"
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1500"
4+
wasCreatedForAppExtension = "YES"
5+
version = "2.0">
6+
<BuildAction
7+
parallelizeBuildables = "YES"
8+
buildImplicitDependencies = "YES">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "94196330292ED5FE009BC68A"
19+
BuildableName = "BeatTimeWidgetWatchOSExtension.appex"
20+
BlueprintName = "BeatTimeWidgetWatchOSExtension"
21+
ReferencedContainer = "container:BeatTime.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
<BuildActionEntry
25+
buildForTesting = "YES"
26+
buildForRunning = "YES"
27+
buildForProfiling = "YES"
28+
buildForArchiving = "YES"
29+
buildForAnalyzing = "YES">
30+
<BuildableReference
31+
BuildableIdentifier = "primary"
32+
BlueprintIdentifier = "94BEB1B92646D9C500A5D811"
33+
BuildableName = "BeatTimeiOS.app"
34+
BlueprintName = "BeatTimeiOS"
35+
ReferencedContainer = "container:BeatTime.xcodeproj">
36+
</BuildableReference>
37+
</BuildActionEntry>
38+
<BuildActionEntry
39+
buildForTesting = "YES"
40+
buildForRunning = "YES"
41+
buildForProfiling = "YES"
42+
buildForArchiving = "YES"
43+
buildForAnalyzing = "YES">
44+
<BuildableReference
45+
BuildableIdentifier = "primary"
46+
BlueprintIdentifier = "947C562C264814E9007E6B4A"
47+
BuildableName = "BeatTimeWatchOS WatchKit App.app"
48+
BlueprintName = "BeatTimeWatchOS WatchKit App"
49+
ReferencedContainer = "container:BeatTime.xcodeproj">
50+
</BuildableReference>
51+
</BuildActionEntry>
52+
<BuildActionEntry
53+
buildForTesting = "YES"
54+
buildForRunning = "YES"
55+
buildForProfiling = "YES"
56+
buildForArchiving = "YES"
57+
buildForAnalyzing = "YES">
58+
<BuildableReference
59+
BuildableIdentifier = "primary"
60+
BlueprintIdentifier = "947C5629264814E9007E6B4A"
61+
BuildableName = "BeatTime.app"
62+
BlueprintName = "BeatTimeWatchOS"
63+
ReferencedContainer = "container:BeatTime.xcodeproj">
64+
</BuildableReference>
65+
</BuildActionEntry>
66+
</BuildActionEntries>
67+
</BuildAction>
68+
<TestAction
69+
buildConfiguration = "Debug"
70+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
71+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
72+
shouldUseLaunchSchemeArgsEnv = "YES">
73+
<Testables>
74+
</Testables>
75+
</TestAction>
76+
<LaunchAction
77+
buildConfiguration = "Debug"
78+
selectedDebuggerIdentifier = ""
79+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
80+
launchStyle = "0"
81+
askForAppToLaunch = "Yes"
82+
useCustomWorkingDirectory = "NO"
83+
ignoresPersistentStateOnLaunch = "NO"
84+
debugDocumentVersioning = "YES"
85+
debugServiceExtension = "internal"
86+
allowLocationSimulation = "YES"
87+
launchAutomaticallySubstyle = "2">
88+
<BuildableProductRunnable
89+
runnableDebuggingMode = "0">
90+
<BuildableReference
91+
BuildableIdentifier = "primary"
92+
BlueprintIdentifier = "94BEB1B92646D9C500A5D811"
93+
BuildableName = "BeatTimeiOS.app"
94+
BlueprintName = "BeatTimeiOS"
95+
ReferencedContainer = "container:BeatTime.xcodeproj">
96+
</BuildableReference>
97+
</BuildableProductRunnable>
98+
<EnvironmentVariables>
99+
<EnvironmentVariable
100+
key = "_XCWidgetKind"
101+
value = ""
102+
isEnabled = "NO">
103+
</EnvironmentVariable>
104+
<EnvironmentVariable
105+
key = "_XCWidgetDefaultView"
106+
value = "timeline"
107+
isEnabled = "NO">
108+
</EnvironmentVariable>
109+
<EnvironmentVariable
110+
key = "_XCWidgetFamily"
111+
value = "medium"
112+
isEnabled = "NO">
113+
</EnvironmentVariable>
114+
</EnvironmentVariables>
115+
</LaunchAction>
116+
<ProfileAction
117+
buildConfiguration = "Release"
118+
shouldUseLaunchSchemeArgsEnv = "YES"
119+
savedToolIdentifier = ""
120+
useCustomWorkingDirectory = "NO"
121+
debugDocumentVersioning = "YES">
122+
<BuildableProductRunnable
123+
runnableDebuggingMode = "0">
124+
<BuildableReference
125+
BuildableIdentifier = "primary"
126+
BlueprintIdentifier = "94196330292ED5FE009BC68A"
127+
BuildableName = "BeatTimeWidgetWatchOSExtension.appex"
128+
BlueprintName = "BeatTimeWidgetWatchOSExtension"
129+
ReferencedContainer = "container:BeatTime.xcodeproj">
130+
</BuildableReference>
131+
</BuildableProductRunnable>
132+
</ProfileAction>
133+
<AnalyzeAction
134+
buildConfiguration = "Debug">
135+
</AnalyzeAction>
136+
<ArchiveAction
137+
buildConfiguration = "Release"
138+
revealArchiveInOrganizer = "YES">
139+
</ArchiveAction>
140+
</Scheme>

BeatTime.xcodeproj/xcshareddata/xcschemes/BeatTimeWidgetiOSExtension.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1410"
3+
LastUpgradeVersion = "1500"
44
wasCreatedForAppExtension = "YES"
55
version = "2.0">
66
<BuildAction

BeatTime.xcodeproj/xcshareddata/xcschemes/BeatTimeiOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1410"
3+
LastUpgradeVersion = "1500"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

BeatTime/BeatTime.swift

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class BeatTime: NSObject {
1616
/// - date: Date to convert
1717
/// - centiBeats: option to display centieme of beats
1818
/// - Returns: beat time as String
19-
func beats(date: Date = Date(), centiBeats: Bool = false) -> String
19+
static func beats(date: Date = Date(), centiBeats: Bool = false) -> String
2020
{
2121
var beats: Double
2222
var timeSeconds: TimeInterval
@@ -39,7 +39,7 @@ class BeatTime: NSObject {
3939
/// Convert a beat time to a Date (local 24-hour time)
4040
/// - Parameter beats: beat time
4141
/// - Returns: Date
42-
func date(beats: String) -> Date
42+
static func date(beats: String) -> Date
4343
{
4444
var seconds: Double
4545

@@ -92,4 +92,21 @@ class BeatTime: NSObject {
9292
//print("seconds: \(seconds) hours: \(hours)")
9393
return(hours)
9494
}
95+
96+
/// Return the difference between LocalTimeZone and BMT (Biel Mean Time / CET / GMT+1)
97+
/// - Parameter date: local date
98+
/// - Returns: Difference in hours (negative or positive)
99+
static func hoursOffsetWithBMT(date: Date = Date()) -> Int
100+
{
101+
return(hoursOffsetWithGMT(date: date) - 1)
102+
}
103+
104+
static func validate(_ beats: String) -> Bool {
105+
if let beattime = Int(beats) {
106+
if (beattime >= 0 && beattime <= 1000) {
107+
return true
108+
}
109+
}
110+
return false
111+
}
95112
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.network.client</key>
8+
<true/>
9+
</dict>
10+
</plist>

0 commit comments

Comments
 (0)