Я делаю приложение для iOS, используя Swift и Parse.com
Я пытаюсь позволить пользователю выбрать изображение из подборщика изображений, а затем изменить размер выбранного изображения до 200x200 пикселей перед загрузкой на мой сервер.
В Parse.com есть учебник для приложения для копирования Instagram под названием "AnyPic", который дает этот код для изменения размеров изображений, но он находится в Objective-C....
// Resize the image to be square (what is shown in the preview)
UIImage *resizedImage = [anImage resizedImageWithContentMode:UIViewContentModeScaleAspectFit
bounds:CGSizeMake(560.0f, 560.0f)
interpolationQuality:kCGInterpolationHigh];
// Create a thumbnail and add a corner radius for use in table views
UIImage *thumbnailImage = [anImage thumbnailImage:86.0f
transparentBorder:0.0f
cornerRadius:10.0f
interpolationQuality:kCGInterpolationDefault];
Как мне создать 200x200px версию выбранного изображения (чтобы потом загрузить) в Swift?
И что делает функция thumbnailImage?