flowkey / UIKit-cross-platform

Cross-platform Swift implementation of UIKit, mostly for Android
MIT License
594 stars 40 forks source link

do not layout `superview.delegate` from presentation layer #329

Closed michaelknoch closed 3 years ago

michaelknoch commented 3 years ago

Type of change: performance improvement

Motivation (current vs expected behavior)

This is a follow up based on https://github.com/flowkey/UIKit-cross-platform/pull/328.

I noticed that the recursive relayouting only happens when wrapping the layout code in an animation block. During this animation in the learnstep we mutate bounds of the presentation on every frame which then triggers layouting for the parent view for each frame as well. I think this matches the ios behaviour.

Please check if the PR fulfills these requirements

codecov[bot] commented 3 years ago

Codecov Report

Merging #329 (dca8c64) into master (d34725b) will increase coverage by 0.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #329      +/-   ##
==========================================
+ Coverage   51.22%   51.25%   +0.03%     
==========================================
  Files          87       87              
  Lines        2899     2899              
==========================================
+ Hits         1485     1486       +1     
+ Misses       1414     1413       -1     
Impacted Files Coverage Δ
Sources/CALayer+animations.swift 95.23% <100.00%> (ø)
Sources/CALayer.swift 88.88% <100.00%> (+0.74%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d34725b...dca8c64. Read the comment docs.