Skip to content

Commit 99b6196

Browse files
authored
Make type-erased wrappers internal (#127)
* Make type-erased wrappers internal * Update .codecov.yml * nits
1 parent 57706a4 commit 99b6196

File tree

15 files changed

+115
-50
lines changed

15 files changed

+115
-50
lines changed

.codecov.yml

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

CHANGELOG.md

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

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

7+
### 1.6.0
8+
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.5.1...1.6.0)
9+
10+
__Improvements__
11+
- Make AnyCodable internal. If developers want to use AnyCodable, AnyEncodable, or AnyDecodable for `explain` or `ParseCloud`, they should add the [AnyCodable](https://github.com/Flight-School/AnyCodable) package to their app. In addition developers can create their own type-erased wrappers or use whatever they desire ([#127](https://github.com/parse-community/Parse-Swift/pull/127)), thanks to [Corey Baker](https://github.com/cbaker6).
12+
713
### 1.5.1
814
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.5.0...1.5.1)
915

ParseSwift.playground/Pages/7 - GeoPoint.xcplaygroundpage/Contents.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ query2.find { result in
195195
}
196196
}
197197

198-
//: Explain the previous query.
199-
let explain: AnyDecodable = try query8.firstExplain()
200-
print(explain)
198+
/*: Explain the previous query. Read the documentation note on `explain`
199+
queries and use a type-erased wrapper such as AnyCodable.
200+
*/
201+
//let explain: AnyDecodable = try query8.firstExplain()
202+
//print(explain)
201203

