Skip to content

Instantly share code, notes, and snippets.

@AppleCEO
Last active June 26, 2019 03:44
Show Gist options
  • Select an option

  • Save AppleCEO/2b5c5ea99d889d37e00c5074c1cdf092 to your computer and use it in GitHub Desktop.

Select an option

Save AppleCEO/2b5c5ea99d889d37e00c5074c1cdf092 to your computer and use it in GitHub Desktop.
point example
struct MyPoint {
private(set) var x = 0
private(set) var y = 0
init(x: Int = 0, y: Int = 0) {
self.x = x
self.y = y
}
}
func drawPoint (_ point: MyPoint) {
print("점의 x 좌표는 \(point.x), y 좌표는 \(point.y) 입니다")
}
var point = MyPoint(x: 5, y: 3)
drawPoint(point)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment