Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Example/RMImagePickerExample/ImagesViewController.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ImagesViewController: UICollectionViewController, RMImagePickerControllerD
}

override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as UICollectionViewCell
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! UICollectionViewCell

// Configure the cell
let asset = self.assets[indexPath.item]
Expand All @@ -63,7 +63,7 @@ class ImagesViewController: UICollectionViewController, RMImagePickerControllerD
contentMode: PHImageContentMode.AspectFit,
options: nil,
resultHandler: { (image, info) -> Void in
let imageView = cell.viewWithTag(cellImageViewTag) as UIImageView
let imageView = cell.viewWithTag(cellImageViewTag) as! UIImageView
imageView.image = image
})
return cell
Expand Down
Empty file modified Source/Info.plist
100644 → 100755
Empty file.
Empty file modified Source/RMAlbumCell.swift
100644 → 100755
Empty file.
Empty file modified Source/RMAlbumCell.xib
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions Source/RMAlbumPickerController.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ class RMAlbumPickerController: UITableViewController, RMAssetSelectionDelegate,
if let reCell = tableView.dequeueReusableCellWithIdentifier(albumCellIdentifier, forIndexPath: indexPath) as? RMAlbumCell {
cell = reCell
} else {
cell = NSBundle(forClass: RMAlbumPickerController.self).loadNibNamed("RMAlbumCell", owner: self, options: nil)[0] as RMAlbumCell
cell = NSBundle(forClass: RMAlbumPickerController.self).loadNibNamed("RMAlbumCell", owner: self, options: nil)[0] as! RMAlbumCell
}

// Increment the cell's tag
let currentTag = cell.tag + 1
cell.tag = currentTag

// Configure the cell...
let collection = self.allCollections[indexPath.section][indexPath.row] as PHAssetCollection
let collection = self.allCollections[indexPath.section][indexPath.row] as! PHAssetCollection
var assetsCount: Int
var keyAssets: PHFetchResult!
if collection.assetCollectionType == .SmartAlbum {
Expand All @@ -131,7 +131,7 @@ class RMAlbumPickerController: UITableViewController, RMAssetSelectionDelegate,
for (idx, poster) in enumerate(cell.posterImgs) {
if idx < keyAssets.count {
self.imageManager.requestImageForAsset(
keyAssets[idx] as PHAsset,
keyAssets[idx] as! PHAsset,
targetSize: CGSizeMake(imageWidth, imageHeight),
contentMode: .AspectFill,
options: nil,
Expand All @@ -157,7 +157,7 @@ class RMAlbumPickerController: UITableViewController, RMAssetSelectionDelegate,
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let phFetchOptions = PHFetchOptions()
phFetchOptions.predicate = NSPredicate(format: "mediaType = %i", PHAssetMediaType.Image.rawValue)
let collection = self.allCollections[indexPath.section][indexPath.row] as PHAssetCollection
let collection = self.allCollections[indexPath.section][indexPath.row] as! PHAssetCollection
let assets = PHAsset.fetchAssetsInAssetCollection(collection, options: phFetchOptions)
if assets.count > 0 {
let picker = RMAssetCollectionPicker()
Expand Down
Empty file modified Source/RMAssetCell.swift
100644 → 100755
Empty file.
18 changes: 9 additions & 9 deletions Source/RMAssetCollectionPicker.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class RMAssetCollectionPicker: UICollectionViewController, PHPhotoLibraryChangeO
}
}

convenience override init() {
convenience init() {
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = UICollectionViewScrollDirection.Vertical
layout.minimumInteritemSpacing = AssetsSpacing
Expand All @@ -62,7 +62,7 @@ class RMAssetCollectionPicker: UICollectionViewController, PHPhotoLibraryChangeO
self.init(collectionViewLayout: layout)
}

override init(collectionViewLayout layout: UICollectionViewLayout!) {
override init(collectionViewLayout layout: UICollectionViewLayout) {
super.init(collectionViewLayout: layout)
self.imageManager = PHCachingImageManager()
self.resetCachedAssets()
Expand All @@ -82,7 +82,7 @@ class RMAssetCollectionPicker: UICollectionViewController, PHPhotoLibraryChangeO
self.collectionView?.allowsMultipleSelection = true

let scale = UIScreen.mainScreen().scale
let cellSize = (self.collectionViewLayout as UICollectionViewFlowLayout).itemSize
let cellSize = (self.collectionViewLayout as! UICollectionViewFlowLayout).itemSize
AssetGridThumbnailSize = CGSize(width: cellSize.width * scale, height: cellSize.height * scale)

let doneButtonItem = UIBarButtonItem(
Expand All @@ -103,13 +103,13 @@ class RMAssetCollectionPicker: UICollectionViewController, PHPhotoLibraryChangeO
)
let selectAllItem = UIBarButtonItem(
title: NSLocalizedString("Select all", comment: ""),
style: UIBarButtonItemStyle.Bordered,
style: UIBarButtonItemStyle.Plain,
target: self,
action: "selectAllAction:"
)
let deselectAllItem = UIBarButtonItem(
title: NSLocalizedString("Deselect all", comment: ""),
style: UIBarButtonItemStyle.Bordered,
style: UIBarButtonItemStyle.Plain,
target: self,
action: "deselectAllAction:"
)
Expand Down Expand Up @@ -157,13 +157,13 @@ class RMAssetCollectionPicker: UICollectionViewController, PHPhotoLibraryChangeO
}

override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as RMAssetCell
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! RMAssetCell

// Increment the cell's tag
let currentTag = cell.tag + 1
cell.tag = currentTag

let asset: PHAsset! = self.assetsFetchResult[indexPath.item] as PHAsset
let asset: PHAsset! = self.assetsFetchResult[indexPath.item] as! PHAsset
self.imageManager.requestImageForAsset(
asset,
targetSize: AssetGridThumbnailSize,
Expand Down Expand Up @@ -311,7 +311,7 @@ class RMAssetCollectionPicker: UICollectionViewController, PHPhotoLibraryChangeO
func assetsAtIndexPaths(indexPaths: [NSIndexPath]) -> [PHAsset] {
var assets: [PHAsset] = []
for indexPath in indexPaths {
assets.append(self.assetsFetchResult[indexPath.item] as PHAsset)
assets.append(self.assetsFetchResult[indexPath.item] as! PHAsset)
}
return assets
}
Expand Down Expand Up @@ -344,7 +344,7 @@ class RMAssetCollectionPicker: UICollectionViewController, PHPhotoLibraryChangeO
func doneAction(sender: AnyObject) {
var selectedAssets: [PHAsset] = []
for ip in self.collectionView!.indexPathsForSelectedItems() {
selectedAssets.append(self.assetsFetchResult[ip.item] as PHAsset)
selectedAssets.append(self.assetsFetchResult[ip.item] as! PHAsset)
}
assetsParent?.selectedAssets(selectedAssets)
}
Expand Down
Empty file modified Source/RMImagePicker.h
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion Source/RMImagePickerController.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class RMImagePickerController: UINavigationController, RMAssetSelectionDe
super.init(rootViewController: rootViewController)
}

public override convenience init() {
public convenience init() {
var albumController = RMAlbumPickerController()
self.init(rootViewController: albumController)
albumController.assetsParent = self
Expand Down
Empty file modified Source/RMImages.xcassets/tick_deselected.imageset/Contents.json
100644 → 100755
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Source/RMImages.xcassets/tick_selected.imageset/Contents.json
100644 → 100755
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Source/RMPlaceholderView.xib
100644 → 100755
Empty file.