202204
PlaygroundPage.current.finishExecution()
203205
//: [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.5.1"
3+
s.version = "1.6.0"
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
@@ -2337,7 +2337,7 @@
23372337
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
23382338
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
23392339
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2340-
MARKETING_VERSION = 1.5.1;
2340+
MARKETING_VERSION = 1.6.0;
23412341
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
23422342
PRODUCT_NAME = ParseSwift;
23432343
SKIP_INSTALL = YES;
@@ -2361,7 +2361,7 @@
23612361
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
23622362
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
23632363
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2364-
MARKETING_VERSION = 1.5.1;
2364+
MARKETING_VERSION = 1.6.0;
23652365
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
23662366
PRODUCT_NAME = ParseSwift;
23672367
SKIP_INSTALL = YES;
@@ -2427,7 +2427,7 @@
24272427
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
24282428
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
24292429
MACOSX_DEPLOYMENT_TARGET = 10.13;
2430-
MARKETING_VERSION = 1.5.1;
2430+
MARKETING_VERSION = 1.6.0;
24312431
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
24322432
PRODUCT_NAME = ParseSwift;
24332433
SDKROOT = macosx;
@@ -2453,7 +2453,7 @@
24532453
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
24542454
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
24552455
MACOSX_DEPLOYMENT_TARGET = 10.13;
2456-
MARKETING_VERSION = 1.5.1;
2456+
MARKETING_VERSION = 1.6.0;
24572457
PRODUCT_BUNDLE_IDENTIFIER = com.parse.ParseSwift;
24582458
PRODUCT_NAME = ParseSwift;
24592459
SDKROOT = macosx;
@@ -2600,7 +2600,7 @@
26002600
INFOPLIST_FILE = "ParseSwift-watchOS/Info.plist";
26012601
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
26022602
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2603-
MARKETING_VERSION = 1.5.1;
2603+
MARKETING_VERSION = 1.6.0;
26042604
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
26052605
MTL_FAST_MATH = YES;
26062606
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-watchOS";
@@ -2629,7 +2629,7 @@
26292629
INFOPLIST_FILE = "ParseSwift-watchOS/Info.plist";
26302630
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
26312631
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2632-
MARKETING_VERSION = 1.5.1;
2632+
MARKETING_VERSION = 1.6.0;
26332633
MTL_FAST_MATH = YES;
26342634
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-watchOS";
26352635
PRODUCT_NAME = ParseSwift;
@@ -2656,7 +2656,7 @@
26562656
INFOPLIST_FILE = "ParseSwift-tvOS/Info.plist";
26572657
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
26582658
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2659-
MARKETING_VERSION = 1.5.1;
2659+
MARKETING_VERSION = 1.6.0;
26602660
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
26612661
MTL_FAST_MATH = YES;
26622662
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-tvOS";
@@ -2684,7 +2684,7 @@
26842684
INFOPLIST_FILE = "ParseSwift-tvOS/Info.plist";
26852685
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
26862686
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
2687-
MARKETING_VERSION = 1.5.1;
2687+
MARKETING_VERSION = 1.6.0;
26882688
MTL_FAST_MATH = YES;
26892689
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.ParseSwift-tvOS";
26902690
PRODUCT_NAME = ParseSwift;

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
For more information about the Parse Platform and its features, see the public [documentation][docs]. The ParseSwift SDK is not a port of the [Parse-SDK-iOS-OSX SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) and though some of it may feel familiar, it is not backwards compatible and is designed with a new philosophy. For more details visit the [api documentation](http://parseplatform.org/Parse-Swift/api/).
3131

32-
To learn how to use or experiment with ParseSwift, you can run and edit the [ParseSwift.playground](https://github.com/parse-community/Parse-Swift/tree/main/ParseSwift.playground/Pages). You can use the parse-server in [this repo](https://github.com/netreconlab/parse-hipaa/tree/parse-swift) which has docker compose files (`docker-compose up` gives you a working server) configured to connect with the playground files, has [Parse Dashboard](https://github.com/parse-community/parse-dashboard), and can be used with mongo or postgres.
32+
To learn how to use or experiment with ParseSwift, you can run and edit the [ParseSwift.playground](https://github.com/parse-community/Parse-Swift/tree/main/ParseSwift.playground/Pages). You can use the parse-server in [this repo](https://github.com/netreconlab/parse-hipaa/tree/parse-swift) which has docker compose files (`docker-compose up` gives you a working server) configured to connect with the playground files, has [Parse Dashboard](https://github.com/parse-community/parse-dashboard), and can be used with mongoDB or PostgreSQL.
3333

3434
## Installation
3535

Scripts/jazzy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ bundle exec jazzy \
55
--author_url http://parseplatform.org \
66
--github_url https://github.com/parse-community/Parse-Swift \
77
--root-url http://parseplatform.org/Parse-Swift/api/ \
8-
--module-version 1.5.1 \
8+
--module-version 1.6.0 \
99
--theme fullwidth \
1010
--skip-undocumented \
1111
--output ./docs/api \

Sources/ParseSwift/API/API.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
/// The REST API for communicating with the Parse Server.
11+
/// The REST API for communicating with a Parse Server.
1212
public struct API {
1313

1414
internal enum Method: String, Encodable {

Sources/ParseSwift/Coding/AnyCodable.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ import Foundation
1515

1616
Source: https://github.com/Flight-School/AnyCodable
1717
*/
18-
public struct AnyCodable: Codable {
18+
struct AnyCodable: Codable {
1919

20-
public let value: Any
20+
let value: Any
2121

22-
public init<T>(_ value: T?) {
22+
init<T>(_ value: T?) {
2323
self.value = value ?? ()
2424
}
2525
}
2626

2727
extension AnyCodable: _AnyEncodable, _AnyDecodable {}
2828

2929
extension AnyCodable: Equatable {
30-
public static func == (lhs: AnyCodable, rhs: AnyCodable) -> Bool { // swiftlint:disable:this cyclomatic_complexity line_length
30+
static func == (lhs: AnyCodable, rhs: AnyCodable) -> Bool { // swiftlint:disable:this cyclomatic_complexity line_length
3131
switch (lhs.value, rhs.value) {
3232
case is (Void, Void):
3333
return true
@@ -70,7 +70,7 @@ extension AnyCodable: Equatable {
7070
}
7171

7272
extension AnyCodable: CustomStringConvertible {
73-
public var description: String {
73+
var description: String {
7474
switch value {
7575
case is Void:
7676
return String(describing: nil as Any?)
@@ -83,7 +83,7 @@ extension AnyCodable: CustomStringConvertible {
8383
}
8484

8585
extension AnyCodable: CustomDebugStringConvertible {
86-
public var debugDescription: String {
86+
var debugDescription: String {
8787
switch value {
8888
case let value as CustomDebugStringConvertible:
8989
return "AnyCodable(\(value.debugDescription))"

Sources/ParseSwift/Coding/AnyDecodable.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import Foundation
2828
let decoder = JSONDecoder()
2929
let dictionary = try! decoder.decode([String: AnyCodable].self, from: json)
3030
*/
31-
public struct AnyDecodable: Decodable {
32-
public let value: Any
33-
public init<T>(_ value: T?) {
31+
struct AnyDecodable: Decodable {
32+
let value: Any
33+
init<T>(_ value: T?) {
3434
self.value = value ?? ()
3535
}
3636
}
@@ -43,7 +43,7 @@ protocol _AnyDecodable {
4343
extension AnyDecodable: _AnyDecodable {}
4444

4545
extension _AnyDecodable {
46-
public init(from decoder: Decoder) throws {
46+
init(from decoder: Decoder) throws {
4747
let container = try decoder.singleValueContainer()
4848

4949
if container.decodeNil() {
@@ -70,7 +70,7 @@ extension _AnyDecodable {
7070
}
7171

7272
extension AnyDecodable: Equatable {
73-
public static func == (lhs: AnyDecodable, rhs: AnyDecodable) -> Bool { // swiftlint:disable:this cyclomatic_complexity line_length
73+
static func == (lhs: AnyDecodable, rhs: AnyDecodable) -> Bool { // swiftlint:disable:this cyclomatic_complexity line_length
7474
switch (lhs.value, rhs.value) {
7575
case is (Void, Void):
7676
return true
@@ -113,7 +113,7 @@ extension AnyDecodable: Equatable {
113113
}
114114

115115
extension AnyDecodable: CustomStringConvertible {
116-
public var description: String {
116+
var description: String {
117117
switch value {
118118
case is Void:
119119
return String(describing: nil as Any?)
@@ -126,7 +126,7 @@ extension AnyDecodable: CustomStringConvertible {
126126
}
127127

128128
extension AnyDecodable: CustomDebugStringConvertible {
129-
public var debugDescription: String {
129+
var debugDescription: String {
130130
switch value {
131131
case let value as CustomDebugStringConvertible:
132132
return "AnyDecodable(\(value.debugDescription))"

0 commit comments

Comments
 (0)