This repository was archived by the owner on Feb 2, 2023. It is now read-only.
[Layout] Add extensibility support to ASLayoutElementStyle#2975
Merged
maicki merged 2 commits intofacebookarchive:masterfrom Feb 7, 2017
maicki:MSASLayoutElementStyleExtensibilityTakeTwo
Merged
[Layout] Add extensibility support to ASLayoutElementStyle#2975maicki merged 2 commits intofacebookarchive:masterfrom maicki:MSASLayoutElementStyleExtensibilityTakeTwo
maicki merged 2 commits intofacebookarchive:masterfrom
maicki:MSASLayoutElementStyleExtensibilityTakeTwo
Conversation
1 task
Contributor
Author
|
cc @appleguy |
nguyenhuy
approved these changes
Feb 3, 2017
| @end | ||
|
|
||
| /* | ||
| * Let the ASLayoutableStyle conform to the MSLayoutable protocol and add properties implementation |
Contributor
There was a problem hiding this comment.
Please revisit this comment.
Contributor
Author
There was a problem hiding this comment.
Thanks @nguyenhuy. Addressed the comment.
garrettmoon
approved these changes
Feb 3, 2017
| /** | ||
| * Unbox NSNumber based on the type | ||
| */ | ||
| #define ASDK_UNBOX_NUMBER(NUMBER, PROPERTY_TYPE) \ |
Contributor
There was a problem hiding this comment.
Is there any concern that this doesn't support other values that NSNumber does? I.e. long, longlong, char, etc?
Contributor
Author
There was a problem hiding this comment.
I think for now this will be fine and we can re-consider if we ran into issues. If a not supported data type is set we will assert for now.
QuynhNguyen
reviewed
Feb 6, 2017
| - (void)doUseSomeStyleValuesFromChildren | ||
| { | ||
| for (id<ASLayoutElement> child in self.children) { | ||
| __unused CGFloat extendedWidht = child.style.extendedWidth; |
Contributor
Author
There was a problem hiding this comment.
Thanks! Should be fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the introduction of ASLayoutElementStyle that combines all style related properties for a ASLayoutElement we need to provide some kind of extensibility support. This is important as it should be possible to add custom layout specs and extend the ASLayoutElementStyle for usage within the custom layout specs.
The general idea is outline in this gist via examples: https://gist.github.com/maicki/2630b51f62cbedc0cb34e0bcac96d6c9
Original diff #2294 and replaces #2943