# Some clarity lost from the great renaming

**URL:** <https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301>\
**Category:** Discussion\
**Created:** [October 18, 2016, 11:59pm UTC](https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301 "2016-10-18T23:59:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandon\_Knope](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/brandon_knope/32/299_2.png) [@Brandon\_Knope](https://forums.swift.org/u/Brandon_Knope)\
**Post date:** [October 18, 2016, 11:59pm UTC](https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301/1 "2016-10-18T23:59:47Z")

</div>

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...?

Brandon

> **···**
>
> Sent from my iPad

---

<div class="post-metadata">

**Author:** ![dabrahams](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dabrahams/32/9815_2.png) [@dabrahams](https://forums.swift.org/u/dabrahams)\
**Post date:** [October 19, 2016, 1:43am UTC](https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301/2 "2016-10-19T01:43:18Z")

</div>

This is really not an evolution question at this point. I suggest  
filing radars against UIKit for things whose names could be improved.

> **···**
>
> on Tue Oct 18 2016, Brandon Knope \<swift-evolution@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...?
> 
> --  
> -Dave

---

<div class="post-metadata">

**Author:** ![hooman](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/hooman/32/43536_2.png) [@hooman](https://forums.swift.org/u/hooman)\
**Post date:** [October 19, 2016, 1:51am UTC](https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301/3 "2016-10-19T01:51:22Z")

</div>

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@swift.org\> wrote:
> > 
> > on Tue Oct 18 2016, Brandon Knope \<swift-evolution@swift.org \<mailto:swift-evolution@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@swift.org \<mailto:swift-evolution@swift.org\>  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

<div class="post-metadata">

**Author:** ![Charles\_Srstka](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@Charles\_Srstka](https://forums.swift.org/u/Charles_Srstka)\
**Post date:** [October 19, 2016, 2:36am UTC](https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301/4 "2016-10-19T02:36:52Z")

</div>

They can always add the new mapping, and leave the old one there but deprecate it.

Charles

> **···**
>
> > On Oct 18, 2016, at 8:51 PM, Hooman Mehr via swift-evolution \<swift-evolution@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@swift.org \<mailto:swift-evolution@swift.org\>\> wrote:
> > > 
> > > on Tue Oct 18 2016, Brandon Knope \<swift-evolution@swift.org \<mailto:swift-evolution@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@swift.org \<mailto:swift-evolution@swift.org\>  
> > > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

<div class="post-metadata">

**Author:** ![dennislysenko](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dennislysenko/32/41738_2.png) [@dennislysenko](https://forums.swift.org/u/dennislysenko)\
**Post date:** [October 19, 2016, 2:33am UTC](https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301/5 "2016-10-19T02:33:00Z")

</div>

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@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@swift.org\> wrote:
> > 
> > on Tue Oct 18 2016, Brandon Knope \<swift-evolution@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@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

<div class="post-metadata">

**Author:** ![dabrahams](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dabrahams/32/9815_2.png) [@dabrahams](https://forums.swift.org/u/dabrahams)\
**Post date:** [October 19, 2016, 4:52pm UTC](https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301/6 "2016-10-19T16:52:08Z")

</div>

> 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?

You can report them as bugs even if it would be source breaking.

> **···**
>
> on Tue Oct 18 2016, Hooman Mehr \<hooman-AT-mac.com\> wrote:
> 
> > > On Oct 18, 2016, at 6:43 PM, Dave Abrahams via swift-evolution \<swift-evolution@swift.org\> wrote:
> > > 
> > > on Tue Oct 18 2016, Brandon Knope \<swift-evolution@swift.org \<mailto:swift-evolution@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@swift.org \<mailto:swift-evolution@swift.org\>  
> > > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> > 
> > \<[https://lists.swift.org/mailman/listinfo/swift-evolution&gt](https://lists.swift.org/mailman/listinfo/swift-evolution&gt);
> 
> --  
> -Dave

---

<div class="post-metadata">

**Author:** ![Brandon\_Knope](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/brandon_knope/32/299_2.png) [@Brandon\_Knope](https://forums.swift.org/u/Brandon_Knope)\
**Post date:** [October 19, 2016, 3:13pm UTC](https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301/7 "2016-10-19T15:13:24Z")

</div>

Sorry! I was unsure if this would be a breaking change so thought I would seek feedback.

It sounds like I'm not the only one bothered by this so I will file a radar

Brandon

> **···**
>
> Sent from my iPad
> 
> > On Oct 18, 2016, at 9:43 PM, Dave Abrahams via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > > on Tue Oct 18 2016, Brandon Knope \<swift-evolution@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@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

<div class="post-metadata">

**Author:** ![dduan](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dduan/32/290_2.png) [@dduan](https://forums.swift.org/u/dduan)\
**Post date:** [October 19, 2016, 7:29pm UTC](https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301/8 "2016-10-19T19:29:49Z")

</div>

I wrote a script to find “needless words” in our function names and made a similar discovery. If “doXWithY(\_ y: Y)” gets renamed to “doX(with y: Y)” and Y happened to be a enum or have static members, at use site it become a little awkward. Following Brandon’s first example:

1. “normal” is an adjective, and preposition followed by adjective (“for normal”, “to default”, “with misc”) is ungrammatical. It’s very common to have enum cases being an adjective.  
2. if the argument is a literal value (as opposed to a variable), the type information is not immediately obvious at use site. The function reads better if the enum type prefix is preserved: `botton.setTitle(“Test”, for: UIControlState.normal)`.

In these cases, we chose to preserve the words after the preposition to make the call site clearer.

These aren’t problems from the API Design Guideline. They should be considered carefully case by case. And yeah, not really something we can fix on this list :)

> **···**
>
> > On Oct 18, 2016, at 6:43 PM, Dave Abrahams via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > on Tue Oct 18 2016, Brandon Knope \<swift-evolution@swift.org \<mailto:swift-evolution@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@swift.org \<mailto:swift-evolution@swift.org\>  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

<div class="post-metadata">

**Author:** ![dennislysenko](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dennislysenko/32/41738_2.png) [@dennislysenko](https://forums.swift.org/u/dennislysenko)\
**Post date:** [October 19, 2016, 2:33am UTC](https://forums.swift.org/t/some-clarity-lost-from-the-great-renaming/4301/9 "2016-10-19T02:33:49Z")

</div>

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@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@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@swift.org\> wrote:
> > 
> > on Tue Oct 18 2016, Brandon Knope \<swift-evolution@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@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
