Created
April 16, 2020 14:39
-
-
Save EnesKaraosman/035573d7111cbdd44cbec4c7d74edfee to your computer and use it in GitHub Desktop.
PacMan with Animatable Data
This file contains hidden or 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
struct PacMan: Shape { | |
var endAngle: Angle | |
// SwiftUI bu parametre ile, | |
// gerekli optimizasyonu yapıyor. | |
var animatableData: Double { | |
get { endAngle.degrees } | |
set { endAngle = .degrees(newValue) } | |
} | |
func path(in rect: CGRect) -> Path { | |
// .. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment