iphone - IOS Drawing app in Swift - Need to prevent user drawing outside the image lines -
i have uiview have implemented methods allowing me 'paint' upon this. however, want add feature image can selected , user can colour drawing in. it's aimed @ young audience want allow user able draw inside image border. have suggestions on best way approach/implement this?
in opinion, should create custom uiimageview, , draw on image implementing touch start/move/end method. doing this, can draw inside image border
edited: after selecting image have set flag true / false in uiview (the view contains image) prevent draw in view, , implementation of touch action in custom uiimageview => can draw inside picture
or if don't want have step "select image" , fire event custom uiimageview parent view when user start touching on uiimageview -> set flag in parent view true / false prevent drawing when touches go outside uiimageview
Comments
Post a Comment