Sketch
Sketch copied to clipboard
How to reposition/resize elements using sketch ?
Hi daihase,
Thank you very much for such an awsome iOS library for drawing. i am using this in a real application for drawing. One requirement is to move/resize the elements that are currently drawn on sketchView.
Is this possible in this library ? if not, then can you please provide me some hints/guidelines on how i should proceed.
Thanks.
@AwaisFayyaz Thank you for using my library.
This library renders using CoreGraphics. Therefore, it is impossible to move a once drawn object again.
But if you don't do it all at once, you can move/resize it. Because SketchView is just a UIView, once it is saved and reloaded, it can be moved and scaled by dragging like a normal UIView.
Does my answer make sense?
@daihase Thanks for the quick reply.
Please explain this line "But if you don't do it all at once, you can move/resize it". Do you mean that i draw one thing. e.g line, then move/resize it, then draw some other thing, then move/resize it and so on ?
End goal is to move/resize individual items in sketch view, not the whole sketch view. For example, i used the line tool to draw a line. Then i used the stamp tool to place a stamp. now i want to move/resize the line and stamp individually.
Hope it clears the issue.
Thanks
@AwaisFayyaz I understood what you wanted to do. In that case, you need to save the picture drawn with Sketch. (This is because the line drawn using Sketch is completely drawn in SketchView.)
The function you said is frequently seen in drawing app. For example, load the stamp and tap the screen to paste. Then tap and hold the stamp to move it again or resize it.
In that case, the stamp data is stored in the form of UIImageView in advance, and it is temporarily placed by addSubview
in UIView
without rendering it on the screen.
Then drag it with UIGestureRecognizer. (resize too)
What I am trying to say is that picture drawn using sketch must be saved as UIView.
As you said,
For example, i used the line tool to draw a line. Then i used the >stamp tool to place a stamp. now i want to move/resize the line and >stamp individually.
whether a line or a figure, everything that is drawn once in SketchView is a UIView. So I think that you should display the screen for drawing lines for dragging and resizing first, and paste it on the other target ViewController later.
※To create a stamp that can be dragged and resized, you need to expand the stamp function of sketch.
I hope this will help.
Hi, Thanks for the reply. i was working on some other feature.
what do you mean by this line?
you should display the screen for drawing lines for dragging and resizing first
do you mean i should display lines for dragging and resizing around the drawn elements? so if i drawn a stamp and user wants to drag/resize it, i should display lines around the stamp through which user can drag/resize the stamp.
If this is what you mean, then how can i show lines around the stamp ? and after lines are drawn, how to drag/resize it?
If that is not the case, then please elaborate.
This library is providing me all the functions that i need and library is good and updated. so i want to use this library. Just need drag/resize feature in it.
Thanks