Skip to content

Commit f44e2ff

Browse files
authored
Add context header. Improve query constraint comparison (#140)
* Add context header. Improve query constraint comparison * prepare for release * doc nits * test compare queries * nit * Improve LiveQuery section of readme. * update jazzy docs * nit readme * set codecov back to auto * Improve server health * nit * nits
1 parent b196fca commit f44e2ff

File tree

17 files changed

+522
-52
lines changed

17 files changed

+522
-52
lines changed

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ coverage:
44
status:
55
patch:
66
default:
7-
target: 62
7+
target: auto
88
changes: false
99
project:
1010
default:

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ jobs:
135135
uses: actions/cache@v2
136136
with:
137137
path: vendor/bundle
138-
key: ${{ runner.os }}-gem-v3-${{ hashFiles('**/Gemfile.lock') }}
138+
key: ${{ runner.os }}-gem-v4-${{ hashFiles('**/Gemfile.lock') }}
139139
restore-keys: |
140-
${{ runner.os }}-gem-v3
140+
${{ runner.os }}-gem-v4
141141
- name: Install Bundle
142142
run: |
143143
bundle config path vendor/bundle

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
uses: actions/cache@v2
2727
with:
2828
path: vendor/bundle
29-
key: ${{ runner.os }}-gem-v3-${{ hashFiles('**/Gemfile.lock') }}
29+
key: ${{ runner.os }}-gem-v4-${{ hashFiles('**/Gemfile.lock') }}
3030
restore-keys: |
31-
${{ runner.os }}-gem-v3
31+
${{ runner.os }}-gem-v4
3232
- name: Install Bundle
3333
run: |
3434
bundle config path vendor/bundle

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
# Parse-Swift Changelog
22

33
### main
4-
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.7.1...main)
4+
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.7.2...main)
55
* _Contributing to this repo? Add info about your change here to be included in the next release_
66

