Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a add photo Button when user is in limited photo mode #548

Merged
merged 5 commits into from Nov 5, 2020

Conversation

ruby109
Copy link
Contributor

@ruby109 ruby109 commented Nov 3, 2020

Add a add photo Button when user is in limited photo mode
当用户在限制图片的权限模式下,显示一个加号按钮,让用户调起 PHPicker 来选择新照片,仿新浪微博的设计
IMG_1303

@longitachi
Copy link
Owner

滑动选择的两处bug,-1 修改为 -self.offset

var i = beginIndexPath.row
while (minIsBegin ? i <= maxIndex : i >= minIndex) {
    if i != beginIndexPath.row {
        let p = IndexPath(row: i, section: 0)
        if !self.arrSlideIndexPaths.contains(p) {
            self.arrSlideIndexPaths.append(p)
            // let index = asc ? i : i - 1 修改为 let index = asc ? i : i - self.offset
            let index = asc ? i : i - self.offset
            let m = self.arrDataSources[index]
            self.dicOriSelectStatus[p] = m.isSelected
        }
    }
    i += (minIsBegin ? 1 : -1)
}

for path in self.arrSlideIndexPaths {
    // let index = asc ? path.row : path.row - 1 修改为 let index = asc ? path.row : path.row - self.offset
    let index = asc ? path.row : path.row - self.offset
    ...

@@ -757,12 +775,21 @@ extension ZLThumbnailViewController: UICollectionViewDataSource, UICollectionVie
return cell
}

if #available(iOS 14, *) {
Copy link
Owner

Choose a reason for hiding this comment

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

Add a condition: showAddPhotoCell.
设置不显示cameraCell且非limited权限下,升序排列时候会有显示addPhotoCell的bug

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已提交 commit

@longitachi longitachi merged commit 9ab162c into longitachi:master Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants