0

I have an app where I pick an image using UIImagePickerController. I want to save this image in the app and use to populate a set of UIImageViews. The app is universal. Once user selects the image, it is used as an image in a UITableViewCell as the contentView's UIImage as a square image that takes up the entire contentView

The questions I have are

  • How do I handle resolution? Does UIImageView and its scaling properties handle it or do I have to up/down rez based on Display Scale and Trait Collection?

  • How does UIImageAsset play into this? Is it necessary to use?

noobsmcgoobs
  • 2,716
  • 5
  • 32
  • 52

1 Answers1

0

If you want to handle resolution, it is in your hands. You can resize the image if you want to. UIImageView will only handle how the image appears to the user, but it will not alter the image size.

UIImageAsset has nothing to do in this scenario.

From Documentation:

A common use case for UIImageAsset is the grouping of multiple images of the same item at different display scales.

For more explanation about UIImageAsset.

After you select the image from the picker, you store in your data source and you reload the tableview to display the new image.

Community
  • 1
  • 1
Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109
  • @MrT Correct me I'm wrong, you're saying the image stays the same size regardless of display or trait collection, but that I can use UIImageView's scaling to present it how I want? *If* I resized for each device, at that point would `UIImageAsset` be an option? – noobsmcgoobs Jan 03 '16 at 02:28
  • UIImageAsset can never be your option. It is the same thing as the image assets folder in your Xcode project. – Teja Nandamuri Jan 03 '16 at 02:29
  • Yes, regardless of size, image view displays the image and image stays in the same size unless u change it – Teja Nandamuri Jan 03 '16 at 02:30