button - Random UIButton position in a Quiz -


how change randomly position of 4 uibuttons (quiz answers) in xcode 5, ios 7 ?

i change position of buttons (answers) each time new question loads. compatibility iphone 4 , 5 should given.

you can change position of object follows

    cgrect rect = [uiscreen mainscreen].bounds;     cgpoint point = cgpointmake(rand()%(int)rect.size.width, rand()%(int)rect.size.height);     mybutton.center = point;     nslog(@"%@", nsstringfromcgpoint(point)); 

i hope helps

e


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -