dogo / SCLAlertView

Beautiful animated Alert View. Written in Objective-C
MIT License
3.5k stars 534 forks source link

Use the builder pattern to build a SCLAlertView? #256

Closed Sweeper777 closed 6 years ago

Sweeper777 commented 7 years ago

The constructor of SCLAlertView.SCLAppearance is really long. When it is shown in Xcode's autocomplete thingy, I can't see what each parameter's name is and I can't select only the few parameters that I need either.

I suggest that there should be a builder class for SCLAlertView, so this code:

SCLAlertView(appearance: SCLAlertView.SCLAppearance(showCloseButton: false))

can just be

SCLAlertViewBuilder()
    .showCloseButton(false)
    .build()

This way, when you type . Xcode will tell you what options there are and it is easy to scroll through them or start typing and let Xcode guess which one you want.

Is this a good idea?

dogo commented 6 years ago

@Sweeper777 Please read the Fluent style section