ios - how to draw above cashapelayer path -


i having cashapelayer want draw above layer.. have taken uiimageview , added on cashapelayer , starting drawing user touch moves inside cashapelayer path. when user touch ends want merge drawn image view on cashape layer in such way if users taps again using hittest method can again path of cashape layer.

// tempdrawingimage image view added above hit layer.

uigraphicsbeginimagecontext(tempdrawingimage.frame.size);         [hitlayer drawincontext:uigraphicsgetcurrentcontext()];         [tempdrawingimage.image drawinrect:tempdrawingimage.frame];         hitlayer.contents = (id) uigraphicsgetimagefromcurrentimagecontext().cgimage;         uigraphicsendimagecontext(); 

you cannot convert image path cashapelayer.

you need have drawingpath modified according touch events. second cashapelayer needed draw current drawingpath (since same results while drawing after merge not guaranteed using image approach). when merging need append drawingpath path of shapelayer.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -