Skip to content

Media Library #1: Grid and detail views#6842

Merged
frosty merged 5 commits intodevelopfrom
feature/media-library
Mar 9, 2017
Merged

Media Library #1: Grid and detail views#6842
frosty merged 5 commits intodevelopfrom
feature/media-library

Conversation

@frosty
Copy link
Contributor

@frosty frosty commented Mar 8, 2017

Related issues: #6817 and #4528

Here's our first PR towards adding Media Library functionality to WPiOS. The Media Library is currently feature flagged so it'll only show in debug mode.

This PR adds:

  • A Media row to Blog Details.
  • A grid view of media, using WPMediaPicker's collection view.
  • A detail view of an individual piece of media, including some metadata. Metadata should match Calypso and Android.
  • A zoomable preview of each image, accessible by tapping the image in the detail view.

media-all

What's not in here yet:

  • No results view if the user doesn't have any media items
  • Video preview
  • Editing metadata
  • Deleting items
  • Searching and filtering

Needs review: @kurzee

@frosty frosty added this to the 7.1 milestone Mar 8, 2017
@frosty frosty requested a review from kurzee March 8, 2017 15:26
@astralbodies astralbodies modified the milestones: 7.2, 7.1 Mar 8, 2017
self.imageView.image = self.image;
[self.media imageWithSize:CGSizeZero completionHandler:^(UIImage *result, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are using weakSelf several times it may be safer to first to convert to strongSelf.

[_imageView setImageWithURLRequest:[NSURLRequest requestWithURL:self.url]
placeholderImage:self.image
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
weakSelf.image = image;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are using weakSelf several times it may be safer to first to convert to strongSelf.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it'll matter here? If self has been dealloc'd (the view controller has gone away), then these will all just reference nil and nothing will happen.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur that we would want to allow for nil if deallocated via weakSelf.

@SergioEstevao
Copy link
Contributor

SergioEstevao commented Mar 9, 2017 via email

Copy link
Contributor

@kurzee kurzee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frosty everything looks good, nothing stands out, works well for what it is thus far! :shipit:

@frosty
Copy link
Contributor Author

frosty commented Mar 9, 2017

Cool, thanks @kurzee! More coming soon!

@frosty frosty merged commit 72e5c5c into develop Mar 9, 2017
@frosty frosty deleted the feature/media-library branch March 9, 2017 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants