Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7512077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:45:16+00:00 2026-05-29T23:45:16+00:00

everyone I got a question , I want to implement a UI , Like

  • 0

everyone

I got a question , I want to implement a UI , Like iOS desktop , so far I can arrangement

objects via the code below :

int k=0;
    int j;
    for (int i=0; i<[items count]; i++) {
       //k is row     
        j=i%3;
        if (j==0) {
            k++;
            if (k%3 == 1) {
                k = 1;
            }
        }
 [button setFrame:CGRectMake(25+(i%3*95), 35+((k-1)*140), 100, 100)]; 

So , The view will looks like this

A B C
D E F
G H I

Now , let it into edit mode , drag A drop between E and F

So there are many things need to do

B and C will shift to left , D will go up after B C

E shift left .(how to implement these animations ???)

B C D
E A F
G H I

I search the Apple sample , I only find Moveme this sample , but it only one object

Any advise or sample code will be great help : )

Thanks

Webber

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:45:17+00:00Added an answer on May 29, 2026 at 11:45 pm

    When the user moves a button, you have to find it’s new index first.

    int j = (button.frame.origin.x - 25) / 95;
    int k = (button.frame.origin.x - 35) / 140;
    int newIndex = 3 * k + j;
    

    Then you have to place it at that index in the items array.

    [items insertObject:button atIndex:newIndex];
    

    Then you should call the code you provided to reposition the buttons.

    for (int i = 0; i < items.count; i++) {
        UIButton *button = (UIButton *)[items objectAtIndex:i];
        [UIView animateWithDuration:0.5 animations:^{
           button.frame = CGRectMake(25+(i%3)*95, 35+(i/3)*140, 100, 100); 
        }];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Asking a simple question, just want everyone have fun to solve it. I got
Hey everyone I got a javascript problem I can't seem to find a specific
Hey everyone I got a wiki question. We store files in *.7z in one
Hey everyone, great community you got here. I'm an Electrical Engineer doing some programming
hey everyone... so i'm working on a database design class for university. I've got
Everyone has this huge massively parallelized supercomputer on their desktop in the form of
I recently asked this question here and got some great answers! Custom SQL GROUP
Hi everyone this is my first question here and im not a programmer. I
hello everyone it is me again! i've got few problems too. i am deveoping
everyone I got problem here I need to update a plist data in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.