I have a video file on my local disk. I also have some subtitles (in HTML5's [WebVTT][] format).
I want to create an HTML file to play that video with subtitles, all from the local filesystem.
| The proper way to fade a UILabel (or any UIView for that matter) is to use a Core Animation Transition. This will not flicker, nor will it fade to black if the content is unchanged. | |
| A portable and clean solution is to use a Extension in Swift (invoke prior changing visible elements) | |
| // Usage: insert view.fadeTransition right before changing content | |
| extension UIView { | |
| func fadeTransition(duration:CFTimeInterval) { | |
| let animation:CATransition = CATransition() | |
| animation.timingFunction = CAMediaTimingFunction(name: | |
| kCAMediaTimingFunctionEaseInEaseOut) |