BastiaanJansen / toast-swift

Customizable Swift Toast view built with UIKit. 🍞
MIT License
467 stars 77 forks source link

Number of lines option #36

Closed efehelvaci closed 5 months ago

efehelvaci commented 11 months ago

It truncates the texts when they are too long. It would be good if we can set the number of lines in the config. Also, minimum scale factor can be useful too.

Especially needed when you don't use a subtitle but a long title.

Screenshot 2023-08-11 at 21 30 01

mehulparmar4ever commented 8 months ago

Any updates?

joshid commented 8 months ago

Have you tried Configuration to set number of lines in title and subtitle? default is 1 but you can modify it

AbdelrahmanShehab commented 7 months ago

how to add numberOfLines in ToastConfiguration?

BastiaanJansen commented 7 months ago

Number of lines is natively supported:

let toast = Toast.text("Safari pasted from Notes", viewConfig: .init(
    titleNumberOfLines: 2,
    subtitleNumberOfLines: 3
))
toast.show()