SCLAlertView-Swift
SCLAlertView-Swift copied to clipboard
kButtonHeight not working
I have searched through example and wiki but couldn't find anything. The problem is that following code is not working on button height:
let appearance = SCLAlertView.SCLAppearance(
kWindowWidth: 275,
kTitleFont: UIFont(name: "SourceSansPro-Regular", size: 24)!,
kTitleTop: 40,
kTitleHeight: 40,
kButtonHeight: 60,
kTextFont: UIFont(name: "SourceSansPro-Light", size: 16)!,
kButtonFont: UIFont(name: "SourceSansPro-Semibold", size: 18)!,
buttonCornerRadius: 0,
showCloseButton: false,
shouldAutoDismiss: false,
showCircularIcon: false
)
let alert = SCLAlertView(appearance: appearance)
I have 2 buttons. If I increase kButtonHeight from 40 to 60 I can see that padding between 2 buttons has increased (that means button height was changed right?) but the button stays the same size. Look at screenshots below.

Also is there any way to set padding to left and right for the text under title?
Thanks for help and btw, awesome lib!
+1. kButtonHeight is treated as the button's height + margins, and the actual button height is hardcoded to 35 pts. We should have a separate parameter for the margins and the button height itself. I am working on a project for the elderly, and 35 pts is too small of a touch target for them.
A size of 35pts for a touch target also directly violates the Apple Human Interface Guidelines which state:
Provide ample spacing for interactive elements. Try to maintain a minimum tappable area of 44pt x 44pt for all controls.
I forked a branch that fixes this issue, and submitted a pull request that fixes this issue. Hopefully it will be accepted for you soon.