Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Limited Photo Library Access Draft #278

Merged
merged 13 commits into from
Sep 18, 2020
Merged

Conversation

Twigz
Copy link
Member

@Twigz Twigz commented Sep 16, 2020

No description provided.

Copy link
Contributor

@mliberatore mliberatore left a comment

Choose a reason for hiding this comment

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

Overall working pretty well. Probably goes without saying, but when this gets opened, please revert the pod and example app changes.

RequestScreenshotCell.swift Outdated Show resolved Hide resolved
RequestScreenshotCell.swift Outdated Show resolved Hide resolved
return
}

super.addSubview(view)
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that we’re doing this in ScreenshotCell too, but I’m not sure why we’re not just setting the table view’s separator style to none 🤔. Not necessary to fix for this issue, but I think we should investigate / refactor that later.

RequestScreenshotCell.swift Outdated Show resolved Hide resolved
let pickerController = PHPickerViewController(configuration: .init(photoLibrary: .shared()))
pickerController.delegate = self

viewController.present(pickerController, animated: true, completion: nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any way to limit this to just screenshots via the configuration (none that I’ve seen so far, but maybe there’s an API for a predicate (like we use in screenshot detector) that I’ve missed)? At the very least, we should apply the PHPickerFilter for images, as you can currently select videos and live photos.

Copy link
Member Author

Choose a reason for hiding this comment

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

I limited it using the filter, but through this API, I'm not sure there's a better way.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, not really.

private lazy var requestScreenshotButton: UIButton = {
let button = UIButton(type: .system)
button.translatesAutoresizingMaskIntoConstraints = false
button.layer.cornerRadius = DesignConstants.buttonHeight / 2.0
Copy link
Contributor

Choose a reason for hiding this comment

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

We’re no longer using buttonHeight. We may want to just use a constant corner radius that looks good, or apply the corner radius in layoutSubviews() with the actual button’s height.

}

private enum DesignConstants {
static let buttonHeight: CGFloat = 54.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be removed after the corner radius is addressed.

@Twigz Twigz marked this pull request as ready for review September 17, 2020 20:50
@mbbischoff mbbischoff self-requested a review September 17, 2020 20:50
let pickerController = PHPickerViewController(configuration: .init(photoLibrary: .shared()))
pickerController.delegate = self

viewController.present(pickerController, animated: true, completion: nil)
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, not really.

@Twigz Twigz merged commit 0eaa38e into master Sep 18, 2020
@Twigz Twigz deleted the limited-photo-library-access branch September 18, 2020 17:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants