Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLaganiere committed Apr 21, 2024
0 parents commit cac2ef8
Show file tree
Hide file tree
Showing 47 changed files with 2,919 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: Swift

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
/.build
/Packages
xcuserdata/
DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
.netrc
723 changes: 723 additions & 0 deletions Example/MoreDrama.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,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"originHash" : "3db1a6534bd7464db4b917e5151dfe4eb86510ceee615e90bea0bb016f510217",
"pins" : [
{
"identity" : "moredata",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ChrisLaganiere/MoreData.git",
"state" : {
"branch" : "main",
"revision" : "1fa7ed28df65e04b3d747d7e6d803bfdc40b31c2"
}
}
],
"version" : 3
}
106 changes: 106 additions & 0 deletions Example/MoreDrama.xcodeproj/xcshareddata/xcschemes/MoreDrama.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83BA342A2C65B2C40044A149"
BuildableName = "MoreDrama.app"
BlueprintName = "MoreDrama"
ReferencedContainer = "container:MoreDrama.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:MoreDrama.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83BA343F2C65B2C50044A149"
BuildableName = "MoreDramaTests.xctest"
BlueprintName = "MoreDramaTests"
ReferencedContainer = "container:MoreDrama.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83BA34492C65B2C50044A149"
BuildableName = "MoreDramaUITests.xctest"
BlueprintName = "MoreDramaUITests"
ReferencedContainer = "container:MoreDrama.xcodeproj">
</BuildableReference>
</TestableReference>
</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 = "83BA342A2C65B2C40044A149"
BuildableName = "MoreDrama.app"
BlueprintName = "MoreDrama"
ReferencedContainer = "container:MoreDrama.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83BA342A2C65B2C40044A149"
BuildableName = "MoreDrama.app"
BlueprintName = "MoreDrama"
ReferencedContainer = "container:MoreDrama.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
35 changes: 35 additions & 0 deletions Example/MoreDrama.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"configurations" : [
{
"id" : "88DC3F81-D79F-4B05-89B5-914FBA839B56",
"name" : "Test Scheme Action",
"options" : {

}
}
],
"defaultOptions" : {
"targetForVariableExpansion" : {
"containerPath" : "container:MoreDrama.xcodeproj",
"identifier" : "83BA342A2C65B2C40044A149",
"name" : "MoreDrama"
}
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:MoreDrama.xcodeproj",
"identifier" : "83BA343F2C65B2C50044A149",
"name" : "MoreDramaTests"
}
},
{
"target" : {
"containerPath" : "container:MoreDrama.xcodeproj",
"identifier" : "83BA34492C65B2C50044A149",
"name" : "MoreDramaUITests"
}
}
],
"version" : 1
}
7 changes: 7 additions & 0 deletions Example/MoreDrama/Data/Models/Person+CoreDataClass.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Foundation
import CoreData

@objc(Person)
public class Person: NSManagedObject {

}
51 changes: 51 additions & 0 deletions Example/MoreDrama/Data/Models/Person+CoreDataProperties.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import Foundation
import CoreData


extension Person {

@NSManaged public var birthdate: Date
@NSManaged public var name: String
@NSManaged public var personID: String
@NSManaged public var heard: NSSet/*<Statement>*/
@NSManaged public var stated: NSSet/*<Statement>*/

}

// MARK: Generated accessors for heard
extension Person {

@objc(addHeardObject:)
@NSManaged public func addToHeard(_ value: Statement)

@objc(removeHeardObject:)
@NSManaged public func removeFromHeard(_ value: Statement)

@objc(addHeard:)
@NSManaged public func addToHeard(_ values: NSSet)

@objc(removeHeard:)
@NSManaged public func removeFromHeard(_ values: NSSet)

}

// MARK: Generated accessors for stated
extension Person {

@objc(addStatedObject:)
@NSManaged public func addToStated(_ value: Statement)

@objc(removeStatedObject:)
@NSManaged public func removeFromStated(_ value: Statement)

@objc(addStated:)
@NSManaged public func addToStated(_ values: NSSet)

@objc(removeStated:)
@NSManaged public func removeFromStated(_ values: NSSet)

}

extension Person : Identifiable {

}
11 changes: 11 additions & 0 deletions Example/MoreDrama/Data/Models/Person+Fetchable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import CoreData
import MoreData

extension Person: Fetchable {
public typealias Filter = PersonFilter
public typealias Sort = PersonSort

public static var entityName: String {
"Person"
}
}
30 changes: 30 additions & 0 deletions Example/MoreDrama/Data/Models/Person+Filter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import CoreData
import MoreData

/// Filters which specify particular entities to fetch
public enum PersonFilter: Filtering {

/// maximum age, in years
case maximumAge(Int)
/// minimum age, in years
case minimumAge(Int)

/// particular individual
case personID(String)

public var predicate: NSPredicate? {
switch self {

case .maximumAge(let maximumAge):
let minimumDate = Date.now.addingTimeInterval(Double(-365 * 60 * 60 * maximumAge))
return NSPredicate(format: "%K >= %@", #keyPath(Person.birthdate), minimumDate as CVarArg)

case .minimumAge(let minimumAge):
let maximumDate = Date.now.addingTimeInterval(Double(-365 * 60 * 60 * minimumAge))
return NSPredicate(format: "%K <= %@", #keyPath(Person.birthdate), maximumDate as CVarArg)

case .personID(let personID):
return NSPredicate(format: "%K == %@", #keyPath(Person.personID), personID)
}
}
}
35 changes: 35 additions & 0 deletions Example/MoreDrama/Data/Models/Person+Sort.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import CoreData
import MoreData

/// Sort descriptors which specify how to sort fetched results
public enum PersonSort: Sorting {

/// Sort by age
case youngest
case oldest
/// Sort by name, A-Z
case name

public var sortDescriptors: [NSSortDescriptor] {
switch self {
case .youngest:
[
NSSortDescriptor(keyPath: \Person.birthdate, ascending: false),
// Fall back to ensure consistent sort order
NSSortDescriptor(keyPath: \Person.name, ascending: true),
]
case .oldest:
[
NSSortDescriptor(keyPath: \Person.birthdate, ascending: true),
// Fall back to ensure consistent sort order
NSSortDescriptor(keyPath: \Person.name, ascending: true),
]
case .name:
[
NSSortDescriptor(keyPath: \Person.name, ascending: true),
// Fall back to ensure consistent sort order
NSSortDescriptor(keyPath: \Person.birthdate, ascending: false),
]
}
}
}
7 changes: 7 additions & 0 deletions Example/MoreDrama/Data/Models/Statement+CoreDataClass.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Foundation
import CoreData

@objc(Statement)
public class Statement: NSManagedObject {

}
33 changes: 33 additions & 0 deletions Example/MoreDrama/Data/Models/Statement+CoreDataProperties.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Foundation
import CoreData


extension Statement {

@NSManaged public var content: String
@NSManaged public var time: Date
@NSManaged public var by: Person
@NSManaged public var to: NSSet/*<Person>*/

}

// MARK: Generated accessors for to
extension Statement {

@objc(addToObject:)
@NSManaged public func addToTo(_ value: Person)

@objc(removeToObject:)
@NSManaged public func removeFromTo(_ value: Person)

@objc(addTo:)
@NSManaged public func addToTo(_ values: NSSet)

@objc(removeTo:)
@NSManaged public func removeFromTo(_ values: NSSet)

}

extension Statement : Identifiable {

}
Loading

0 comments on commit cac2ef8

Please sign in to comment.