Skip to content

Commit

Permalink
Merge pull request #5 from mulot/developpement
Browse files Browse the repository at this point in the history
Developpement
  • Loading branch information
mulot authored Nov 19, 2022
2 parents 03645d8 + 265e016 commit 4d12c16
Show file tree
Hide file tree
Showing 16 changed files with 90 additions and 245 deletions.
188 changes: 43 additions & 145 deletions BeatTime.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1410"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -55,18 +55,16 @@
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "32">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/BeatTime">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C562C264814E9007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit App.app"
BlueprintName = "BeatTimeWatchOS WatchKit App"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</RemoteRunnable>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -75,27 +73,16 @@
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
launchAutomaticallySubstyle = "32">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/BeatTime">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C562C264814E9007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit App.app"
BlueprintName = "BeatTimeWatchOS WatchKit App"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C562C264814E9007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit App.app"
BlueprintName = "BeatTimeWatchOS WatchKit App"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1410"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -56,18 +56,16 @@
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "8"
notificationPayloadFile = "WatchOS WatchKit Extension/PushNotificationPayload.apns">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/BeatTime">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C562C264814E9007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit App.app"
BlueprintName = "BeatTimeWatchOS WatchKit App"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</RemoteRunnable>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -77,27 +75,16 @@
debugDocumentVersioning = "YES"
launchAutomaticallySubstyle = "8"
notificationPayloadFile = "WatchOS WatchKit Extension/PushNotificationPayload.apns">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/BeatTime">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C562C264814E9007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit App.app"
BlueprintName = "BeatTimeWatchOS WatchKit App"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C562C264814E9007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit App.app"
BlueprintName = "BeatTimeWatchOS WatchKit App"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -54,46 +54,33 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/BeatTime">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C562C264814E9007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit App.app"
BlueprintName = "BeatTimeWatchOS WatchKit App"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</RemoteRunnable>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/BeatTime">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C562C264814E9007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit App.app"
BlueprintName = "BeatTimeWatchOS WatchKit App"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C562C264814E9007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit App.app"
BlueprintName = "BeatTimeWatchOS WatchKit App"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -82,46 +82,33 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/BeatTime">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C5638264814F0007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit Extension.appex"
BlueprintName = "BeatTimeWatchOS WatchKit Extension"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</RemoteRunnable>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/BeatTime">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C5638264814F0007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit Extension.appex"
BlueprintName = "BeatTimeWatchOS WatchKit Extension"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "947C5638264814F0007E6B4A"
BuildableName = "BeatTimeWatchOS WatchKit Extension.appex"
BlueprintName = "BeatTimeWatchOS WatchKit Extension"
ReferencedContainer = "container:BeatTime.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
LastUpgradeVersion = "1410"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
LastUpgradeVersion = "1410"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
11 changes: 4 additions & 7 deletions BeatTime/BeatTime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,13 @@ class BeatTime: NSObject {
dateComponents.month = calendar.component(.month, from: date)
dateComponents.day = calendar.component(.day, from: date)
dateComponents.timeZone = TimeZone(abbreviation: "CET")
dateComponents.hour = 1 // UTC+1 Offset
dateComponents.hour = 0
dateComponents.minute = 0
/*

if (TimeZone.autoupdatingCurrent.isDaylightSavingTime()) {
print("Daylight On")
}
else {
print("Daylight Off")
//print("Daylight On")
dateComponents.hour = 1 // UTC+1 Offset
}
*/

if let someDateTime = calendar.date(from: dateComponents) {
//let secondsSinceRefDate = someDateTime.timeIntervalSinceReferenceDate + BeatTime.UTCplus1Offset + seconds
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ Apps are coded in Swift language using AppKit/Cocoa (macOS), SwiftUI, WidgetKit,
For more information about Swatch Internet Time:
https://en.wikipedia.org/wiki/Swatch_Internet_Time

What's New in version 1.2:
- Extra large complications for Apple Watch
- Corner complication for Apple Watch
What's New in version 1.2.1:
- Fix dayligth issue in .beats to local time convert mode

<a href="https://www.buymeacoffee.com/0TC98Sk" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
6 changes: 5 additions & 1 deletion WatchOS WatchKit App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CLKComplicationPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ComplicationController</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>WKApplication</key>
<true/>
<key>WKCompanionAppBundleIdentifier</key>
<string>org.mulot.beattime</string>
<key>WKWatchKitApp</key>
<key>WKRunsIndependentlyOfCompanionApp</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion WatchOS WatchKit Extension/BeatTimeApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import os

@main
struct BeatTimeApp: App {
@WKExtensionDelegateAdaptor private var appDelegate: ExtensionDelegate
@WKApplicationDelegateAdaptor private var appDelegate: ExtensionDelegate
@Environment(\.scenePhase) private var scenePhase

let logger = Logger(subsystem: "org.mulot.beattime.BeatTimeWatchOS.watchkitapp.watchkitextension.App", category: "App View")
Expand Down
6 changes: 3 additions & 3 deletions WatchOS WatchKit Extension/ExtensionDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import ClockKit
import os

// The app's extension delegate.
class ExtensionDelegate: NSObject, WKExtensionDelegate {
class ExtensionDelegate: NSObject, WKApplicationDelegate {

let logger = Logger(subsystem: "org.mulot.beattime.BeatTimeWatchOS.watchkitapp.watchkitextension.ExtensionDelegate",
category: "Extension Delegate")
Expand All @@ -25,7 +25,7 @@ class ExtensionDelegate: NSObject, WKExtensionDelegate {
// Called when a background task occurs.
func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) {
logger.debug("Handling a background task...")
logger.debug("App State: \(WKExtension.shared().applicationState.rawValue)")
logger.debug("App State: \(WKApplication.shared().applicationState.rawValue)")
for task in backgroundTasks {
logger.debug("Task: \(task)")
switch task {
Expand Down Expand Up @@ -67,7 +67,7 @@ func scheduleBAR(first: Bool) {
let now = Date()
let scheduledDate = now.addingTimeInterval(first ? 60 : 60*60)
let info:NSDictionary = ["submissionDate":now]
let wkExt = WKExtension.shared()
let wkExt = WKApplication.shared()
wkExt.scheduleBackgroundRefresh(withPreferredDate: scheduledDate, userInfo: info) { (error: Error?) in
if (error != nil) {
scheduleLogger.debug("background refresh could not be scheduled \(error.debugDescription)")
Expand Down

0 comments on commit 4d12c16

Please sign in to comment.