Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Parse-Swift Changelog

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

### 1.3.1
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.3.0...1.3.1)

__New features__
- Add findAll query to find all objects ([#118](https://github.com/parse-community/Parse-Swift/pull/118)), thanks to [Corey Baker](https://github.com/cbaker6).
- Can now delete the iOS Objective-C SDK Keychain from app ([#118](https://github.com/parse-community/Parse-Swift/pull/118)), thanks to [Corey Baker](https://github.com/cbaker6).
- Migrate installationId from obj-c SDK ([#117](https://github.com/parse-community/Parse-Swift/pull/117)), thanks to [Corey Baker](https://github.com/cbaker6).

__Improvements__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ query.first { results in
}
}

//: Query based on relative time. Have to be using mongoDB.
let queryRelative = GameScore.query(relative(key: "createdAt",
comparator: .lessThan,
time: "10 minutes ago"))
queryRelative.find { results in
switch results {
case .success(let scores):

print("Found scores using relative time: \(scores)")

case .failure(let error):
assertionFailure("Error querying: \(error)")
}
}

let querySelect = query.select("score")
querySelect.first { results in
switch results {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ query7.find { results in
}
}

//: Find all GameScores.
let query8 = GameScore.query()
query8.findAll { result in
switch result {
case .success(let scores):
print(scores)
case .failure(let error):
print(error.localizedDescription)
}
}

//: Explain the previous query.
let explain: AnyDecodable = try query2.first(explain: true)
print(explain)
Expand Down
2 changes: 1 addition & 1 deletion ParseSwift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ParseSwift"
s.version = "1.3.0"
s.version = "1.3.1"
s.summary = "Parse Pure Swift SDK"
s.homepage = "https://github.com/parse-community/Parse-Swift"
s.authors = {
Expand Down
16 changes: 8 additions & 8 deletions ParseSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2329,7 +2329,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
PRODUCT_NAME = ParseSwift;
SKIP_INSTALL = YES;
Expand All @@ -2353,7 +2353,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
PRODUCT_NAME = ParseSwift;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -2419,7 +2419,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
PRODUCT_NAME = ParseSwift;
SDKROOT = macosx;
Expand All @@ -2445,7 +2445,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
PRODUCT_NAME = ParseSwift;
SDKROOT = macosx;
Expand Down Expand Up @@ -2592,7 +2592,7 @@
INFOPLIST_FILE = "ParseSwift-watchOS/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.3.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-watchOS";
Expand Down Expand Up @@ -2621,7 +2621,7 @@
INFOPLIST_FILE = "ParseSwift-watchOS/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.3.1;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-watchOS";
PRODUCT_NAME = ParseSwift;
Expand All @@ -2648,7 +2648,7 @@
INFOPLIST_FILE = "ParseSwift-tvOS/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.3.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-tvOS";
Expand Down Expand Up @@ -2676,7 +2676,7 @@
INFOPLIST_FILE = "ParseSwift-tvOS/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.3.1;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-tvOS";
PRODUCT_NAME = ParseSwift;
Expand Down
2 changes: 1 addition & 1 deletion Scripts/jazzy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bundle exec jazzy \
--author_url http://parseplatform.org \
--github_url https://github.com/parse-community/Parse-Swift \
--root-url http://parseplatform.org/Parse-Swift/api/ \
--module-version 1.3.0 \
--module-version 1.3.1 \
--theme fullwidth \
--skip-undocumented \
--output ./docs/api \
Expand Down
4 changes: 2 additions & 2 deletions Sources/ParseSwift/Objects/ParseInstallation+combine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public extension Sequence where Element: ParseInstallation {

/**
Saves a collection of installations *asynchronously* and publishes when complete.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand All @@ -113,7 +113,7 @@ public extension Sequence where Element: ParseInstallation {

/**
Deletes a collection of installations *asynchronously* and publishes when complete.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand Down
16 changes: 10 additions & 6 deletions Sources/ParseSwift/Objects/ParseInstallation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ public extension Sequence where Element: ParseInstallation {

/**
Saves a collection of installations *synchronously* all at once and throws an error if necessary.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
Expand Down Expand Up @@ -721,7 +721,7 @@ public extension Sequence where Element: ParseInstallation {

/**
Saves a collection of installations all at once *asynchronously* and executes the completion block when done.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand All @@ -742,8 +742,12 @@ public extension Sequence where Element: ParseInstallation {
callbackQueue: DispatchQueue = .main,
completion: @escaping (Result<[(Result<Element, ParseError>)], ParseError>) -> Void
) {
let queue = DispatchQueue(label: "com.parse.saveAll", qos: .default,
attributes: .concurrent, autoreleaseFrequency: .inherit, target: nil)
let uuid = UUID()
let queue = DispatchQueue(label: "com.parse.saveAll.\(uuid)",
qos: .default,
attributes: .concurrent,
autoreleaseFrequency: .inherit,
target: nil)
queue.sync {
var childObjects = [String: PointerType]()
var childFiles = [UUID: ParseFile]()
Expand Down Expand Up @@ -947,7 +951,7 @@ public extension Sequence where Element: ParseInstallation {

/**
Deletes a collection of installations *synchronously* all at once and throws an error if necessary.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand Down Expand Up @@ -994,7 +998,7 @@ public extension Sequence where Element: ParseInstallation {

/**
Deletes a collection of installations all at once *asynchronously* and executes the completion block when done.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand Down
4 changes: 2 additions & 2 deletions Sources/ParseSwift/Objects/ParseObject+combine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public extension Sequence where Element: ParseObject {

/**
Saves a collection of objects *asynchronously* and publishes when complete.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand All @@ -110,7 +110,7 @@ public extension Sequence where Element: ParseObject {

/**
Deletes a collection of objects *asynchronously* and publishes when complete.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand Down
33 changes: 20 additions & 13 deletions Sources/ParseSwift/Objects/ParseObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public extension Sequence where Element: ParseObject {

/**
Saves a collection of objects *synchronously* all at once and throws an error if necessary.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand Down Expand Up @@ -126,7 +126,7 @@ public extension Sequence where Element: ParseObject {
if transaction {
batchLimit = commands.count
} else {
batchLimit = limit != nil ? limit! : ParseConstants.batchLimit
batchLimit = limit ?? ParseConstants.batchLimit
}
let batches = BatchUtils.splitArray(commands, valuesPerSegment: batchLimit)
try batches.forEach {
Expand All @@ -143,7 +143,7 @@ public extension Sequence where Element: ParseObject {

/**
Saves a collection of objects all at once *asynchronously* and executes the completion block when done.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand All @@ -163,8 +163,12 @@ public extension Sequence where Element: ParseObject {
callbackQueue: DispatchQueue = .main,
completion: @escaping (Result<[(Result<Element, ParseError>)], ParseError>) -> Void
) {
let queue = DispatchQueue(label: "com.parse.saveAll", qos: .default,
attributes: .concurrent, autoreleaseFrequency: .inherit, target: nil)
let uuid = UUID()
let queue = DispatchQueue(label: "com.parse.saveAll.\(uuid)",
qos: .default,
attributes: .concurrent,
autoreleaseFrequency: .inherit,
target: nil)
queue.sync {

var childObjects = [String: PointerType]()
Expand Down Expand Up @@ -220,7 +224,7 @@ public extension Sequence where Element: ParseObject {
if transaction {
batchLimit = commands.count
} else {
batchLimit = limit != nil ? limit! : ParseConstants.batchLimit
batchLimit = limit ?? ParseConstants.batchLimit
}
let batches = BatchUtils.splitArray(commands, valuesPerSegment: batchLimit)
var completed = 0
Expand Down Expand Up @@ -361,7 +365,7 @@ public extension Sequence where Element: ParseObject {

/**
Deletes a collection of objects *synchronously* all at once and throws an error if necessary.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand Down Expand Up @@ -390,7 +394,7 @@ public extension Sequence where Element: ParseObject {
if transaction {
batchLimit = commands.count
} else {
batchLimit = limit != nil ? limit! : ParseConstants.batchLimit
batchLimit = limit ?? ParseConstants.batchLimit
}
let batches = BatchUtils.splitArray(commands, valuesPerSegment: batchLimit)
try batches.forEach {
Expand All @@ -404,7 +408,7 @@ public extension Sequence where Element: ParseObject {

/**
Deletes a collection of objects all at once *asynchronously* and executes the completion block when done.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand Down Expand Up @@ -439,7 +443,7 @@ public extension Sequence where Element: ParseObject {
if transaction {
batchLimit = commands.count
} else {
batchLimit = limit != nil ? limit! : ParseConstants.batchLimit
batchLimit = limit ?? ParseConstants.batchLimit
}
let batches = BatchUtils.splitArray(commands, valuesPerSegment: batchLimit)
var completed = 0
Expand Down Expand Up @@ -633,9 +637,12 @@ extension ParseObject {
internal func ensureDeepSave(options: API.Options = [],
completion: @escaping ([String: PointerType],
[UUID: ParseFile], ParseError?) -> Void) {

let queue = DispatchQueue(label: "com.parse.deepSave", qos: .default,
attributes: .concurrent, autoreleaseFrequency: .inherit, target: nil)
let uuid = UUID()
let queue = DispatchQueue(label: "com.parse.deepSave.\(uuid)",
qos: .default,
attributes: .concurrent,
autoreleaseFrequency: .inherit,
target: nil)

queue.sync {
var objectsFinishedSaving = [String: PointerType]()
Expand Down
4 changes: 2 additions & 2 deletions Sources/ParseSwift/Objects/ParseUser+combine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public extension Sequence where Element: ParseUser {

/**
Saves a collection of users *asynchronously* and publishes when complete.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand All @@ -235,7 +235,7 @@ public extension Sequence where Element: ParseUser {

/**
Deletes a collection of users *asynchronously* and publishes when complete.
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched
- parameter batchLimit: The maximum number of objects to send in each batch. If the items to be batched.
is greater than the `batchLimit`, the objects will be sent to the server in waves up to the `batchLimit`.
Defaults to 50.
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
Expand Down
Loading