# I have an issue on the memory warning

**URL:** <https://forums.kodeco.com/t/i-have-an-issue-on-the-memory-warning/16494>\
**Category:** Swift\
**Created:** [June 25, 2016, 2:00pm UTC](https://forums.kodeco.com/t/i-have-an-issue-on-the-memory-warning/16494 "2016-06-25T14:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![almass](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/almass/32/102075_2.png) [@almass](https://forums.kodeco.com/u/almass)\
**Post date:** [June 25, 2016, 2:00pm UTC](https://forums.kodeco.com/t/i-have-an-issue-on-the-memory-warning/16494/1 "2016-06-25T14:00:00Z")

</div>

hello everyone  
i have problem with my app i have create app photo lock please i have problem when i load all images from photo library in my collection view when i reduce the size of image the image display low resolution and the image not clear like photo in camera and when i increase the size image using PHImageManagaerMaximumSize i have received memory warning please any idea for increase image size for increase resolution photo like photo library in iPhone

and this is my code below

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) → UICollectionViewCell {  
let cell = myCollectionView.dequeueReusableCellWithReuseIdentifier(“Cell”, forIndexPath: indexPath) as! SelectImagesCollectionViewCell

```
        let asset = photoAsset[indexPath.row] as! PHAsset
    PHImageManager.defaultManager().requestImageForAsset(asset, targetSize: CGSize(width:350,height:350), contentMode: .AspectFit, options: nil) { (img:UIImage?, obj:[NSObject:AnyObject]?) in
        
            cell.imageViewCell.image = img
        }
    
   
    return cell
}

```

---

<div class="post-metadata">

**Author:** ![aeberbach](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/aeberbach/32/81494_2.png) [@aeberbach](https://forums.kodeco.com/u/aeberbach)\
**Post date:** [June 27, 2016, 1:25am UTC](https://forums.kodeco.com/t/i-have-an-issue-on-the-memory-warning/16494/2 "2016-06-27T01:25:25Z")

</div>

How many images are you loading into cells?

Isn’t 350x350 a lot larger than you would need to display in a cell?

---

<div class="post-metadata">

**Author:** ![almass](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/almass/32/102075_2.png) [@almass](https://forums.kodeco.com/u/almass)\
**Post date:** [June 27, 2016, 8:37am UTC](https://forums.kodeco.com/t/i-have-an-issue-on-the-memory-warning/16494/3 "2016-06-27T08:37:46Z")

</div>

all images from photo library depending on the phone picture this app photo vault i know 350 \* 350 is high quality but when i reduce to 105 \* 105 the image work fine but the image not quality(not clear) if i put 350 \* 350 the photo is quality but display to me the memory warning is have another way how can i get the images without memory warning

thank you
