开发者

How to create a piano-style interface on an iPhone? [duplicate]

开发者 https://www.devze.com 2023-01-18 19:18 出处:网络
This question already has answers here: How to create piano UI in iPhone? [closed] (5 answers) Closed 6 years ago.
This question already has answers here: How to create piano UI in iPhone? [closed] (5 answers) Closed 6 years ago.

Assume you are writing a code for a piano instrument. Is a good way to make for every button IBAction or all buttons i开发者_StackOverflow中文版n one function return the sound clicked by the user?


It would be much easier to maintain by going with the latter: having all of the buttons point to one IBAction, and the IBAction plays a given note based on which button was pressed rather than having a one-for-one relationship between buttons and IBActions.

0

精彩评论

暂无评论...
验证码 换一张
取 消