The use of dark horse programmers----structures (Range, point, Size, Rect)

Source: Internet
Author: User

1.NSRange: (range)

2.nspoint\cgpoint (nspoint equivalent to Cgpoint): (Position: X, Y)
    • There are two ways to set up point:
1.NSPoint point = Nsmakepoint (100,56);

2.NSPoint Point2 = Cgpointmake (40,63);

    • Convert the Nspoint type to a string type:

3.nssize\cgsize (nssize equivalent to cgsize): (Size: Long, wide)
    • There are two ways to set up a size:
1.NSSize size = nsmakesize (20,30);

2.NSSize size2 = Cgsizemake (20,30);

    • Convert the Nsszie type to a string type:

4.nsrect\cgrect (nsrect equivalent to CGRect): (Position: X, Y, size: long, wide)
    • There are two ways to set size:
1.NSRect rect = Nsmakerect (23, 40, 80, 90);

2.NSRect rect2 = CGRectMake (10, 20, 60, 70);

    • Another way to create a nsrect:

    • Origin: Cgpointzero = = Cgpointmake (0, 0);

    • Convert the Nsrect type to a string type:

5. Determine if a point is within a region (Nsrect):

The use of dark horse programmers----structures (Range, point, Size, Rect)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.