Last active
June 3, 2019 15:27
-
-
Save aybekckaya/809255546a779c498ef6f0533c19a5b7 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
var displayLink:CADisplayLink! | |
func setUpDisplayLink() { | |
displayLink = CADisplayLink(target: self, selector: #selector(update)) | |
displayLink.preferredFramesPerSecond = 60 // (optional) if you do not define , then device uses maxFramesPS | |
displayLink.add(to: .main, forMode: RunLoop.Mode.common) | |
} | |
@objc private func update() { | |
print("refresh : \(CACurrentMediaTime())") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment