Skip to content

Commit

Permalink
fix bug for cache
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoyuexit committed Oct 30, 2017
1 parent fc83b0e commit 2f0dac1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion LPAlbum.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "LPAlbum"
s.version = "0.0.3"
s.version = "0.0.4"
s.summary = "Can a decent enough photo album, photo album multi-select"

s.homepage = "https://github.com/loopeer/LPAlbum"
Expand Down
7 changes: 4 additions & 3 deletions LPAlbum/Controllers/LPAlbum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ public class LPAlbum: UIViewController {
let itemSize = (self.collectionView.collectionViewLayout as! UICollectionViewFlowLayout).itemSize
let scale = UIScreen.main.scale
let targetSize = CGSize(width: itemSize.width * scale, height: itemSize.height * scale)
AlbumManager.imageManager.startCachingImages(for: self.allAssets, targetSize: targetSize, contentMode: .aspectFill, options: nil)

DispatchQueue.global().async {
AlbumManager.imageManager.startCachingImages(for: self.allAssets, targetSize: targetSize, contentMode: .aspectFill, options: nil)
}
}
}

Expand Down Expand Up @@ -233,7 +234,7 @@ extension LPAlbum: UICollectionViewDelegate, UICollectionViewDataSource {
var newModel = model
newModel.isSelect = !$0
self.albumModels = self.albumModels.change(assetModel: newModel)
self.collectionView.reloadItems(at: [indexPath])
UIView.performWithoutAnimation { self.collectionView.reloadItems(at: [indexPath]) }
}
if #available(iOS 9.0, *) {
guard traitCollection.forceTouchCapability == .available else { return cell }
Expand Down
4 changes: 2 additions & 2 deletions LPAlbum/Controllers/PhotosBrowerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class PhotosBrowerController: UIViewController {
super.viewDidLoad()
setupUI()
refreshNavigation()
addCache()
// addCache()
}

deinit {
print("\(self) deinit")
removeCache()
// removeCache()
}
}

Expand Down
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public extension LPAlbum {
public static var normalBox: UIImage = Bundle.imageFromBundle("circle_normal")!
/// 选中的选择框图片
public static var selectedBox: UIImage = Bundle.imageFromBundle("circle_selected")!
/// 选择框box的可点击区域向外的扩展size
public static var boxEdgeInsets = UIEdgeInsets(top: -5, left: -5, bottom: -5, right: -5)
}
}

Expand Down Expand Up @@ -132,7 +134,7 @@ Specify LPAlbum into your project's Podfile:
```ruby
# source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'
platform :ios, '9.0'
use_frameworks!

target '<Your App Target>' do
Expand All @@ -148,19 +150,6 @@ $ pod install
```


### 2. Carthage

[Carthage](https://github.com/Carthage/Carthage) is a simple, decentralized
dependency manager for Cocoa.

Specify LPAlbum into your project's Carthage:


```
github "loopeer/LPAlbum" ~> 1.0.1
```




Expand Down

0 comments on commit 2f0dac1

Please sign in to comment.