Trying to learn swift 3 renamification (as mattn calls it!)

While rebuilding some apps using the new development trunk build, I figured out the naming changes to just about everything but this:

let string = "Here is a string"
    
string.drawWithRect(CGRect(x: 10, y: 10, width: 200, height: 200), options: .usesLineFragmentOrigin, attributes: attrs, context: nil)

Can someone tell me what the ‘string.drawWithRect changed to?

Regards,
Chuck Lane

@available(iOS 7.0, *)
    public func draw(with rect: CGRect, options: NSStringDrawingOptions = , attributes: [String : AnyObject]? = [:], context: NSStringDrawingContext?)

Not personally a fan since "with" makes no sense for a geometric boundary unlike in: or inRect:.

-- E

···

On Apr 21, 2016, at 12:57 PM, Charles Lane via swift-users <swift-users@swift.org> wrote:

While rebuilding some apps using the new development trunk build, I figured out the naming changes to just about everything but this:

let string = "Here is a string"
    
string.drawWithRect(CGRect(x: 10, y: 10, width: 200, height: 200), options: .usesLineFragmentOrigin, attributes: attrs, context: nil)

Can someone tell me what the ‘string.drawWithRect changed to?

While rebuilding some apps using the new development trunk build, I
figured out the naming changes to just about everything but this:

let string = "Here is a string"

string.drawWithRect(CGRect(x: 10, y: 10, width: 200, height: 200),
options: .usesLineFragmentOrigin, attributes: attrs, context: nil)

Can someone tell me what the ‘string.drawWithRect changed to?

@available(iOS 7.0, *)
public func draw(with rect: CGRect, options: NSStringDrawingOptions =
, attributes: [String : AnyObject]? = [:], context:
NSStringDrawingContext?)

Erica would you mind discussing/explaining how you went about figuring
out what this function signature was? It looked like you copied/pasted
it from Xcode (based on the styling). Did you just know the function and
go to its source?

···

On Thu, Apr 21, 2016, at 03:50 PM, Erica Sadun via swift-users wrote:

On Apr 21, 2016, at 12:57 PM, Charles Lane via swift-users <swift- >> users@swift.org> wrote:

Not personally a fan since "with" makes no sense for a geometric
boundary unlike in: or inRect:.

-- E
_________________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

While rebuilding some apps using the new development trunk build, I figured out the naming changes to just about everything but this:

let string = "Here is a string"

string.drawWithRect(CGRect(x: 10, y: 10, width: 200, height: 200), options: .usesLineFragmentOrigin, attributes: attrs, context: nil)

Can someone tell me what the ‘string.drawWithRect changed to?

    @available(iOS 7.0, *)
public func draw(with rect: CGRect, options: NSStringDrawingOptions = , attributes: [String : AnyObject]? = [:], context: NSStringDrawingContext?)

Erica would you mind discussing/explaining how you went about figuring out what this function signature was? It looked like you copied/pasted it from Xcode (based on the styling). Did you just know the function and go to its source?

I clicked through to the UIKit module, from there to NSString extensions, and then looked for draw.

-- E

···

On Apr 21, 2016, at 2:05 PM, Ryan Lovelett <swift-dev@ryan.lovelett.me> wrote:
On Thu, Apr 21, 2016, at 03:50 PM, Erica Sadun via swift-users wrote:

On Apr 21, 2016, at 12:57 PM, Charles Lane via swift-users <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:

Not personally a fan since "with" makes no sense for a geometric boundary unlike in: or inRect:.

-- E
_______________________________________________
swift-users mailing list
swift-users@swift.org <mailto:swift-users@swift.org>
https://lists.swift.org/mailman/listinfo/swift-users

While rebuilding some apps using the new development trunk build, I
figured out the naming changes to just about everything but this:

let string = "Here is a string"

string.drawWithRect(CGRect(x: 10, y: 10, width: 200, height: 200),
options: .usesLineFragmentOrigin, attributes: attrs, context: nil)

Can someone tell me what the ‘string.drawWithRect changed to?

@available(iOS 7.0, *)
public func draw(with rect: CGRect, options: NSStringDrawingOptions
= , attributes: [String : AnyObject]? = [:], context:
NSStringDrawingContext?)

Erica would you mind discussing/explaining how you went about
figuring out what this function signature was? It looked like you
copied/pasted it from Xcode (based on the styling). Did you just know
the function and go to its source?

I clicked through to the UIKit module, from there to NSString
extensions, and then looked for draw.

Thank you

···

On Thu, Apr 21, 2016, at 04:13 PM, Erica Sadun wrote:

On Apr 21, 2016, at 2:05 PM, Ryan Lovelett <swift- >> dev@ryan.lovelett.me> wrote:
On Thu, Apr 21, 2016, at 03:50 PM, Erica Sadun via swift-users wrote:

On Apr 21, 2016, at 12:57 PM, Charles Lane via swift-users <swift- >>>> users@swift.org> wrote:

-- E

Not personally a fan since "with" makes no sense for a geometric
boundary unlike in: or inRect:.

-- E
_________________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Sadly, I don't know any way to provide "your automatic translation offends my aesthetics" feedback.

-- E

···

On Apr 21, 2016, at 2:23 PM, Ryan Lovelett <swift-dev@ryan.lovelett.me> wrote:

On Thu, Apr 21, 2016, at 04:13 PM, Erica Sadun wrote:

On Apr 21, 2016, at 2:05 PM, Ryan Lovelett <swift-dev@ryan.lovelett.me <mailto:swift-dev@ryan.lovelett.me>> wrote:

