Skip to content

Commit e70b8a9

Browse files
natanrolnikflovilmart
authored andcommitted
Finishes renaming PFFile to PFFileObject (#581)
1 parent a2feb78 commit e70b8a9

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

_includes/ios/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ if date == nil ||
108108
* NSString
109109
* NSNumber
110110
* NSDate
111-
* PFFile
111+
* PFFileObject
112112
* PFGeoPoint
113113
* NSArray
114114
* NSDictionary

_includes/ios/files.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Getting started with `PFFileObject` is easy. First, you'll need to have the data
99
<div class="language-toggle" markdown="1">
1010
```objective_c
1111
NSData *data = [@"Working at Parse is great!" dataUsingEncoding:NSUTF8StringEncoding];
12-
PFFile *file = [PFFileObject fileObjectWithName:@"resume.txt" data:data];
12+
PFFileObject *file = [PFFileObject fileObjectWithName:@"resume.txt" data:data];
1313
```
1414
```swift
1515
let str = "Working at Parse is great!"
@@ -55,7 +55,7 @@ Retrieving it back involves calling one of the `getData` variants on the `PFFile
5555

5656
<div class="language-toggle" markdown="1">
5757
```objective_c
58-
PFFile *applicantResume = anotherApplication[@"applicantResumeFile"];
58+
PFFileObject *applicantResume = anotherApplication[@"applicantResumeFile"];
5959
NSData *resumeData = [applicantResume getData];
6060
```
6161
```swift
@@ -73,7 +73,7 @@ You can easily store images by converting them to `NSData` and then using `PFFil
7373
<div class="language-toggle" markdown="1">
7474
```objective_c
7575
NSData *imageData = UIImagePNGRepresentation(image);
76-
PFFile *imageFile = [PFFileObject fileObjectWithName:@"image.png" data:imageData];
76+
PFFileObject *imageFile = [PFFileObject fileObjectWithName:@"image.png" data:imageData];
7777
7878
PFObject *userPhoto = [PFObject objectWithClassName:@"UserPhoto"];
7979
userPhoto[@"imageName"] = @"My trip to Hawaii!";
@@ -97,7 +97,7 @@ Retrieving the image back involves calling one of the `getData` variants on the
9797

9898
<div class="language-toggle" markdown="1">
9999
```objective_c
100-
PFFile *userImageFile = anotherPhoto[@"imageFile"];
100+
PFFileObject *userImageFile = anotherPhoto[@"imageFile"];
101101
[userImageFile getDataInBackgroundWithBlock:^(NSData *imageData, NSError *error) {
102102
if (!error) {
103103
UIImage *image = [UIImage imageWithData:imageData];
@@ -123,7 +123,7 @@ It's easy to get the progress of both uploads and downloads using `PFFileObject`
123123
<div class="language-toggle" markdown="1">
124124
```objective_c
125125
NSData *data = [@"Working at Parse is great!" dataUsingEncoding:NSUTF8StringEncoding];
126-
PFFile *file = [PFFile fileWithName:@"resume.txt" data:data];
126+
PFFileObject *file = [PFFileObject fileObjectWithName:@"resume.txt" data:data];
127127
[file saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
128128
// Handle success or failure here ...
129129
} progressBlock:^(int percentDone) {

_includes/ios/objects.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ So far we've used values with type `NSString`, `NSNumber`, and `PFObject`. Parse
544544
* Array => `NSArray`
545545
* Object => `NSObject`
546546
* Date => `NSDate`
547-
* File => `PFFile`
547+
* File => `PFFileObject`
548548
* Pointer => other `PFObject`
549549
* Relation => `PFRelation`
550550
* Null => `NSNull`
@@ -596,7 +596,7 @@ bigObject.saveInBackground()
596596
```
597597
</div>
598598

599-
We do not recommend storing large pieces of binary data like images or documents on `PFObject`. `PFObject`s should not exceed 128 kilobytes in size. We recommend you use `PFFile`s to store images, documents, and other types of files. You can do so by instantiating a `PFFile` object and setting it on a field. See [Files](#files) for more details.
599+
We do not recommend storing large pieces of binary data like images or documents on `PFObject`. `PFObject`s should not exceed 128 kilobytes in size. We recommend you use `PFFileObject`s to store images, documents, and other types of files. You can do so by instantiating a `PFFileObject` object and setting it on a field. See [Files](#files) for more details.
600600

601601
For more information about how Parse handles data, check out our documentation on [Data](#data).
602602

@@ -692,7 +692,7 @@ If you need more complicated logic than simple property access, you can declare
692692
}
693693
```
694694
```swift
695-
@NSManaged var iconFile: PFFile
695+
@NSManaged var iconFile: PFFileObject
696696

697697
func iconView() -> UIImageView {
698698
let view = PFImageView(imageView: PlaceholderImage)

_includes/ios/user-interface.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ A good starting point to learn more is to look at the [API for the class](http:/
567567

568568
### Loading Remote Images in Cells
569569

570-
`PFQueryTableViewController` makes it simple to display remote images stored in the Parse Cloud as `PFFile`s. All you need to do is to override `tableView:cellForRowAtIndexPath:object:` and return a `PFTableViewCell` with its `imageView`'s `file` property specified. If you would like to display a placeholder image to be shown before the remote image is loaded, assign the placeholder image to the `image` property of the `imageView`.
570+
`PFQueryTableViewController` makes it simple to display remote images stored in the Parse Cloud as `PFFileObject`s. All you need to do is to override `tableView:cellForRowAtIndexPath:object:` and return a `PFTableViewCell` with its `imageView`'s `file` property specified. If you would like to display a placeholder image to be shown before the remote image is loaded, assign the placeholder image to the `image` property of the `imageView`.
571571

572572
<div class="language-toggle" markdown="1">
573573
```objective_c
@@ -580,7 +580,7 @@ A good starting point to learn more is to look at the [API for the class](http:/
580580
}
581581
cell.textLabel.text = object[@"title"];
582582
583-
PFFile *thumbnail = object[@"thumbnail"];
583+
PFFileObject *thumbnail = object[@"thumbnail"];
584584
cell.imageView.image = [UIImage imageNamed:@"placeholder.jpg"];
585585
cell.imageView.file = thumbnail;
586586
return cell;
@@ -599,7 +599,7 @@ override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath:
599599
if let object = object {
600600
cell?.textLabel?.text = object["title"] as? String
601601
cell?.imageView?.image = UIImage(named: "placeholder.jpg")
602-
cell?.imageView?.file = object["thumbnail"] as? PFFile
602+
cell?.imageView?.file = object["thumbnail"] as? PFFileObject
603603
}
604604

605605
return cell
@@ -609,7 +609,7 @@ override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath:
609609

610610
<img data-echo="{{ site.baseUrl }}/assets/images/images_table.png" style="max-width:200px"/>
611611

612-
This table shows a list of cute animal photos which are stored in the Parse Cloud, as `PFFile`s. "placeholder.jpg" is an image included in the application bundle which is shown before the animal photos are downloaded.
612+
This table shows a list of cute animal photos which are stored in the Parse Cloud, as `PFFileObject`s. "placeholder.jpg" is an image included in the application bundle which is shown before the animal photos are downloaded.
613613

614614
The images are downloaded on demand. As you scroll through the table, the images in the currently visible cells are downloaded. This just-in-time behavior is desirable because not only does it conserve bandwidth, it also ensures timely display of visible images. If a more aggressive loading behavior is desired, you can use the `loadInBackground` method on `imageView` to download the image.
615615

@@ -657,13 +657,13 @@ When the user is offline or a Parse error was generated from a query, an alert c
657657

658658
## PFImageView
659659

660-
Many apps need to display images stored in the Parse Cloud as `PFFile`s. However, to load remote images with the built-in `UIImageView` involves writing many lines of boilerplate code. `PFImageView` simplifies this task:
660+
Many apps need to display images stored in the Parse Cloud as `PFFileObject`s. However, to load remote images with the built-in `UIImageView` involves writing many lines of boilerplate code. `PFImageView` simplifies this task:
661661

662662
<div class="language-toggle" markdown="1">
663663
```objective_c
664664
PFImageView *imageView = [[PFImageView alloc] init];
665665
imageView.image = [UIImage imageNamed:@"..."]; // placeholder image
666-
imageView.file = (PFFile *)someObject[@"picture"]; // remote image
666+
imageView.file = (PFFileObject *)someObject[@"picture"]; // remote image
667667
668668
[imageView loadInBackground];
669669
```
@@ -680,7 +680,7 @@ If assigned to, the `image` property is used to display a placeholder before the
680680

681681
## PFTableViewCell
682682

683-
Many apps need to display table view cells which contain images stored in the Parse Cloud as `PFFile`s. However, to load remote images with the built-in `UITableViewCell` involves writing many lines of boilerplate code. `PFTableViewCell` simplifies this task by exposing an `imageView` property of the type `PFImageView` that supports remote image loading:
683+
Many apps need to display table view cells which contain images stored in the Parse Cloud as `PFFileObject`s. However, to load remote images with the built-in `UITableViewCell` involves writing many lines of boilerplate code. `PFTableViewCell` simplifies this task by exposing an `imageView` property of the type `PFImageView` that supports remote image loading:
684684

685685
<div class="language-toggle" markdown="1">
686686
```objective_c
@@ -693,7 +693,7 @@ Many apps need to display table view cells which contain images stored in the Pa
693693
}
694694
cell.textLabel.text = object[@"title"];
695695
696-
PFFile *thumbnail = object[@"thumbnail"];
696+
PFFileObject *thumbnail = object[@"thumbnail"];
697697
cell.imageView.image = [UIImage imageNamed:@"placeholder.jpg"];
698698
cell.imageView.file = thumbnail;
699699
return cell;
@@ -712,7 +712,7 @@ func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexP
712712
if let title = object["title"] as? String {
713713
cell!.textLabel.text = title
714714
}
715-
if let thumbnail = object["thumbnail"] as? PFFile {
715+
if let thumbnail = object["thumbnail"] as? PFFileObject {
716716
cell!.imageView.image = UIImage(named: "placeholder.jpg")
717717
cell!.imageView.file = thumbnail
718718
}
@@ -722,7 +722,7 @@ func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexP
722722
```
723723
</div>
724724

725-
Like `UITableViewCell`, `PFTableViewCell` supports the default layout styles. Unlike `UITableViewCell`, `PFTableViewCell`'s `imageView` property is of the type `PFImageView`, which supports downloading remote images in `PFFile`.
725+
Like `UITableViewCell`, `PFTableViewCell` supports the default layout styles. Unlike `UITableViewCell`, `PFTableViewCell`'s `imageView` property is of the type `PFImageView`, which supports downloading remote images in `PFFileObject`.
726726

727727
Although it can be used independently, `PFTableViewCell` really shines when used in `PFQueryTableViewController`. `PFQueryTableViewController` knows about `PFTableViewCell` and loads the images automatically. This behavior is discussed in detail in the documentation for `PFQueryTableViewController`.
728728

0 commit comments

Comments
 (0)