how to random placement of UIButton and value

前端 未结 8 1280
南方客
南方客 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:20

    Out of 4 options only one is correct so why you worry, just give tag to your UIButton. In touchUpInside event or any action you've specified on it. Just match the correct answer tag with user touched button tag.

    You should set some logic to set answer with different button tag randomly.

提交回复
热议问题