On Thu, Apr 21, 2016, at 03:50 PM, Erica Sadun via swift-users wrote:

On Apr 21, 2016, at 12:57 PM, Charles Lane via swift-users <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:

While rebuilding some apps using the new development trunk build, I figured out the naming changes to just about everything but this:

let string = "Here is a string"

string.drawWithRect(CGRect(x: 10, y: 10, width: 200, height: 200), options: .usesLineFragmentOrigin, attributes: attrs, context: nil)

Can someone tell me what the ‘string.drawWithRect changed to?

    @available(iOS 7.0, *)
public func draw(with rect: CGRect, options: NSStringDrawingOptions = , attributes: [String : AnyObject]? = [:], context: NSStringDrawingContext?)

Erica would you mind discussing/explaining how you went about figuring out what this function signature was? It looked like you copied/pasted it from Xcode (based on the styling). Did you just know the function and go to its source?

I clicked through to the UIKit module, from there to NSString extensions, and then looked for draw.

Thank you

Not personally a fan since "with" makes no sense for a geometric boundary unlike in: or inRect:.

-- E

Radars are the appropriate vehicle. The framework owner can then do
explicit things to tune how the API appears.

···

on Thu Apr 21 2016, Erica Sadun <erica-AT-ericasadun.com> wrote:

    On Apr 21, 2016, at 2:23 PM, Ryan Lovelett <swift-dev@ryan.lovelett.me> > wrote:

    On Thu, Apr 21, 2016, at 04:13 PM, Erica Sadun wrote:

            On Apr 21, 2016, at 2:05 PM, Ryan Lovelett > <swift-dev@ryan.lovelett.me> wrote:

            On Thu, Apr 21, 2016, at 03:50 PM, Erica Sadun via swift-users > wrote:

                    On Apr 21, 2016, at 12:57 PM, Charles Lane via swift-users > <swift-users@swift.org> wrote:

                    While rebuilding some apps using the new development trunk
                    build, I figured out the naming changes to just about
                    everything but this:

                    let string = "Here is a string"

                    string.drawWithRect(CGRect(x: 10, y: 10, width: 200, height:
                    200), options: .usesLineFragmentOrigin, attributes: attrs,
                    context: nil)

                    Can someone tell me what the ‘string.drawWithRect changed
                    to?

                @available(iOS 7.0, *)

                public func draw(with rect: CGRect, options:
                NSStringDrawingOptions = , attributes: [String : AnyObject]? =
                [:], context: NSStringDrawingContext?)

            Erica would you mind discussing/explaining how you went about
            figuring out what this function signature was? It looked like you
            copied/pasted it from Xcode (based on the styling). Did you just
            know the function and go to its source?

        I clicked through to the UIKit module, from there to NSString
        extensions, and then looked for draw.

    Thank you

                Not personally a fan since "with" makes no sense for a geometric
                boundary unlike in: or inRect:.

                -- E

Sadly, I don't know any way to provide "your automatic translation offends my
aesthetics" feedback.

--
Dave

Thanks Erica! Sadly I don’t have it working yet. Xcode wants to insert a comma between the words ‘with rect:’ for some reason. I’ll keep at it!

Regards,
Chuck Lane

Is that a two-word parameter “name”, or is it just a parameter with an external name “with” and an internal name “rect”?

  Neil Faiman

···

On Apr 21, 2016, at 5:50 PM, Charles Lane via swift-users <swift-users@swift.org> wrote:

Xcode wants to insert a comma between the words ‘with rect:’ for some reason.

The latter. Check out the docs:
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Functions.html#//apple_ref/doc/uid/TP40014097-CH10-ID166

···

On Thu, Apr 21, 2016 at 3:37 PM, Neil Faiman via swift-users < swift-users@swift.org> wrote:

> On Apr 21, 2016, at 5:50 PM, Charles Lane via swift-users < > swift-users@swift.org> wrote:
>
> Xcode wants to insert a comma between the words ‘with rect:’ for some
reason.

Is that a two-word parameter “name”, or is it just a parameter with an
external name “with” and an internal name “rect”?

        Neil Faiman
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

It is the latter

-- E

···

On Apr 21, 2016, at 4:37 PM, Neil Faiman via swift-users <swift-users@swift.org> wrote:

On Apr 21, 2016, at 5:50 PM, Charles Lane via swift-users <swift-users@swift.org> wrote:

Xcode wants to insert a comma between the words ‘with rect:’ for some reason.

Is that a two-word parameter “name”, or is it just a parameter with an external name “with” and an internal name “rect”?

So that is Charles’s problem. He is trying to write draw(with rect: …) instead of draw(with: …).

Neil

···

On Apr 21, 2016, at 6:42 PM, Erica Sadun <erica@ericasadun.com> wrote:

On Apr 21, 2016, at 4:37 PM, Neil Faiman via swift-users <swift-users@swift.org> wrote:

On Apr 21, 2016, at 5:50 PM, Charles Lane via swift-users <swift-users@swift.org> wrote:

Xcode wants to insert a comma between the words ‘with rect:’ for some reason.

Is that a two-word parameter “name”, or is it just a parameter with an external name “with” and an internal name “rect”?

It is the latter

— E

OK, I got it.
Instead of string.draw(with rect: CGRect(etc. etc. etc.
It’s string.draw(with: CGRect( and so on and on and on…

I got no help from xcode figuring this out though!

Regards,
Chuck Lane