7 Commits
0.2.0 ... 0.2.1

Author SHA1 Message Date
Oleksii Dykan
1319fdb902 0.2.1 release 2018-09-25 23:09:28 +01:00
Oleksii Dykan
6d6ad92bee Force to use libraries when using cocoapods 2018-09-25 23:07:06 +01:00
Oleksii Dykan
49299dd857 Merge pull request #54 from serjooo/master
Updated to Swift 4.2
2018-09-20 10:20:54 +01:00
Serj
df13646d4d Updated travis.yml to latest xcode version
Updated travis.yml to latest xcode version
2018-09-20 11:25:55 +03:00
Serj
b83a25bf60 Updated to Swift 4.2
Changed the Swift version in build settings. No source code changes was needed.
2018-09-20 10:15:19 +03:00
Oleksii Dykan
4b967b2c91 Merge pull request #45 from natan/readme-update-cloudfirestore
README.md updates: update product name, small consistency tweaks
2018-05-31 22:03:10 +01:00
nathan spindel
c999e5375d README.md updates: update product name, small consistency tweaks 2018-05-31 13:08:12 -07:00
7 changed files with 31 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
language: objective-c language: objective-c
osx_image: xcode9.3 osx_image: xcode10.0
env: env:
- ACTION=test PLATFORM=Mac DESTINATION='platform=OS X' - ACTION=test PLATFORM=Mac DESTINATION='platform=OS X'

View File

@@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "CodableFirebase" s.name = "CodableFirebase"
s.version = "0.2.0" s.version = "0.2.1"
s.summary = "Use Codable with Firebase" s.summary = "Use Codable with Firebase"
s.description = "This library helps you use your custom models that conform to Codable protocol with Firebase Realtime Database and Firestore" s.description = "This library helps you use your custom models that conform to Codable protocol with Firebase Realtime Database and Firestore"
s.homepage = "https://github.com/alickbass/CodableFirebase" s.homepage = "https://github.com/alickbass/CodableFirebase"

View File

@@ -177,6 +177,7 @@
}; };
CE7DD36F1F9CFA81000225C5 = { CE7DD36F1F9CFA81000225C5 = {
CreatedOnToolsVersion = 9.0.1; CreatedOnToolsVersion = 9.0.1;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic; ProvisioningStyle = Automatic;
}; };
}; };
@@ -389,7 +390,7 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator macosx"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator macosx";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0; SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3,4"; TARGETED_DEVICE_FAMILY = "1,2,3,4";
TVOS_DEPLOYMENT_TARGET = 9.0; TVOS_DEPLOYMENT_TARGET = 9.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0; WATCHOS_DEPLOYMENT_TARGET = 2.0;
@@ -418,7 +419,7 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator macosx"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator macosx";
SWIFT_VERSION = 4.0; SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3,4"; TARGETED_DEVICE_FAMILY = "1,2,3,4";
TVOS_DEPLOYMENT_TARGET = 9.0; TVOS_DEPLOYMENT_TARGET = 9.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0; WATCHOS_DEPLOYMENT_TARGET = 2.0;
@@ -441,7 +442,7 @@
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos watchos macosx appletvsimulator iphonesimulator watchsimulator"; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos watchos macosx appletvsimulator iphonesimulator watchsimulator";
SWIFT_VERSION = 4.0; SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3,4"; TARGETED_DEVICE_FAMILY = "1,2,3,4";
TVOS_DEPLOYMENT_TARGET = 9.0; TVOS_DEPLOYMENT_TARGET = 9.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0; WATCHOS_DEPLOYMENT_TARGET = 2.0;
@@ -464,7 +465,7 @@
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos watchos macosx appletvsimulator iphonesimulator watchsimulator"; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos watchos macosx appletvsimulator iphonesimulator watchsimulator";
SWIFT_VERSION = 4.0; SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3,4"; TARGETED_DEVICE_FAMILY = "1,2,3,4";
TVOS_DEPLOYMENT_TARGET = 9.0; TVOS_DEPLOYMENT_TARGET = 9.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0; WATCHOS_DEPLOYMENT_TARGET = 2.0;

View File

@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.2.0</string> <string>0.2.1</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string> <string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>

View File

@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>BNDL</string> <string>BNDL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.2.0</string> <string>0.2.1</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>1</string>
</dict> </dict>

View File

