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

T.J. Usiyan griotspeak at gmail.com
Thu Jan 7 01:20:57 CST 2016


Rect, Point, Size, EdgeInsets are all ripe for this but I would prefer a
Generic implementation as Charles Constant pointed out. Obj-C compatibility
is a problem for the generic idea.

On Thu, Jan 7, 2016 at 12:51 AM, Charles Constant via swift-evolution <
swift-evolution at swift.org> wrote:

> I support this, not because I find NS- and CG- geometric structs
> confusing. I support it because I'm hoping Swift library versions would be
> generic. I would be very glad to see us get *Rect<Double>* or *Point<Int>* as
> part of the standard library.
>
> On Wed, Jan 6, 2016 at 9:32 PM, John Randolph via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>>
>> > 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
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160107/b10f4518/attachment.html>


More information about the swift-evolution mailing list