1

Im trying to use RSKImageCropper in my Swift project but dont know how. I have an Bridging-header file with this line of code

#import "RSKImageCropViewController.h"

In my Controller i can create an instance of RSKImageCropViewController like this

let imageCropVC = RSKImageCropViewController()

but after that, i cant get it to work. When calling imageCropVC.initWithImage() i get an error. Im trying to convert the example Objectiv-C methode on the github page to Swift.

What am i doing wrong? Is it even possible to use this library in my Swift project? It would be nice if someone could post the right code in Swift.

Thanks

4

1 回答 1

4

let imageCropVC = RSKImageCropViewController()

您正在使用该init方法初始化控制器。

所以你不能initWithImage()在这个实例上使用该方法imageCropVC,因为它意味着再次初始化它。

你想要的是用图像初始化一个新的控制器:

let imageCropVC = RSKImageCropViewController(image: yourImage)
于 2015-04-17T16:15:38.777 回答