Last active
October 28, 2017 16:10
-
-
Save lawreyios/c0e21371de2760f8bc71c1f3b8ae739e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FMViewController: UIViewController { | |
@IBOutlet weak var qnImageView: UIImageView! | |
override func viewDidAppear(_ animated: Bool) { | |
super.viewDidAppear(animated) | |
fadeInQuestion1() | |
} | |
func addMaskView(startingPoint: StartingPoint, y: CGFloat, mask: Int) -> MaskView { | |
let mq = Mask(named: "mq\(mask)") | |
var maskView = MaskView(frame: CGRect.getMaskRectLeft(y: y)) | |
if startingPoint == .Right { maskView = MaskView(frame: CGRect.getMaskRectRight(y: y)) } | |
maskView.image = mq | |
view.addSubview(maskView) | |
return maskView | |
} | |
func addTransformTo(mask: MaskView, startingPoint: StartingPoint, duration: Int, delay: Int) { | |
let translationX: CGFloat = startingPoint == .Left ? 1920 : -2250 | |
let transform = CGAffineTransform(translationX: translationX, y: 0).rotated(by: CGFloat(Double.pi)) | |
UIView.animate(withDuration: TimeInterval(duration), delay: TimeInterval(delay), options: .curveLinear, animations: { | |
mask.transform = transform | |
}, completion: nil) | |
} | |
override var prefersStatusBarHidden: Bool { return true } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment