Skip to content

Commit 710653a

Browse files
noobs2ninjasTomWFox
andcommitted
iOS Documentation Revamp (#650)
* Adding 'Deleting Files' header and updating information. * Updating objects documentation. *Changed PFObject fetch example to use fetchInBackground and updated documentation to reflect example used. *Removed Local Datastore documentation instructing to unnecessarily add a dynamic library. * Update Local Datastore Documentation. *Removed unnecessary instructions to manually add dynamic library *Updated Objective-C AppDelegate example to be more in line with the Swift example. *Added documentation to include Parse.enableLocalDatastore() *Updating examples for Retrieving Objects in Local Data Store to use PFObjectResultBlock rather than a BFTask completion in order to reduce confusion. * Correcting Getting Started Example for initialization * Major Updates to objects. *Updated Swift and Objective-C examples to reflect current version of Parse iOS SDK and language changes as well as to make more consistent between language examples. *Updated verbiage document wide to improve comprehention and remove documentation that is no longer relevant or helpful by todays standard. * Updating object deletion documention. *Removed irrelevant documention for deleting individual relational pointer data. *Replaced basic single line "deleteInBackground" example in favor of demonstrating multi-object deletion using PFObject's static deleteAllInBackground:block function. * Simplifying saveEventually explanation. * Update _includes/ios/objects.md Co-Authored-By: Tom Fox <[email protected]> * Update _includes/ios/files.md Co-Authored-By: Tom Fox <[email protected]> * Correcting spelling fo schemaless * Update _includes/ios/objects.md Co-Authored-By: Tom Fox <[email protected]> * Update _includes/ios/objects.md Co-Authored-By: Tom Fox <[email protected]> * Update _includes/ios/objects.md Co-Authored-By: Tom Fox <[email protected]> * Update _includes/ios/objects.md Co-Authored-By: Tom Fox <[email protected]> * Update _includes/ios/objects.md Co-Authored-By: Tom Fox <[email protected]> * Update _includes/ios/objects.md Co-Authored-By: Tom Fox <[email protected]> * Update _includes/ios/objects.md Co-Authored-By: Tom Fox <[email protected]> * Update _includes/ios/objects.md Co-Authored-By: Tom Fox <[email protected]>
1 parent 1bc0bb3 commit 710653a

File tree

4 files changed

+151
-143
lines changed

4 files changed

+151
-143
lines changed

_includes/ios/files.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ file?.saveInBackground({ (success: Bool, error: Error?) in
142142
```
143143
</div>
144144

145-
You can delete files that are referenced by objects using the [REST API]({{ site.baseUrl }}/rest/guide/#deleting-files). You will need to provide the master key in order to be allowed to delete a file.
145+
##Deleting Files
146146

147-
If your files are not referenced by any object in your app, it is not possible to delete them through the REST API. You may request a cleanup of unused files in your app's Settings page. Keep in mind that doing so may break functionality which depended on accessing unreferenced files through their URL property. Files that are currently associated with an object will not be affected.
147+
If you know the name of a file you can delete it using the [REST API]({{site.baseUrl}}/rest/guide/#deleting-files). Your master key is required for this operation.
148+
149+
Note: Reguardless of the Parse Server storage configuration, deleting a `PFObject` with a `PFFileObject` does not delete the file itself meerly its reference. Additionally, Parse does **NOT** provide a way to find unreferenced file names in storage.

_includes/ios/getting-started.md

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func application(application: UIApplication, didFinishLaunchingWithOptions launc
6464
$0.server = "parseServerUrlString"
6565
}
6666
Parse.initialize(with: parseConfig)
67+
return true
6768
}
6869
```
6970
</div>

_includes/ios/local-datastore.md

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# Local Datastore
22

3-
The Parse iOS/OS X SDK provides a local datastore which can be used to store and retrieve `PFObject`s, even when the network is unavailable. To enable this functionality, add `libsqlite3.dylib` and add `isLocalDatastoreEnabled = true` to the `ParseClientConfiguration` block used in `Parse.initialize()`.
3+
The Parse iOS/OS X SDK provides a local datastore which can be used to store and retrieve `PFObject`s, even when the network is unavailable. To enable this functionality add `isLocalDatastoreEnabled = true` to the `ParseClientConfiguration` block used in `Parse.initialize()` or call `Parse.enableLocalDatastore()` prior to initializing Parse.
44

55
<div class="language-toggle" markdown="1">
66
```objective_c
77
@implementation AppDelegate
88
99
- (void)application:(UIApplication *)application didFinishLaunchWithOptions:(NSDictionary *)options {
10-
[Parse enableLocalDatastore];
11-
[Parse setApplicationId:@"parseAppId" clientKey:@"parseClientKey"];
10+
ParseClientConfiguration *configuration = [ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
11+
configuration.applicationId = @"parseAppId";
12+
configuration.clientKey = @"parseClientKey";
13+
configuration.server = @"parseServerUrlString";
14+
configuration.localDatastoreEnabled = YES;
15+
}];
16+
[Parse initializeWithConfiguration:configuration];
1217
}
1318
1419
@end
@@ -74,28 +79,28 @@ Storing objects is great, but it's only useful if you can then get the objects b
7479
```objective_c
7580
PFQuery *query = [PFQuery queryWithClassName:@"GameScore"];
7681
[query fromLocalDatastore];
77-
[[query getObjectInBackgroundWithId:@"xWMyZ4YE"] continueWithBlock:^id(BFTask *task) {
78-
if (task.error) {
79-
// Something went wrong.
80-
return task;
81-
}
82+
[query getObjectInBackgroundWithId:"" block:^(PFObject * _Nullable object, NSError * _Nullable error) {
83+
if (!error) {
84+
// Success
85+
} else {
86+
// Fail!
87+
}
88+
}
8289
8390
// task.result will be your game score
8491
return task;
8592
}];
8693
```
94+
8795
```swift
8896
let query = PFQuery(className: "GameScore")
8997
query.fromLocalDatastore()
90-
query.getObjectInBackgroundWithId("xWMyZ4YE").continueWithBlock {
91-
(task: BFTask!) -> AnyObject in
92-
if let error = task.error {
93-
// Something went wrong.
94-
return task;
98+
query.getObjectInBackground(withId: "string") { (object, error) in
99+
if error == nil {
100+
// Success!
101+
} else {
102+
// Failure!
95103
}
96-
97-
// task.result will be your game score
98-
return task;
99104
}
100105
```
101106
</div>

0 commit comments

Comments
 (0)