Skip to content

Commit be99089

Browse files
committed
Merge branch 'cdqi5'
2 parents 830ee42 + 7abae2a commit be99089

File tree

72 files changed

+1695
-2919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1695
-2919
lines changed

CoreDataQueryInterface.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Pod::Spec.new do |s|
22
s.name = 'CoreDataQueryInterface'
3-
s.version = '4.3.2'
3+
s.version = '5.0'
44
s.license = 'MIT'
55
s.summary = 'A type-safe, fluent Swift library for working with Core Data.'
66
s.homepage = 'https://github.com/Prosumma/CoreDataQueryInterface'
77
s.social_media_url = 'http://twitter.com/prosumma'
88
s.authors = { 'Gregory Higley' => 'code@revolucent.net' }
99
s.source = { :git => "#{s.homepage}.git", :tag => "v#{s.version}" }
10-
s.ios.deployment_target = '8.1'
11-
s.osx.deployment_target = '10.9'
10+
s.ios.deployment_target = '9.0'
11+
s.osx.deployment_target = '10.11'
1212
s.watchos.deployment_target = '2.0'
1313
s.tvos.deployment_target = '9.0'
1414
s.source_files = 'CoreDataQueryInterface/*.swift'

CoreDataQueryInterface.xcodeproj/project.pbxproj

Lines changed: 173 additions & 361 deletions
Large diffs are not rendered by default.

CoreDataQueryInterface.xcodeproj/xcshareddata/xcschemes/CoreDataQueryInterface OSX.xcscheme

Lines changed: 3 additions & 2 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 = "0700"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "NO">
29+
shouldUseLaunchSchemeArgsEnv = "NO"
30+
codeCoverageEnabled = "YES">
3031
<Testables>
3132
<TestableReference
3233
skipped = "NO">

CoreDataQueryInterface.xcodeproj/xcshareddata/xcschemes/CoreDataQueryInterface iOS.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 = "0700"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

CoreDataQueryInterface.xcodeproj/xcshareddata/xcschemes/CoreDataQueryInterface tvOS.xcscheme

Lines changed: 3 additions & 2 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 = "0730"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES">
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
codeCoverageEnabled = "YES">
3031
<Testables>
3132
<TestableReference
3233
skipped = "NO">

CoreDataQueryInterface.xcodeproj/xcshareddata/xcschemes/CoreDataQueryInterface watchOS.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 = "0730"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

CoreDataQueryInterface/Aggregable.swift

Lines changed: 0 additions & 39 deletions
This file was deleted.

CoreDataQueryInterface/Attribute.swift

Lines changed: 0 additions & 113 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
//
2+
// Attribute.swift
3+
// CoreDataQueryInterface
4+
//
5+
// Created by Gregory Higley on 9/25/16.
6+
// Copyright © 2016 Prosumma LLC. All rights reserved.
7+
//
8+
9+
import CoreData
10+
import Foundation
11+
12+
open class EntityAttribute: PredicateComparableTypedExpressionConvertible, KeyPathExpressionConvertible, PropertyConvertible {
13+
public typealias CDQIComparisonType = NSManagedObjectID
14+
15+
public let cdqiKey: String?
16+
public let cdqiParent: KeyPathExpressionConvertible?
17+
18+
public required init(key: String? = nil, parent: KeyPathExpressionConvertible? = nil) {
19+
// You can have a key without a parent, but you can't have a parent without a key.
20+
assert(key != nil || parent == nil, "Parent without key in Attribute.")
21+
// If key is a variable, i.e., starts with a $, it can't have a parent.
22+
assert(!(key?.hasPrefix("$") ?? false) || parent == nil, "Variable with parent in Attribute.")
23+
cdqiKey = key
24+
cdqiParent = parent
25+
}
26+
27+
public required convenience init(variable: String) {
28+
self.init(key: "$\(variable)")
29+
}
30+
}
31+
32+
public struct ScalarAttribute<E: TypedExpressionConvertible>: PredicateComparableTypedExpressionConvertible, KeyPathExpressionConvertible, PropertyConvertible {
33+
public typealias CDQIComparisonType = E.CDQIComparisonType
34+
35+
public let cdqiKey: String?
36+
public let cdqiParent: KeyPathExpressionConvertible?
37+
public let cdqiType: NSAttributeType = E.cdqiStaticType
38+
39+
public init(key: String, parent: KeyPathExpressionConvertible) {
40+
assert(!key.hasPrefix("$"), "Variable used as key for ScalarAttribute.")
41+
cdqiKey = key
42+
cdqiParent = parent
43+
}
44+
}
45+
46+
public typealias BoolAttribute = ScalarAttribute<Bool>
47+
public typealias StringAttribute = ScalarAttribute<String>
48+
public typealias Integer16Attribute = ScalarAttribute<Int16>
49+
public typealias Integer32Attribute = ScalarAttribute<Int32>
50+
public typealias Integer64Attribute = ScalarAttribute<Int64>
51+
public typealias DoubleAttribute = ScalarAttribute<Double>
52+
public typealias DataAttribute = ScalarAttribute<Data>
53+
public typealias DateAttribute = ScalarAttribute<Date>
54+
public typealias DecimalAttribute = ScalarAttribute<Decimal>
55+
public typealias FloatAttribute = ScalarAttribute<Float>

CoreDataQueryInterface/BooleanAttribute.swift

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)