[swift-evolution] Some clarity lost from the great renaming

Dennis Lysenko dennis.s.lysenko at gmail.com
Tue Oct 18 21:33:49 CDT 2016


Agree on this particular case being unintuitive. I've come across a number
of such cases in Swift 3 but never really put too much thought into them.
Maybe you could just use for: UIControlState.normal until a resolution for
this is found (if there is one).

On Tue, Oct 18, 2016 at 10:32 PM Dennis Lysenko <dennis.s.lysenko at gmail.com>
wrote:

> I think if it's one example like in this instance then a compiler
> directive to specify mapping if one does not already exist would be a more
> prudent option than changing the entire mapping.
>
> On Tue, Oct 18, 2016 at 9:51 PM Hooman Mehr via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> Is changing the mapping of Cocoa API considered a source breaking change
> or can we report such incidents as bugs if we think they don’t match API
> guidelines?
>
> On Oct 18, 2016, at 6:43 PM, Dave Abrahams via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>
> on Tue Oct 18 2016, Brandon Knope <swift-evolution at swift.org> wrote:
>
> I meant to bring this up a bit ago but just came across it again.
>
> I find this to not read properly:
>
> button.setTitle("Test", for: .normal) //for normal what?
>
> The for argument is really only clear in meaning when you are typing
> it out and see that it is a UIControlState type. While reading it
> without this context is it as clear? .normal doesn't seem descriptive
> enough on its own.
>
> Contrast this with UISegmentedControl:
> segmented.dividerImage(forLeftSegmentState: .normal, rightSegmentState:
> .normal, barMetrics:
> .default)
>
> Here the parameter labels are needed because there needs to be a
> distinction in the method between left and right. But here it is not
> forLeft: or forRight: it is the much more clear forLeftSegmentState:
>
> So my question is: why was this not setTitle(forControlState:) or
> forButtonState, etc...?
>
>
> This is really not an evolution question at this point.  I suggest
> filing radars against UIKit for things whose names could be improved.
>
> --
> -Dave
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161019/fffbe10e/attachment.html>


More information about the swift-evolution mailing list