File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
SwiftGen.playground/Pages/XCAssets-Demo.xcplaygroundpage Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -88,12 +88,19 @@ let image1 = UIImage(asset: Asset.Food.Exotic.banana)
8888let image2 = Asset . Food. Round. tomato. image
8989
9090import PlaygroundSupport
91- // Show alternating tomato and banana in playground's liveView
91+ // Show fruits animated in the playground's liveView
9292PlaygroundPage . current. liveView = {
93- let assets = [ Asset . Food. Round. tomato, Asset . Food. Exotic. banana]
93+ let assets = [
94+ Asset . Food. Exotic. banana,
95+ Asset . Food. Exotic. mango,
96+ Asset . Food. Round. apricot,
97+ Asset . Food. Round. apple,
98+ Asset . Food. Round. tomato,
99+ Asset . Food. Round. Double. cherry
100+ ]
94101 let iv = UIImageView ( frame: CGRect ( x: 0 , y: 0 , width: 200 , height: 200 ) )
95102 iv. animationImages = assets. map ( \. image)
96- iv. animationDuration = 2
103+ iv. animationDuration = TimeInterval ( assets . count ) / 2 // 0.5s per image
97104 iv. startAnimating ( )
98105 return iv
99106} ( )
You can’t perform that action at this time.
0 commit comments