Golden Thumb

1-on-1 tutor of chosen kids
個人資料
正文

分五個步驟創建一個能用的國際象棋 App 5/5(走棋子)

(2019-10-11 13:07:27) 下一個

[閱讀全文]

Five Steps to Create a Chess App 5/5

Donald Sheng
Oct 11 · 6 min read

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.

create a new swift file for our protocol

Give this protocol a name “ChessDelegate”. Click “Create” button to continue.

ChessDelegate is the protocol name

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.

...

[閱讀全文]

[ 打印 ]
閱讀 ()評論 (0)
評論
目前還沒有任何評論
登錄後才可評論.