On 11 Jun, 2014, at 2:12 pm, Kyle Sluder <k...@ksluder.com> wrote: >> On Jun 10, 2014, at 10:57 PM, Jim Geist <velocity...@rodentia.net> wrote: >> >> Anyone know off the top of their head how to import an Obj-C extension into >> Swift? Specifically, I need the NSString extensions from UIKit. > > `import UIKit` doesn’t work? Of course, that will only work on platforms > where UIKit exists (iOS device/simulator), so you can’t expect it to work in > a REPL or Playground. > > --Kyle Sluder >
Works fine in an iOS playground. import UIKit imports UIKit and the extensions too. This code doesn't actually DO anything but it compiles and runs import UIKit var t:NSString = "bcd" t.sizeWithAttributes([:]) t.drawAtPoint( CGPoint( x:100,y:200 ), withAttributes: [:] ) I have no idea what to put in the attributes parameter to have attributes, must be an enum or something but I have no idea what it is and the documentation isn't being helpful _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com