Skip to content

Using appropriate CGRect functions for accessing properties - #21

Open
morozkin wants to merge 1 commit into
AlexDenisov:masterfrom
morozkin:master
Open

Using appropriate CGRect functions for accessing properties#21
morozkin wants to merge 1 commit into
AlexDenisov:masterfrom
morozkin:master

Conversation

@morozkin

Copy link
Copy Markdown

Due to Apple advice it's better using functions to access CGRect properties rather than direct access

The height and width stored in a CGRect data structure can be negative. For example, a rectangle with an origin of [0.0, 0.0] and a size of [10.0,10.0] is exactly equivalent to a rectangle with an origin of [10.0, 10.0] and a size of [-10.0,-10.0]. Your application can standardize a rectangle—that is, ensure that the height and width are stored as positive values—by calling the CGRectStandardize function. All functions described in this reference that take CGRect data structures as inputs implicitly standardize those rectangles before calculating their results. For this reason, your applications should avoid directly reading and writing the data stored in the CGRect data structure. Instead, use the functions described here to manipulate rectangles and to retrieve their characteristics.

commit d7922c0
Author: Denis Morozov <den.morozov@ro.ru>
Date:   Sun Sep 18 17:43:31 2016 +0300

    Use CGRect functions to get properties values instead of direct reading

commit 6340b26
Author: Denis Morozov <den.morozov@ro.ru>
Date:   Sun Sep 18 17:30:35 2016 +0300

    Remove direct reading of width/height values without standardization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants