UIDynamic makes the UI to simulate physical world.
UIDynamicAnimator
to Provide the overall context for animation and keep track of behaviorsenum UIDynamicItemCollisionBoundsType : Int {
case Rectangle
case Ellipse
case Path
}
//optional providing path for collisions in UIDynamicItem
optional var collisionBoundsType: UIDynamicItemCollisionBoundsType { get }
optional var collisionBoundingPath: UIBezierPath { get }
UIGravityBehavior
is a field already!(lldb) [view debugEnabled]
to show the fields visually debugInterval
to adjust time intervalsdebugAnimationSpeed
to speed up or slow down the animation (it still counts so probabaly use 1x)To create the content that transparent to the blur and show underneath background
let vibrancyEffect = UIVibrancyEffect(forBlurEffect:blurEffect)
let vibrancyView =UIVisualEffectView(effect:vibrancyEffect)
blurView.contentView.addSubview(vibrancyView)
vibrancyView.contentView.addSubview(label)
Animation to the bounds of UIVisualEffectView Animation to the effect of UIVisualEffectView (from style of light to dark )
UIEffectView uses offscreen pass (background task) to process the blur
To provide different snapshot,
UIView.snapshotViewAfterScreenUpdates(afterUpdates:)
UIView.drawViewHierarchyInRect(rect:, afterScreenUpdates:)
UIScreen.snapshotViewAfterScreenUpdates()
To debug the effect view,
(lldb) po [myEffectView _whatsWrongWithThisEffect]
Fixing broken effects
UIKit Dynamics outside
dynamicsView.translatesAutoresizingMaskIntoConstraints = true
Auto Layout inside
innerView.leadingAnchor.constraintEqualToAnchor(dynamicsView.leadingAnchor)
Custom UIDynamicItem