MuseumShuffle,
@MuseumShuffle@mastodon.social avatar

When I rewrote Museum Shuffle in SwiftUI one thing I did lose was the ability to pinch and zoom from any part of the image, as opposed to just zooming from the center of the image.

Got some intriguing tips/code from @StewartLynch and @ryanlintott today, which got me curious.

Well looky looky.

Using Museum Shuffle to repeatedly zoom into an image of an illustrated pocket watch from multiple points.

n0rthk1n9,
@n0rthk1n9@mastodon.social avatar
ryanlintott,
@ryanlintott@mastodon.social avatar

@MuseumShuffle @StewartLynch looks great! Can you zoom and pan at the same time?

StewartLynch,
@StewartLynch@iosdev.space avatar

@ryanlintott @MuseumShuffle Yup. This is part of the 3 part series I am doing right now. Final part with this is out on Sunday

video/mp4

MuseumShuffle,
@MuseumShuffle@mastodon.social avatar

@StewartLynch @ryanlintott I can't believe the timing of this. I haven't thought about this functionality in years!

StewartLynch,
@StewartLynch@iosdev.space avatar

@MuseumShuffle @ryanlintott And… if you create an id state variable in your view struct as a UUID you can attach an id property to your ScrollableImageView and, set to that state property. Then add an onTapGesture (2 taps) to your image that just assigns a new UUID to the id variable and if you are zoomed in, this will zoom you back to normal.

MuseumShuffle,
@MuseumShuffle@mastodon.social avatar

@ryanlintott @StewartLynch I just tried and yes you can!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • SwiftUI
  • DreamBathrooms
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • InstantRegret
  • tacticalgear
  • provamag3
  • ethstaker
  • cisconetworking
  • modclub
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • normalnudes
  • megavids
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines