Skip to content

Instantly share code, notes, and snippets.

@EnesKaraosman
Created April 16, 2020 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EnesKaraosman/035573d7111cbdd44cbec4c7d74edfee to your computer and use it in GitHub Desktop.
Save EnesKaraosman/035573d7111cbdd44cbec4c7d74edfee to your computer and use it in GitHub Desktop.
PacMan with Animatable Data
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