Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call super's designated initializer on initialization #379

Merged
merged 1 commit into from
Oct 17, 2019

Conversation

Theome
Copy link
Contributor

@Theome Theome commented Sep 30, 2019

The initializer initWithCroppingStyle:image: calls a super initializer that is not a designated initializer. This leads to a crash on initialization of subclasses implemented in Swift that don't provide a custom init().

To reproduce the issue, create a subclass in Swift as follows:

class CropViewController: TOCropViewController {
  init(image: UIImage) {
    super.init(croppingStyle: .default, image: image)
  }
  /* ... */
}

A call to init(image:) will throw an exception.

The PR fixes this issue.

@TimOliver
Copy link
Owner

Ah! Sorry for the delay! I had no idea those kinds of Swift issues existed. Thanks so much for that!

I'm collecting all of the bugs people have reported so far and will try and ship a new release soon.

@TimOliver TimOliver merged commit 022ab93 into TimOliver:master Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants