Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

MEDEdgeInsets #18

Merged
merged 16 commits into from Aug 7, 2013
Merged

MEDEdgeInsets #18

merged 16 commits into from Aug 7, 2013

Conversation

indragiek
Copy link
Contributor

Fixes #17.

For the MEDEdgeInsets geometry functions, I wasn't sure if you wanted me to reuse the UIKit functions in the iOS implementations, but I reimplemented it for both platforms anyways. This can be switched to use UIKit functions if necessary.

#import <AppKit/AppKit.h>
#endif

#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be combined with the above block.

@jspahrsummers
Copy link
Contributor

🍔


MEDEdgeInsets MEDEdgeInsetsFromString(NSString *string) {
MEDEdgeInsets insets = MEDEdgeInsetsZero;
if (string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: explicit comparison vs. nil

@indragiek
Copy link
Contributor Author

💥


MEDEdgeInsets MEDEdgeInsetsFromString(NSString *string) {
double top = 0, left = 0, bottom = 0, right = 0;
if (string != nil) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an assertion instead, IMO.

@jspahrsummers
Copy link
Contributor

🍟

@indragiek
Copy link
Contributor Author

Should I switch all edge insets comparisons to using MEDEdgeInsetsEqualToEdgeInsets() for consistency or just the ones that cause test failures?

@jspahrsummers
Copy link
Contributor

Ehhh… up to you, as long as the tests for that function don't trust it. :trollface:

@indragiek
Copy link
Contributor Author

✈️

@jspahrsummers
Copy link
Contributor

Ah, sorry, can you also add this to the framework header?

@indragiek
Copy link
Contributor Author

I didn't explicitly add it because NSValue+MEDGeometryAdditions.h imports it anyways. Should I still add it to the header?

@jspahrsummers
Copy link
Contributor

Yes, every public header should be there.

@indragiek
Copy link
Contributor Author

🍸

@jspahrsummers
Copy link
Contributor

🍻

jspahrsummers added a commit that referenced this pull request Aug 7, 2013
@jspahrsummers jspahrsummers merged commit 8c8b5c8 into github:master Aug 7, 2013
@jspahrsummers jspahrsummers removed their assignment May 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NSEdgeInsets/UIEdgeInsets boxing
2 participants