Adding drag and drop component to iOS app

后端 未结 2 1527
长发绾君心
长发绾君心 2020-12-24 03:37

I apologise if this seems very vague but I\'m not sure how else to word it.

I am trying to build an ipad app that will let users populate a workspace with tools they

2条回答
  •  -上瘾入骨i
    2020-12-24 04:17

    From the Question i thing you are going to Build a feature like Add to cart in Most of the Shopping Apps like Amazon, Flip kart and etc..

    - (void)viewDidLoad {
        [super viewDidLoad];
    
        shoeImageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(46,222, 51 , 51)];
        shoeImageView1.image = [UIImage imageNamed:@"shoe.png"];
    
        shoeImageView2 = [[UIImageView alloc]initWithFrame:CGRectMake(150,222, 51 , 51)];
        shoeImageView2.image = [UIImage imageNamed:@"shoe1.png"];
    
        shoeImageView3 = [[UIImageView alloc]initWithFrame:CGRectMake(225,222, 51 , 51)];
        shoeImageView3.image = [UIImage imageNamed:@"shoe2.png"];
    
    
         addTOCart = [[UIImageView alloc]initWithFrame:CGRectMake(132,400, 80, 80)];
        addTOCart.image = [UIImage imageNamed:@"basket.png"];
        [self.view addSubview:addTOCart];
    
        imageViewArray = [[NSMutableArray alloc]initWithObjects: shoeImageView1,shoeImageView2 ,shoeImageView3,nil];
    
    
    
        for (int i=0; i

    you can use these codes to implement these feauture. Using these code u can drag the object any where in the screen.

    for sample project you can use this Link.

提交回复
热议问题