3
나는 약간의 히트 테스트를하고 있으며 혼란스러운 상황에 처해있다."pointInside :"는 어떻게 작동합니까?
두 개의 버튼 "favoriteButton"과 "shareButton"이 있습니다. 'A'와 진실되고 'B'에서 다음 코드의 결과는 버튼이 중복되지 않더라도 :
CGPoint dunno = CGPointMake(11, 7);
BOOL a = [self.favoriteButton pointInside:dunno withEvent:nil];
BOOL b = [self.shareButton pointInside:dunno withEvent:nil];
단지 그것을 증명하기 위해, 여기에이 코드를 그 지점에서 두 개의 버튼에 대한 설명 출력은 호출되고 있습니다.
Printing description of _favoriteButton:
<UIButton: 0x5da8c90; frame = (10 6; 37 35); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x5da8d40>>
Printing description of _shareButton:
<UIButton: 0x5da7150; frame = (46 6; 30 35); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x5da59b0>>
어떻게 될까요? 결과물을 오해해야할까요? 문서