Support for exclusions. Support for -568h@2x images. Strayed frameworks moved into the Frameworks group for the demo project. #145
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.
Exclusions
Background
The NUI community wants to exclude specific classes, and their derivatives, from NUI's styling.
Problem
There is no way to exclude specific classes, and their derivatives, from NUI's styling.
Solution
I have edited
- (void)setNuiClass:(NSString*)value
inUIView+NUI
and added+ (NSArray*)getExclusions
toNUISettings
to support recursive styling exclusions. This solution does not traverse the display tree; instead, this solution iterates through an array of excluded classes, which are set at runtime.Notes
Similarly to below, I opted for a small solution that is non-obtrusive and easy to understand. It is less performant than a more complex solution that I can provide, if necessary. The more complex solution will most likely involve caching and hashing.
-568h@2x
Background
UIImage
's- (UIImage *)imageNamed:(NSString *)name
natively searches for@2x
files on retina devices; however, this method does not search for associated-568h@2x
files on iPhone 5.Problem
NUI does not load
-568h@2x
files on iPhone 5 when they are present.Solution
I have edited
+ (UIImage*)toImageFromImageName:(NSString*)value
inNUIConverter
to search for-568h@2x
files on iPhone 5. If a-568h@2x
variant is found, it is returned; otherwise, the value fromUIImage
's- (UIImage *)imageNamed:(NSString *)name
is returned.Notes
I opted for a small solution that is non-obtrusive and easy to understand. It is less performant than a more complex solution that I can provide, if necessary. The more complex solution will at least require one class extension or proxy.