[swift-evolution] [Proposal]: Rectangles and other common structures.

John Randolph jcr at icloud.com
Wed Jan 6 23:32:47 CST 2016


> On Jan 5, 2016, at 10:10 PM, Brent Royal-Gordon <brent at architechies.com> wrote:
> 
>> As an OS X and iOS developer, it sometimes seems that I work with [GG|NS]Point, [GG|NS]Rect, and [GG|NS]Size almost as much as I use Float or String.  I’d love to see Swift’s standard library include Rect, Point, and Size types, with bridging to make them “just work” with any UIKit or AppKit API that expects their NS or CG equivalents.  Maybe also typealias Frame and Bounds to Rect while we’re at it.
>> 
>> Thoughts?
> 
> My main thought is that, although I use these types in my iOS and Mac apps all the time, I think I've used a rectangle type in web development maybe once (when I was generating images). Swift is currently used mainly for GUI programming, but most of the domains it's expanding into are ones where it doesn't need those types.

It’s a feature that would be useful in the areas where Swift is being used today.  Whether a feature is important in other domains doesn’t make it any less useful in Swift’s current applications.

-jcr


More information about the swift-evolution mailing list