Photo Editor / Image Cropping Tool Using SwiftUI | Gestures | Xcode 14 | SwiftUI Tutorials

  Рет қаралды 10,715

Kavsoft

Kavsoft

Күн бұрын

Пікірлер: 23
@KillianSmith-i2b
@KillianSmith-i2b 8 ай бұрын
This was great help! I had issues with the offset after scaling, when the image exceeded the bounds of the view I updated the logic for handling the bounds to something like this, and proved to be an improvment GeometryReader { proxy in let frame = proxy.frame(in: .named("cropView")) Color.clear.onChange(of: isInteracting) { isDragging in withAnimation(.easeOut) { let horizontalOverflow = (frame.width - size.width) / 2 offset.width = min(horizontalOverflow, max(-horizontalOverflow, offset.width)) let verticalOverflow = (frame.height - size.height) / 2 offset.height = min(verticalOverflow, max(-verticalOverflow, offset.height)) } if !isDragging { previousOffset = offset } } }
@geneva5213
@geneva5213 11 ай бұрын
For anyone using this and pulling their hair out why the quality of the cropped image is very low and pixelated, I've found a solution: Add ' renderer.scale = 10.0' after 'let renderer = ....' in the CropView struct.
@FirstPlaceFilms
@FirstPlaceFilms 8 ай бұрын
Thank You! Just spent hours looking for this
@edlar
@edlar Жыл бұрын
Просто лучший! 🔥👍
@jakubhaumer1069
@jakubhaumer1069 Жыл бұрын
Great materials for learning and understanding the basis how croppers can work but at slightly deeper level, the cropper is not reliable and can be often pretty buggy. However, when further modifications are applied, can serve at usable level.
@kadmieljoseph170
@kadmieljoseph170 Жыл бұрын
Wow, you're amazing... the simplicity, consistency and creativity, just amazing. Meanwhile, I was thinking if is possible to run Xcode on windows OS operating systems, because I would love to try it out...
@chimansong8653
@chimansong8653 Жыл бұрын
Thanks for a great video. Question! when I zoom in after zoom out it does not scale down in the same ratio of pitch movement. it relatively smaller compared to zoom in action. Any advice on this?
Жыл бұрын
The Best! 👏✨🚀
@alenayoutube1574
@alenayoutube1574 Жыл бұрын
Nice video sir , i success fully completed this project , its working , thanks for doing this , But i need to learn more about @viewbuilder and more about different keywords , any way thankyou. sir Those who cant zoom press option button to activate 2 finger zoom gesture and drag mouse
@manasvijaywargiya8218
@manasvijaywargiya8218 Жыл бұрын
It was really awesome 😀🔥 tutorial. Thanks Kavsoft ✌
@tonycyber
@tonycyber Жыл бұрын
if the image were to be upload to firebase the cropped image would be uploaded, right? because i saw that you converted the View to Image. i just want to make sure the cropped Image is a new Image, not just a image that was zoomed in.
@ordozgoite
@ordozgoite 9 ай бұрын
Thank you so much!
@fitlifeero
@fitlifeero Ай бұрын
This code works amazing 🤩 but I need free crop, how do I make it
@steam9583
@steam9583 Жыл бұрын
Just genius...
@andrejkling3886
@andrejkling3886 Жыл бұрын
Awesome... thank you 👍🎄
@sphericalwave
@sphericalwave Жыл бұрын
very nice
@RyuuzakiJulio
@RyuuzakiJulio Жыл бұрын
What needs to be changed to avoid the dialog and automatically do a rectacle crop?
@pavelbondar13
@pavelbondar13 7 ай бұрын
try to make CropView var image: UIImage? -> @Binding var image: UIImage?
@santhoshVnair
@santhoshVnair Жыл бұрын
Nice. UIImage is part of UIKit and it works only in iOS. So, this will not work for Mac. I see PhotosPicker supports SwiftUI Image. So, if you can update this from selectedImage: UIImage? to selectedImage: Image? - then this will work for iOS and Mac, right? May be an idea for another video?
@Kavsoft
@Kavsoft Жыл бұрын
I made this video specifically for iOS; may I note this for future video lists?
@craigmiller
@craigmiller Жыл бұрын
You have to adapt it a little bit, but it's not too difficult. Replace UIImage with NSImage, change some of the dialogs to be macOSish instead of iOSish. Have to add support for the mouse wheel and/or add a slider for the zoom function.
@Jangue
@Jangue Жыл бұрын
How do you have time for all those fire videos 😮🎉
@TourShturman
@TourShturman Жыл бұрын
thank you
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 135 МЛН
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 15 МЛН
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН
Crop & Edit Photos in Your iOS App (2023 Swift) - Xcode 14
13:26
iOS Academy
Рет қаралды 11 М.
Mastering Image Cropping in SwiftUI: A Quick and Easy Guide!
32:01
Rebeloper - Rebel Developer
Рет қаралды 1,6 М.
How to Create  Photo Editor/ Cropping tool for images in SwiftUI
16:30
MasteringProgramming
Рет қаралды 6 М.
PhotoAdjust: Overlay Effects on a Photo Using Sliders in SwiftUI
11:27
AI, Python, Swift and SwiftUI
Рет қаралды 407
Programming Is Cooked
9:30
ThePrimeTime
Рет қаралды 166 М.
New SwiftUI Photo Picker - Single & Multiple Selection
12:42
Sean Allen
Рет қаралды 11 М.
I Made an iOS App in MINUTES with This AI Tool!
13:20
Creator Magic
Рет қаралды 259 М.
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 135 МЛН