how to random placement of UIButton and value

前端 未结 8 1526
南方客
南方客 2021-01-28 22:48

i have a question view and will show 4 answers, only 1 are correct.

but i do not want the same button to be always the correct answer.

i will like to know how do

8条回答
  •  忘了有多久
    2021-01-28 23:27

    I would suggest do not change the position of buttons rather what you can do is change the currentTitle property of the buttons randomly and once the user clicks the button ; you can get the currentTitle of the button and check if it is the correct answer or not.

提交回复
热议问题