Skip to content

Commit e25db31

Browse files
committed
SE-0005: Clean up names in initial example
1 parent 2fdf305 commit e25db31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proposals/0005-objective-c-name-translation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ type inference, generics, and overloading. As a result, Objective-C
4242
APIs that feel right in Objective-C can feel wordy when used in
4343
Swift. For example:
4444

45-
let contentString = listItemView.stringValue.stringByTrimmingCharactersInSet(
45+
let content = listItemView.text.stringByTrimmingCharactersInSet(
4646
NSCharacterSet.whitespaceAndNewlineCharacterSet())
4747

4848
The APIs used here follow the Objective-C guidelines. A more "Swifty"
4949
version of the same code might instead look like this:
5050

51-
let content = listItem.stringValue.trimming(.whitespaceAndNewlines)
51+
let content = listItemView.text.trimming(.whitespaceAndNewlines)
5252

5353
The latter example more closely adheres to the [Swift API Design
5454
Guidelines][api-design-guidelines], in particular, omitting "needless"

0 commit comments

Comments
 (0)