iOS Development with Swift Tutorial - 27 - Core Animation

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Updated December 11, 2018:

UIView.animate(withDuration: 3.0, animations: {
self.someButton.transform = CGAffineTransform(scaleX: 4, y: 4)
let angle = CGFloat(40)
self.someButton.transform = angle)
})

Thanks for the videos.

terrortronics
Автор

excellent as always. Short, simple and to the point. Thanks NB

LarsVision
Автор

An option is to drag the IBAction form of the button to ViewController.swift and placing the fade animation code inside of that function.  Then you can trigger the animation manually - instead of having it start fading as soon as it loads.

JimVeneskey
Автор

So ok the only way i could fix this was to split the 2 statements there must be a better way of doing this but i found that this worked (ish) for me:

import UIKit

class ViewController: UIViewController {


@IBOutlet weak var kevsButton: UIButton!



override func viewDidLoad() {
super.viewDidLoad()

//create animation block to fade out
UIView.animate(withDuration: 1.0, animations: {
let grow = CGAffineTransform(scaleX: 4, y: 4)

self.kevsButton.transform = grow;

let angle = CGFloat(40)
let rotate = angle)
self.kevsButton.transform = rotate;
})

}



}

Kevblucas
Автор

Amazing tutorial as always. But please i need to know how to make a segue after the animation is finished! I've tried with a regular segue but doesnt work.
Many Thanks to anyone who is gonna answer me

ohcrazydiamond
Автор

can someone point me in the direction of an xcode 6 tutorial that shows how to animate a uipickerview onto the screen after pressing a button? I want a uipickerview and toolbar with dismiss button imbedded on a child view to animate half way up from the bottom after the button on the parent view is pressed then dismiss when the bar button is pressed. Any help would be greatly appreciated.

joeklanecky
Автор

This is something I've always been fuzzy about, why do you, in this example, say: self.button.alpha = 0 instead of just saying button.alpha = 0 ?? Thanks

Sokar
join shbcf.ru