@@ -20,13 +20,13 @@ struct Model: Codable {
let numberExample: Double let numberExample: Double
let dateExample: Date let dateExample: Date
let arrayExample: [String] let arrayExample: [String]
let nullExample: Int? let optionalExample: Int?
let objectExample: [String: String] let objectExample: [String: String]
let myEnum: MyEnum let myEnumExample: MyEnum
} }
``` ```
### Firebase Database usage ### Firebase Realtime Database usage
This is how you would use the library with [Firebase Realtime Database](https://firebase.google.com/products/realtime-database/): This is how you would use the library with [Firebase Realtime Database](https://firebase.google.com/products/realtime-database/):
@@ -43,7 +43,7 @@ Database.database().reference().child("model").setValue(data)
And here is how you would read the same value from [Firebase Realtime Database](https://firebase.google.com/products/realtime-database/): And here is how you would read the same value from [Firebase Realtime Database](https://firebase.google.com/products/realtime-database/):
```swift ```swift
Database.database().reference().child("model").observeSingleEvent(of: .value, with: { (snapshot) in Database.database().reference().child("model").observeSingleEvent(of: .value, with: { snapshot in
guard let value = snapshot.value else { return } guard let value = snapshot.value else { return }
do { do {
let model = try FirebaseDecoder().decode(Model.self, from: value) let model = try FirebaseDecoder().decode(Model.self, from: value)
@@ -54,9 +54,9 @@ Database.database().reference().child("model").observeSingleEvent(of: .value, wi
}) })
``` ```
### Firestore usage ### Firebase Cloud Firestore usage
And this is how you would encode it with [Firebase Firestore](https://firebase.google.com/products/firestore/): This is how you would encode a model with [Firebase Cloud Firestore](https://firebase.google.com/products/firestore/):
```swift ```swift
import Firebase import Firebase
@@ -64,19 +64,19 @@ import CodableFirebase
let model: Model // here you will create an instance of Model let model: Model // here you will create an instance of Model
let docData = try! FirestoreEncoder().encode(model) let docData = try! FirestoreEncoder().encode(model)
Firestore.firestore().collection("data").document("one").setData(docData) { err in Firestore.firestore().collection("data").document("one").setData(docData) { error in
if let err = err { if let error = error {
print("Error writing document: \(err)") print("Error writing document: \(error)")
} else { } else {
print("Document successfully written!") print("Document successfully written!")
} }
} }
``` ```
And this is how you would decode the same model with [Firebase Firestore](https://firebase.google.com/products/firestore/): And this is how you would decode the same model with [Firebase Cloud Firestore](https://firebase.google.com/products/firestore/):
```swift ```swift
Firestore.firestore().collection("data").document("one").getDocument { (document, error) in Firestore.firestore().collection("data").document("one").getDocument { document, error in
if let document = document { if let document = document {
let model = try! FirestoreDecoder().decode(Model.self, from: document.data()) let model = try! FirestoreDecoder().decode(Model.self, from: document.data())
print("Model: \(model)") print("Model: \(model)")
@@ -86,9 +86,9 @@ Firestore.firestore().collection("data").document("one").getDocument { (document
} }
``` ```
### How to use `GeoPoint`, `DocumentRefence`, `FieldValue`, `Timestamp` in Firestore #### How to use `GeoPoint`, `DocumentRefence`, `FieldValue`, `Timestamp` in Cloud Firestore
In order to use these 2 types with `Firestore`, you need to add the following code somewhere in your app: In order to use these types with Cloud Firestore, you need to add the following code somewhere in your app:
```swift ```swift
extension DocumentReference: DocumentReferenceType {} extension DocumentReference: DocumentReferenceType {}
@@ -112,7 +112,7 @@ platform :ios, '9.0'
use_frameworks! use_frameworks!
target 'MyApp' do target 'MyApp' do
pod 'CodableFirebase' pod 'CodableFirebase'
end end
``` ```

View File

@@ -18,7 +18,10 @@ platform :ios do
end end
def release(type) def release(type)
pod_lib_lint pod_lib_lint(
allow_warnings: true,
use_libraries: true,
)
podspec_name = "CodableFirebase.podspec" podspec_name = "CodableFirebase.podspec"
version = version_bump_podspec(path: podspec_name, version = version_bump_podspec(path: podspec_name,
bump_type: type) bump_type: type)
@@ -29,6 +32,9 @@ platform :ios do
message: "#{version} release") message: "#{version} release")
add_git_tag(tag: "#{version}") add_git_tag(tag: "#{version}")
push_to_git_remote push_to_git_remote
pod_push pod_push(
allow_warnings: true,
use_libraries: true,
)
end end
end end