2012-01-06 5 views
1

다른 이미지에 드래그 앤 드롭 기능을 적용하려고했지만 코드가 작동하지 않아 내 뷰의 이미지에는 영향을주지 않습니다.목표 C : 여러 이미지 드래그 앤 드롭

if([touch view]==imageOne){ 
     CGPoint location=[touch locationInView:self.view]; 
     imageOne.center=location; 
     return; 
    } 

    if([touch view]==imageTwo){ 
     CGPoint location=[touch locationInView:self.view]; 
     imageTwo.center=location; 
     return; 

    } 
    if([touch view]==imageThree){ 
     CGPoint location=[touch locationInView:self.view]; 
     imeageThree.center=location; 
     return; 

    } 
    if([touch view]==imageFour){ 
     CGPoint location=[touch locationInView:self.view]; 
     imageFour.center=location; 
     return; 

    } 
    if([touch view]==imageFive){ 
     CGPoint location=[touch locationInView:self.view]; 
     imageFive.center=location; 
     return; 

    } 
+2

imageOne, imageTwo 등은 무엇입니까? – Ilanchezhian

+0

그들은 UIImageViews입니다. – Cristiano

답변

2

설정 YES에있는 UIImageView의 userInteractionEnabled 특성 :

여기 내 코드입니다. 기본적으로 NO이됩니다. 자세한 내용은 Apple documentation

관련 문제