Last active
June 26, 2019 03:44
-
-
Save AppleCEO/2b5c5ea99d889d37e00c5074c1cdf092 to your computer and use it in GitHub Desktop.
point example
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 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