Detect touch globally

前端 未结 2 2028
遇见更好的自我
遇见更好的自我 2021-01-06 03:49

I trying to figure out how to solve this (fairly) simple problem but I failing miserably, so I really need your advice.

My application consists of a uitabbar with se

2条回答
  •  失恋的感觉
    2021-01-06 04:24

    If you must include the code detection in your uiimageview subclass then I would tell the appdelegate that a touch was received and where. The app delegate could then either tell all your uiimageviews or tell the viewcontroller which would tell it's uiimageviews.

    untested code:

    appDelegate = (myAppDelegate *)[[UIApplication sharedApplication] delegate];
    [appDelegate touchedAt:(int)xPos yPos:(int)yPos];
    

提交回复
热议问题