7+
### 1.7.2
8+
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.7.1...1.7.2)
9+
10+
__New features__
11+
- Added ability to send context with object by specifying it within options ([#140](https://github.com/parse-community/Parse-Swift/pull/140)), thanks to [Corey Baker](https://github.com/cbaker6).
12+
713
__Fixes__
814
- ParseFiles can't be updated from the client and will now throw an error if attempted. Instead another file should be created and the older file should be deleted by the developer. ([#144](https://github.com/parse-community/Parse-Swift/pull/144)), thanks to [Corey Baker](https://github.com/cbaker6).
915
- Fixed issue where Swift SDK prevented fetching of Parse objects when custom objectId was enabled ([#139](https://github.com/parse-community/Parse-Swift/pull/139)), thanks to [Corey Baker](https://github.com/cbaker6).
1016

1117
__Improvements__
1218
- Add playground example of saving Parse objects with a custom objectId ([#137](https://github.com/parse-community/Parse-Swift/pull/137)), thanks to [Corey Baker](https://github.com/cbaker6).
19+
- Improved comparison of query constraints by comparing value ([#140](https://github.com/parse-community/Parse-Swift/pull/140)), thanks to [Corey Baker](https://github.com/cbaker6).
1320

1421
### 1.7.1
1522
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.7.0...1.7.1)

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
source 'https://rubygems.org'
22

3-
gem 'jazzy', '~> 0.13.6'
3+
gem 'jazzy', '~> 0.13.7'

Gemfile.lock

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.2)
5-
activesupport (5.2.4.4)
4+
CFPropertyList (3.0.3)
5+
activesupport (5.2.6)
66
concurrent-ruby (~> 1.0, >= 1.0.2)
77
i18n (>= 0.7, < 2)
88
minitest (~> 5.1)
@@ -14,10 +14,10 @@ GEM
1414
json (>= 1.5.1)
1515
atomos (0.1.3)
1616
claide (1.0.3)
17-
cocoapods (1.10.0)
17+
cocoapods (1.10.1)
1818
addressable (~> 2.6)
1919
claide (>= 1.0.2, < 2.0)
20-
cocoapods-core (= 1.10.0)
20+
cocoapods-core (= 1.10.1)
2121
cocoapods-deintegrate (>= 1.0.3, < 2.0)
2222
cocoapods-downloader (>= 1.4.0, < 2.0)
2323
cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -32,7 +32,7 @@ GEM
3232
nap (~> 1.0)
3333
ruby-macho (~> 1.4)
3434
xcodeproj (>= 1.19.0, < 2.0)
35-
cocoapods-core (1.10.0)
35+
cocoapods-core (1.10.1)
3636
activesupport (> 5.0, < 6)
3737
addressable (~> 2.6)
3838
algoliasearch (~> 1.0)
@@ -52,18 +52,18 @@ GEM
5252
netrc (~> 0.11)
5353
cocoapods-try (1.2.0)
5454
colored2 (3.1.2)
55-
concurrent-ruby (1.1.7)
55+
concurrent-ruby (1.1.8)
5656
escape (0.0.4)
57-
ethon (0.12.0)
58-
ffi (>= 1.3.0)
59-
ffi (1.14.2)
57+
ethon (0.14.0)
58+
ffi (>= 1.15.0)
59+
ffi (1.15.0)
6060
fourflusher (2.3.1)
6161
fuzzy_match (2.0.4)
6262
gh_inspector (1.1.3)
6363
httpclient (2.8.3)
64-
i18n (1.8.5)
64+
i18n (1.8.10)
6565
concurrent-ruby (~> 1.0)
66-
jazzy (0.13.6)
66+
jazzy (0.13.7)
6767
cocoapods (~> 1.5)
6868
mustache (~> 1.1)
6969
open4
@@ -72,9 +72,9 @@ GEM
7272
sassc (~> 2.1)
7373
sqlite3 (~> 1.3)
7474
xcinvoke (~> 0.3.0)
75-
json (2.3.1)
75+
json (2.5.1)
7676
liferaft (0.0.6)
77-
minitest (5.14.2)
77+
minitest (5.14.4)
7878
molinillo (0.6.6)
7979
mustache (1.1.1)
8080
nanaimo (0.3.0)
@@ -83,15 +83,15 @@ GEM
8383
open4 (1.3.4)
8484
public_suffix (4.0.6)
8585
redcarpet (3.5.1)
86-
rouge (3.25.0)
86+
rouge (3.26.0)
8787
ruby-macho (1.4.0)
8888
sassc (2.4.0)
8989
ffi (~> 1.9)
9090
sqlite3 (1.4.2)
9191
thread_safe (0.3.6)
9292
typhoeus (1.4.0)
9393
ethon (>= 0.9.0)
94-
tzinfo (1.2.8)
94+
tzinfo (1.2.9)
9595
thread_safe (~> 0.1)
9696
xcinvoke (0.3.0)
9797
liferaft (~> 0.0.6)
@@ -106,7 +106,7 @@ PLATFORMS
106106
ruby
107107

108108
DEPENDENCIES
109-
jazzy (~> 0.13.6)
109+
jazzy (~> 0.13.7)
110110

111111
BUNDLED WITH
112112
2.1.4

ParseSwift.playground/Pages/1 - Your first Object.xcplaygroundpage/Contents.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ PlaygroundPage.current.needsIndefiniteExecution = true
1313
npm start -- --appId applicationId --clientKey clientKey --masterKey masterKey --mountPath /1
1414
*/
1515

16-
/*: In Xcode, make sure you are building the "ParseSwift (macOS)" framework.
17-
*/
16+
//: In Xcode, make sure you are building the "ParseSwift (macOS)" framework.
1817

1918
initializeParse()
2019

2120
//: Check the health of your Parse Server.
22-
print(try ParseHealth.check())
21+
do {
22+
print("Server health is: \(try ParseHealth.check())")
23+
} catch {
24+
print(error)
25+
}
2326

2427
//: Create your own value typed `ParseObject`.
2528
struct GameScore: ParseObject {

ParseSwift.playground/Pages/10 - Cloud Code.xcplaygroundpage/Contents.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,42 @@ cloud.runFunction { result in
4444
}
4545

4646
//: Jobs can be run the same way by using the method `startJob()`.
47+
48+
//: Saving objects with context for beforeSave, afterSave, etc.
49+
//: Create your own value typed `ParseObject`.
50+
struct GameScore: ParseObject {
51+
//: Those are required for Object
52+
var objectId: String?
53+
var createdAt: Date?
54+
var updatedAt: Date?
55+
var ACL: ParseACL?
56+
57+
//: Your own properties.
58+
var score: Int = 0
59+
60+
//: Custom initializer.
61+
init(score: Int) {
62+
self.score = score
63+
}
64+
65+
init(objectId: String?) {
66+
self.objectId = objectId
67+
}
68+
}
69+
70+
//: Define a GameScore.
71+
let score = GameScore(score: 10)
72+
73+
//: Save asynchronously (preferred way) with the context option.
74+
score.save(options: .init(.context(["hello": "world"]))) { result in
75+
switch result {
76+
case .success(let savedScore):
77+
print("Successfully saved \(savedScore)")
78+
case .failure(let error):
79+
assertionFailure("Error saving: \(error)")
80+
}
81+
}
82+
4783
PlaygroundPage.current.finishExecution()
4884

4985
//: [Next](@next)

ParseSwift.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "ParseSwift"
3-
s.version = "1.7.1"
3+
s.version = "1.7.2"
44
s.summary = "Parse Pure Swift SDK"
55
s.homepage = "https://github.com/parse-community/Parse-Swift"
66
s.authors = {

ParseSwift.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,7 @@
23892389
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
23902390
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
23912391
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2392-
MARKETING_VERSION = 1.7.1;
2392+
MARKETING_VERSION = 1.7.2;
23932393
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
23942394
PRODUCT_NAME = ParseSwift;
23952395
SKIP_INSTALL = YES;
@@ -2413,7 +2413,7 @@
24132413
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
24142414
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
24152415
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2416-
MARKETING_VERSION = 1.7.1;
2416+
MARKETING_VERSION = 1.7.2;
24172417
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
24182418
PRODUCT_NAME = ParseSwift;
24192419
SKIP_INSTALL = YES;
@@ -2479,7 +2479,7 @@
24792479
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
24802480
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
24812481
MACOSX_DEPLOYMENT_TARGET = 10.13;
2482-
MARKETING_VERSION = 1.7.1;
2482+
MARKETING_VERSION = 1.7.2;
24832483
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
24842484
PRODUCT_NAME = ParseSwift;
24852485
SDKROOT = macosx;
@@ -2505,7 +2505,7 @@
25052505
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
25062506
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
25072507
MACOSX_DEPLOYMENT_TARGET = 10.13;
2508-
MARKETING_VERSION = 1.7.1;
2508+
MARKETING_VERSION = 1.7.2;
25092509
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
25102510
PRODUCT_NAME = ParseSwift;
25112511
SDKROOT = macosx;
@@ -2652,7 +2652,7 @@
26522652
INFOPLIST_FILE = "ParseSwift-watchOS/Info.plist";
26532653
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
26542654
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2655-
MARKETING_VERSION = 1.7.1;
2655+
MARKETING_VERSION = 1.7.2;
26562656
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
26572657
MTL_FAST_MATH = YES;
26582658
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-watchOS";
@@ -2681,7 +2681,7 @@
26812681
INFOPLIST_FILE = "ParseSwift-watchOS/Info.plist";
26822682
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
26832683
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2684-
MARKETING_VERSION = 1.7.1;
2684+
MARKETING_VERSION = 1.7.2;
26852685
MTL_FAST_MATH = YES;
26862686
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-watchOS";
26872687
PRODUCT_NAME = ParseSwift;
@@ -2708,7 +2708,7 @@
27082708
INFOPLIST_FILE = "ParseSwift-tvOS/Info.plist";
27092709
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
27102710
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2711-
MARKETING_VERSION = 1.7.1;
2711+
MARKETING_VERSION = 1.7.2;
27122712
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
27132713
MTL_FAST_MATH = YES;
27142714
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-tvOS";
@@ -2736,7 +2736,7 @@
27362736
INFOPLIST_FILE = "ParseSwift-tvOS/Info.plist";
27372737
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
27382738
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2739-
MARKETING_VERSION = 1.7.1;
2739+
MARKETING_VERSION = 1.7.2;
27402740
MTL_FAST_MATH = YES;
27412741
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-tvOS";
27422742
PRODUCT_NAME = ParseSwift;

0 commit comments

Comments
 (0)