简体   繁体   中英

How to scale a element using Drag gesture in swiftui

my example image

Here, in my example image you can see that I have a text "HELLO" and in the right corner having a button. I want that I can scale my text or element by Drag gesture of the right corner button. What is the efficient way?

  • first, you need to add a Gesture to the scaling view so that when you drag it in the required way do action
  • secondly, you need to add the height and width constraints to the viewController of the scaling view
  • in last, you need to add a func that animates the width and height by increasing or decreasing the size depending on the gesture

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM