Re-create .xib with auto-layout. Support 3x asset. #9
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.
Changes
I re-created UI to support auto-layout thus UI will looks okay for all devices.
I added 3
UIView
to act as a parent view before we add those layers individually. This to give more control over positioning and management in the long run.Added support for iPhone 6+ with 3x asset. I simply created 3x asset using TexturePacker with scaling factor of 3/2 (or 1.5). For internal of layer class, I check for
[UIScreen mainScreen].scale == 3.0
or not, if so then use scale of0.35
. You can read more information at commit log of 42bde5dIssues
Anyway, something weird going on.
I don't think it's due to auto-layout because
CALayer
which we're working with doesn't get effect by it. I just can't modify layer's position, yes, and only position. No matter what I do, it don't get into effect. The layer will be fixed at top right of its attaching view. See more atViewController.m
.Another one is, if we use
INFINITY
on iOS 9, the animation's display frame will disappear sometime during the animation, with also when we interact with buttons to pause, continue, stop, and play animation. I changed to use hard-coded high value instead and it works fine.Result
Tested on iPod Gen 5, and all simulators iOS 9 works as expected except for iPad 2 which will give weird result of positioning.
Result as follows.


