SCLAlertView-Swift icon indicating copy to clipboard operation
SCLAlertView-Swift copied to clipboard

How to add custom image to icon using custom alert?

Open LukeSmith16 opened this issue 8 years ago • 2 comments

I can't seem to get this working, every time i try and do it, it only fills up half the alert icon size. I've tried different sizes but nothing works.

LukeSmith16 avatar Feb 14 '17 14:02 LukeSmith16

I have faced similar issue. I looked into the source code and find out that images are drawn programmatically using UIBezierPath and their size is 80x80 (which I think is important in this particular implementation). For myself I solved the issue by drawing the image using vector graphics.

Have a look at SCLAlertView class. You may find answers for your question there, since original implementation uses this class to generate icons.

eleev avatar Feb 15 '17 11:02 eleev

Change kCircleIconHeight variable in the SCLAppearance

For Example:

let appearance = SCLAlertView.SCLAppearance(
            kCircleIconHeight: 55.0,
            kTitleFont: UIFont(name: "Avenir-Light", size: 16)!,
            kTextFont: UIFont(name: "Avenir-Light", size: 14)!,
            kButtonFont: UIFont(name: "Avenir", size: 14)!,
            showCloseButton: false
        )

keegho avatar Apr 29 '17 21:04 keegho