honkmaster / TTProgressHUD

TTProgressHUD is a light weight HUD written in SwiftUI meant to display the progress of an ongoing task on iOS.

Home Page:https://github.com/honkmaster/TTProgressHUD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Title customization

Vortec4800 opened this issue · comments

I really like this library, except for the text. Right now the font is a bit large and limited to 1 or 2 lines depending on the label, and I wish it had a bit more flexibility. A way to change the font size, or the line limit, or both. Is this something you would be interested in allowing as a configuration option?

Hi Cory. For sure, a little more customization would be nice. However, my first idea was a HUD that resembles the system one as close as possible. Maybe, we could introduce a "styles" enum, e.g. .system and .custom with corresponding options.

@honkmaster Hey. I've made some changes after seeing this thread. I've put an labelStyle enum for .system and .custom for customization. TTProgressHUDConfig will look like this. If you wish to accept these changes, I would love to create a pull request for this.

    @State var hudConfig = TTProgressHUDConfig(
        title: "This is title",
        caption: "This is caption",
        labelStyle: .custom,
        titleFont: .custom("Optima", size: 30.0),
        titleLineLimit: 3,
        captionFont: .custom("Optima", size: 14.0),
        captionLineLimit: 2,
        allowsTapToHide: true
    )

Screen Shot 2022-08-22 at 5 49 08 PM