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

Message in alert is getting truncated #29

Closed
Kalikanth opened this issue Nov 6, 2017 · 8 comments
Closed

Message in alert is getting truncated #29

Kalikanth opened this issue Nov 6, 2017 · 8 comments

Comments

@Kalikanth
Copy link

Kalikanth commented Nov 6, 2017

In my app presenting an alert but the message getting truncated to one line

let alert = CDAlertView(title: title, message: message, type: CDAlertViewType.error)
let okay = CDAlertViewAction(title: "OK", font: nil, textColor: nil, backgroundColor: nil) { (action) in
}
alert.add(action: okay)
alert.show()

screen shot 2017-11-06 at 9 16 06 pm

@candostdagdeviren
Copy link
Owner

candostdagdeviren commented Nov 6, 2017

Hello @Kalikanth, thanks for the issue! Which iOS and CDAlertView version do you use?

@Kalikanth
Copy link
Author

Kalikanth commented Nov 6, 2017

@candostdagdeviren I'm using the latest version of CDAlertView (swift 4)and device is iPhone 6(11.0) xcode 9.1

@Kalikanth
Copy link
Author

What may be the issue. In other projects Default UIAlertController is working fine but after removing the CDAlertView. The UIAlertController also started truncating. How to overcome this please help this is very urgent.

@candostdagdeviren
Copy link
Owner

simulator screen shot - iphone 6 - 2017-11-07 at 07 01 03

I tried your code on iPhone 6, iOS 11.1 and it's working. Do you do extra customizations or something else that can override UILabel's numberOfLines property?

@Kalikanth
Copy link
Author

i didn't do any customizations i'm not getting what's the problem what i obeserved is UILabels text is also getting truncated. How can set the this to default of UILabel

@candostdagdeviren
Copy link
Owner

as you can see in here for message label: https://github.com/candostdagdeviren/CDAlertView/blob/master/CDAlertView/Classes/CDAlertView.swift#L578

and here for title label: https://github.com/candostdagdeviren/CDAlertView/blob/master/CDAlertView/Classes/CDAlertView.swift#L569

We set numberOfLines to 0. It shouldn't truncate. Do you have any extension of UILabel that can override this or something else which can cause this? Because I'm not able to reproduce the bug. Maybe you don't do any customizations for CDAlertView but you may customize UILabel's properties or something else. This is the only thing that comes to my mind.

@Kalikanth
Copy link
Author

Yeah! I got the issue i was overriding the UILabel Property that is the reason for this strange behaviour. Thank you @candostdagdeviren

@candostdagdeviren
Copy link
Owner

Good to see that you've solved! Closing the issue :)

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

No branches or pull requests

2 participants