Repository navigation
Add layout() method to support Xcode playgrounds. - #103
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
==========================================
+ Coverage 89.93% 90.28% +0.35%
==========================================
Files 31 33 +2
Lines 6069 6175 +106
==========================================
+ Hits 5458 5575 +117
+ Misses 611 600 -11
Continue to review full report at Codecov.
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Add
layout()methodPinLayout layouts views immediately after the line containing
.pinhas been fully executed, thanks to ARC (Automatic Reference Counting) this works perfectly on iOS/tvOS/macOS simulators and devices. But in Xcode Playgrounds, ARC doesn't work as expected, object references are kept much longer. This is a well-documented issue. The impact of this problem is that PinLayout doesn't layout views at the time and in the order required. To handle this situation in playgrounds it is possible to call thelayout()method to complete the layout.layout()The method will execute PinLayout commands immediately. This method is required only if your source codes should also work in Xcode Playgrounds. Outside of playgrounds, PinLayout executes this method implicitly, it is not necessary to call it.
Usage Examples:
TIP: If your codes need to work in Xcode playgrounds, you may set to
truethe propertyPin.warnMissingLayoutCalls, this way any missing call tolayout()will generate a warning in the Xcode console.