[阅读全文]
Five Steps to Create a Chess App 5/5
Step 5: move pieces around
To let different parts of our software talk with each other in professional way, we’ll create something called “protocol” in Swift programming language, which is similar to “interface” in Java programming language. Right click “Chess” folder on the left navigation panel and select “New File…” to create a new swift file. Make sure to choose “Swift File” under “iOS”. Click “Next” button to continue.
Give this protocol a name “ChessDelegate”. Click “Create” button to continue.
Key word “protocol” is another data type in Swift programming language. We used “class” and “struct” before. Type in the following 3 lines of code shawn in line 11, 12 and 13.
...
[阅读全文]