Skip to content

Commit

Permalink
Merge pull request #227 from Eledev-Digital/6_2
Browse files Browse the repository at this point in the history
Release 6.2
  • Loading branch information
jtsaeed authored Nov 10, 2020
2 parents 2e59d22 + 1020e7f commit f30e985
Show file tree
Hide file tree
Showing 528 changed files with 2,557 additions and 47,191 deletions.
Binary file modified .DS_Store
Binary file not shown.
16 changes: 16 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Test & Build

on:
pull_request:
branches: [ master, 6_2 ]

jobs:
build:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_12.app
- name: Test & Build
run: xcodebuild clean test -project Hour\ Blocks.xcodeproj -scheme neon -destination "platform=iOS Simulator,name=iPhone 11 Pro"
302 changes: 141 additions & 161 deletions Hour Blocks.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"object": {
"pins": [
{
"package": "Amplitude",
"repositoryURL": "https://github.com/amplitude/Amplitude-iOS",
"state": {
"branch": null,
"revision": "f6b19721defbb5424941a4ff80407804a664d15b",
"version": "7.2.0"
}
},
{
"package": "Sentry",
"repositoryURL": "https://github.com/getsentry/sentry-cocoa",
"state": {
"branch": null,
"revision": "5559277356fb435a61d48ecb73582ed5581d2105",
"version": "6.0.7"
}
},
{
"package": "SwiftDate",
"repositoryURL": "https://github.com/malcommac/SwiftDate",
"state": {
"branch": null,
"revision": "a25913b19833860b61fac161a706e44834f03c47",
"version": "6.2.0"
}
}
]
},
"version": 1
}
Binary file not shown.
Empty file modified Hour Blocks.xcodeproj/xcshareddata/xcschemes/neon.xcscheme
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>NeonSiri.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>20</integer>
<integer>5</integer>
</dict>
<key>NeonWatch WatchKit App (Complication).xcscheme_^#shared#^_</key>
<dict>
Expand All @@ -22,7 +22,28 @@
<key>NeonWidgetExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>21</integer>
<integer>6</integer>
</dict>
<key>SwiftDate (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>8</integer>
</dict>
<key>SwiftDate (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>9</integer>
</dict>
<key>SwiftDate (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>7</integer>
</dict>
<key>neon.xcscheme_^#shared#^_</key>
<dict>
Expand Down
10 changes: 0 additions & 10 deletions Hour Blocks.xcworkspace/contents.xcworkspacedata

This file was deleted.

42 changes: 40 additions & 2 deletions NeonSiri/SiriDataGateway.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,52 @@ class SiriDataGateway {

lazy var persistentContainer: NSPersistentCloudKitContainer = {
let container = NSPersistentCloudKitContainer(name: "neon")
let coordinator = container.persistentStoreCoordinator

let storeURL = URL.storeURL(for: "group.com.evh98.neon", databaseName: "neon")
let storeDescription = NSPersistentStoreDescription(url: storeURL)
container.persistentStoreDescriptions = [storeDescription]

var defaultURL: URL?
if let storeDescription = container.persistentStoreDescriptions.first, let url = storeDescription.url {
defaultURL = FileManager.default.fileExists(atPath: url.path) ? url : nil
storeDescription.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.com.evh98.neon")
}

if defaultURL == nil {
let storeDescription = NSPersistentStoreDescription(url: storeURL)
storeDescription.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.com.evh98.neon")

container.persistentStoreDescriptions = [storeDescription]
}

container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}

if let url = defaultURL, url.absoluteString != storeURL.absoluteString {
let coordinator = container.persistentStoreCoordinator

// attempt migration if necessary
if let oldStore = coordinator.persistentStore(for: url) {
do {
try coordinator.migratePersistentStore(oldStore, to: storeURL, options: nil, withType: NSSQLiteStoreType)
} catch {
print(error.localizedDescription)
}

// delete old store
let fileCoordinator = NSFileCoordinator(filePresenter: nil)
fileCoordinator.coordinate(writingItemAt: url, options: .forDeleting, error: nil, byAccessor: { url in
do {
try FileManager.default.removeItem(at: url)
} catch {
print(error.localizedDescription)
}
})
}
}
})

return container
}()

Expand Down
7 changes: 6 additions & 1 deletion NeonWidget/WidgetDataGateway.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ class WidgetDataGateway {
var defaultURL: URL?
if let storeDescription = container.persistentStoreDescriptions.first, let url = storeDescription.url {
defaultURL = FileManager.default.fileExists(atPath: url.path) ? url : nil
storeDescription.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.com.evh98.neon")
}

if defaultURL == nil {
container.persistentStoreDescriptions = [NSPersistentStoreDescription(url: storeURL)]
let storeDescription = NSPersistentStoreDescription(url: storeURL)
storeDescription.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.com.evh98.neon")

container.persistentStoreDescriptions = [storeDescription]
}

container.loadPersistentStores(completionHandler: { (storeDescription, error) in
Expand Down Expand Up @@ -94,6 +98,7 @@ class WidgetDataGateway {
var toDoItems = [ToDoEntity]()

let request = NSFetchRequest<ToDoEntity>(entityName: "ToDoEntity")
request.predicate = NSPredicate(format: "completed == %@", NSNumber(value: false))

do {
toDoItems = try persistentContainer.viewContext.fetch(request)
Expand Down
103 changes: 0 additions & 103 deletions Podfile.lock

This file was deleted.

Binary file removed Pods/.DS_Store
Binary file not shown.
Loading

0 comments on commit f30e985

Please sign in to comment.