Textcat / JLStickerTextView

add text(multiple line support) to imageView, edit, rotate or resize them as you want, then render the text on image
MIT License
489 stars 72 forks source link

Issue: failed on runtime #10

Open ItsMeMIHIR opened 7 years ago

ItsMeMIHIR commented 7 years ago

I tried to run . I followed both approach (the manual and the Pod) both were unsuccessful.

I use Xcode 8 and swift 3.

i got error in limitImageViewToSuperView() function about image height , width condition failure

this is Issue i found in stickerImageView.swift

public func limitImageViewToSuperView() {
        if self.superview == nil {
            return
        }
        self.translatesAutoresizingMaskIntoConstraints = true
        let imageSize = self.image?.size
        let aspectRatio = imageSize!.width / imageSize!.height // here i got error because of imageSize is nil
        if Float((imageSize?.width)!) > Float((imageSize?.height)!) {
            self.bounds.size.width = self.superview!.bounds.size.width
            self.bounds.size.height = self.superview!.bounds.size.width / aspectRatio
        }else {
            self.bounds.size.height = self.superview!.bounds.size.height
            self.bounds.size.width = self.superview!.bounds.size.height * aspectRatio
        }
    }
khushDesai commented 7 years ago

Have you solved this issue ? @ItsMeMIHIR