Watch Next - iOS Take Home Project - Job Interview Practice - Free Preview - kzitem.info/news/bejne/rol_y2avb3iWmG0
@cannonjabari310
3 жыл бұрын
Not sure if anyone gives a shit but if you guys are bored like me atm you can watch all the new series on instaflixxer. Been watching with my gf during the lockdown :)
@javiontadeo7407
3 жыл бұрын
@Cannon Jabari yup, been using instaflixxer for months myself :D
@adarshjoseph3376
3 жыл бұрын
Great video! Very informative just like all your other videos! One correction I would offer. You had written it right the first time, but when you refactored the code into the func: func moveViewWithPan(view: UIView, sender: UIPanGestureRecognizer) { let translation = sender.translation(in: view) ^The getting of translation here should be between the gesture's view and it's superview, so the line after moving to the function should be: let translation = sender.translation(in: self.view) [or] let translation = sender.translation(in: view.superview) Weird behavior only shows in the UI when you add other gestures that you try to operate simultaneously. Nevertheless, thanks for the great content!
@evgeshaky
2 жыл бұрын
Thank you! I made a game for my kid after watching this tutorial (move and sort fruits and vegetables, greens are instead of file and two baskets are instead of trash).
@seanallen
2 жыл бұрын
Awesome! Glad it was helpful and I hope they enjoy the game 🍎
@adamgf1
7 жыл бұрын
Nice tutorial just wanted to point out that you can also add the gesture recognizer non-programmatically in the storyboard by dropping it in the view and then connect it to the view controller using the control key and put an @IBAction function to handle the pan
@prashantt727
5 жыл бұрын
Great video , I have one suggestion , You don't need to manually create method ,copy paste code, handle parameters , let the XCode do that for you. You first select the code right click , choose refactor , choose extract method and just create the name of func and you are good to go Hope it helps :)
@Eugene.Berezin
4 жыл бұрын
Thanks man! Just had a similar question during the interview. I don't work with gesture recognizers that often. I've got the right idea what to do but 25 minutes was not enough to figure it out on the spot. Will see what happens.
@toastrecon
6 жыл бұрын
Nice! Also, code is easier to maintain and expand in the future when new features are added...
@MortalKombatant
6 жыл бұрын
Guyz like this if u want fir base and sqlite tutorial since other youtubers juss type the code they didn't walk through the way you do sir Thanks a lot
@furqankhan7250
7 жыл бұрын
Hey Sean! Prepping for my interview in the next few days. I find your videos really helpful.
@seanallen
7 жыл бұрын
Good luck, Furqan! Glad I could be of some help. Let me know how it goes!
@paulbeattie4780
7 жыл бұрын
In the last line of your function moveViewWithPan, when you use setTranslation I think you are using the wrong view. I think you are using the passed in view and not the ViewController’s view.
@paulbeattie4780
7 жыл бұрын
Having now built the code myself, it doesn’t make any difference to how it works, but it feels wrong ;)
@seanallen
7 жыл бұрын
You are correct, Paul. It should be on the view controllers view. Simple oversight due to poor naming on my part. That's a good lesson in making sure you have clear naming. Like you said, it works either way... but it really should be on the ViewController's view.
@kapilk6214
4 жыл бұрын
Hey Sean! One comment here, in function mapViewWithPan code sender.translation(in: view), here view is self.view or fileView? I think it should be self.view. Please correct if I am wrong.
@egormikhailov134
3 жыл бұрын
Thank U, Sean. Great simple tutorial but I guess that we should save the 'fileViewOrigin' into overriden 'viewDidLayoutSubviews' because in 'viewDidLoad' origin is equal to the storyboard's value.
@Olden2610
6 жыл бұрын
This explanation of gest Recogn - is better then in Stanford courses
@seanallen
6 жыл бұрын
Thanks for the kind words! That's high praise!
@Olden2610
6 жыл бұрын
Also - can i hope for a videos explaining CoreData (for beginners and a little later - advanced)? Just watching it on Stanford - and hardly can remember atleast half of 'things' about it :(
@seanallen
6 жыл бұрын
I don't use CoreData in any of my projects, and CoreData didn't come up very often when i interviewed all around Silicon Valley. In my experience, it just doesn't seem to be a big thing. So, I probably won't be doing any CoreData tutorials, as I'd have to take the time to learn it myself.
@Olden2610
6 жыл бұрын
So what are you using to store Data in your apps?
@seanallen
6 жыл бұрын
Typically the apps I work on have a custom back end built by a web developer. So it's all stored on the server.
@Zohrath
7 жыл бұрын
Perfect, just what I was looking for, subscribed!
@seanallen
7 жыл бұрын
Glad you enjoyed it, Zohrath!
@abdulmazeed8994
3 жыл бұрын
Nice video I'm tried using loops but the action is performing on only last created instance.
@joshwalton1898
3 жыл бұрын
This was extremely helpful! I always how apps accomplished this type of feature without the touches methods
@yanjunma3610
5 жыл бұрын
Sean - great video and pace is just right. I do have a question - I am testing your code with two or more files to drag to the trash can. I was able to do this by adding: addPanGesture(view: file1ImageView) addPanGesture(view: file2ImageView) file1ViewOrigin = file1ImageView.frame.origin file2ViewOrigin = file2ImageView.frame.origin But I am stuck at the returnViewToOrigin part. How do I return the file to its respective position if there is no intercept? Thanks.
@maximkrouk1697
5 жыл бұрын
It would be interesting to see side menu implementation with gesture recognizers
@sukshithshetty4847
4 жыл бұрын
Why did you make the alpha of the imageView zero? Can't we just remove/delete the imageView from the mainView??
@andreadavid5113
3 жыл бұрын
Hey Sean, can you please explain why the method handlePan(sender: UIPanGestureRecognizer) has a parameter like that? Can we just declare the function as a non parameterized function and declare an object of UIPanGestureRecognizer inside the function instead? I have already done that but it does not work, instead, if I do the same as you did then it works perfectly and I really don't understand why that parameter suppose to be there ://
@michaelharden231
7 жыл бұрын
hey Sean just I haven't gotten all the way thru the video so u might do this but I'm curios, could you have added a UIPanGesture to the DOC image on the story board and then created a IBAction for the gesture instead of adding the pan gesture in code. thanks
@seanallen
7 жыл бұрын
Hey Michael, I believe that would work as well. Haven't tested that, but it sounds correct (off the top of my head).
@emileconstantin6225
6 жыл бұрын
Great tutorial! Question: Why am I getting the following error: "Type 'ViewController' has no member 'handlePan(sender:)' "?
@seanallen
6 жыл бұрын
Not sure without seeing your code. Maybe you haven't written that function yet? Or the function you wrote doesn't exactly match? Have you tried looking at my source code in the description?
@BombheadGuitar
7 жыл бұрын
Great tutorials - learning a lot from your videos! Thank you.
@seanallen
7 жыл бұрын
Glad you're enjoying the videos! Happy to hear I'm helping with the learning process.
@nishads4357
5 жыл бұрын
i have never used storybord in code, i set constrainsts and use auto resize !
@seanallen
5 жыл бұрын
There are many different ways to do things in programming. Choose what's best for you.
@nishads4357
5 жыл бұрын
@@seanallen A Million thanks for your amazing tutorials,.. i was wondering could you do a video on Api request like get post put delete..
@Tracks777
7 жыл бұрын
Quite good video, awesome!
@oTarrell13o
6 жыл бұрын
Hey Sean, just found your channel and enjoying the videos. Like to use the videos to reinforce what's being learned in the book. I wanted to know if you could possibly make a video to help users get a better feel for stack views and possibly auto-layout. Its something you really have to just constantly play around with but wanted to know if you had some techniques to help you hone the skills. Similarly to your boss/intern protocol/delegate technique.
@seanallen
6 жыл бұрын
Happy to hear you are enjoying the channel! I have some auto layout videos on my list, but you're right. You can read/do tutorials all you want, but ultimately learning auto-layout comes down to experience. Pretty much all experienced developers can tell you a story where they've spent hours messing with an auto-layout bug while learning. Once you learn it, it's great... but really you kinda have to go through those trials on your own. Experience is the best teacher there.
@niteshkumar2133
5 жыл бұрын
my FileImage is not getting Vanish. It goes behind the trash image. Why so?
@anthonylee4961
5 жыл бұрын
Very informative video! thank you!
@seanallen
5 жыл бұрын
Glad you liked it, Anthony!
@t0mmx
2 жыл бұрын
I found an old one! :) Great stuff.
@jasondhindsa6774
5 жыл бұрын
I don't get what "sender.setTranslation(CGPoint.zero, in: view)" is doing. The tooltip says it "Sets the translation value in the coordinate system of the specified view." But you've set the new translation point to (0,0). I don't get that. Can you explain?
@ShubyDuan
4 жыл бұрын
I had this question also and found this explanation helpful: stackoverflow.com/questions/37336853/a-pan-gesture-without-settranslation-strange-behaviour
@smarter2610
6 жыл бұрын
Sean, why always when I set any image to image view like this trash for example I see background ? even when I download something without background. This should be transparent but it is not
@seanallen
6 жыл бұрын
if the image you downloaded is a .png with a transparent background, it should work. Sometimes the images you download are a .jpg. .jpg cannot have transparent background. It sounds like the issue involves your image.
@davidvatlin94
4 жыл бұрын
Very good overview, good job! Ps I guess you made a mistake by line 55 of your refactored version. It should be sender.setTranslation(CGPoint.zero, in: view.superview) or sender.setTranslation(CGPoint.zero, in: self.view)
@dziobaczy
5 жыл бұрын
Hey! Thanks for great tutorial, one question tho. Isn't the returnViewToOrigin function kinda missleading as it doesn't actually returns the passed view to it's origin but to the fileViewOrigin so it works only as long as the passed view is the fileView. Wouldn't be better to name it returnFileViewToOrigin and don't pass anything but just animate this back?
@yaffiazmi579
5 жыл бұрын
thank you bro, this method really helped me :D
@seanallen
5 жыл бұрын
Happy to help, Yaffi!
@stevensuranie5123
7 жыл бұрын
why do I have to put @objc in front of the selector method?
@seanallen
7 жыл бұрын
Go here and do a search (CMD+F) for "selector". It's a pretty good explanation for the answer to your question. www.raywenderlich.com/163857/whats-new-swift-4
@MortalKombatant
6 жыл бұрын
It's a obj c code format so we have to mention it since we choose swift as the language for our project
@15nicinho
6 жыл бұрын
Can you go over how to use pan recognizer to navigate pages?
@AliMohamed-jg6bv
6 жыл бұрын
hi bro. i am addicting you right now.... plz can you help ! i have two more question. 1.if i have a side menu with multiple icons in main view controller and i want to display the information each time i press one icon on the same main view controller. like I'm doing fake segue in the main view controller for each icon. like doing multi view controller in the main controller ... am i clear ? 2. if i have two view controller and i want to create a summary in first view controller directly from information entered in the second controller .... like printing second view controller information into first view controller to look like summary ... is it possible to do so?
@atalaguitare13
5 жыл бұрын
Hi Sean, I need your help please. I create a word search puzzle, but i dont know how to select the letter with my finger to create a color streak. do you have an idea?
@seanallen
5 жыл бұрын
I've never had to implement that before. I would have to research this a bit.
@atalaguitare13
5 жыл бұрын
@@seanallen Thanks man, I appreciate. Can we chat in private please?
@kvaliantis
6 жыл бұрын
Hi Sean Thanks for sharing your knowledge with us. I have the following code trying to add a tap gesture to an image but seems the selector function is not called. Can you please help. The views are displayed correctly using programmatically autolayout constraints. No errors running the project. let myImageView: UIImageView = { let imageView = UIImageView() imageView.image = UIImage(named: "someimage") imageView.contentMode = .scaleAspectFit imageView.translatesAutoresizingMaskIntoConstraints = false let mytapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleSelectMyImageView)) mytapGestureRecognizer.numberOfTapsRequired = 1 mytapGestureRecognizer.numberOfTouchesRequired = 1 imageView.isUserInteractionEnabled = true imageView.addGestureRecognizer(mytapGestureRecognizer return imageView }() @objc func handleSelectMyImageView() { print("Image tapped") }
@jordiaguilar658
5 жыл бұрын
Thank you very much Sean, a great job and very well explained
@taalibminhas8343
6 жыл бұрын
This works but as I have autolayout I am getting some issues with returning to its origin position. Do you have any advice?
@seanallen
6 жыл бұрын
It's tough to say without seeing what's actually going on in the app. I'd probably have to be sitting there with you to debug it.
@taalibminhas8343
6 жыл бұрын
Sean Allen thanks for the Swift reply ;) I’ll have to fly you to London to figure it out, thanks for the videos!
@seanallen
6 жыл бұрын
I'm free this weekend. I prefer the redeye.
@indraneelpotnis8523
7 жыл бұрын
Is a new instance of CGPoint class created everytime in .changed state ? If yes, could this extra object creation be eliminated by mutating state of fileview. center ?
@JasonMitchellAZ
6 жыл бұрын
Good stuff!
@ethanmiller9923
6 жыл бұрын
Just awesome!
@nebojsapavlovic2231
7 жыл бұрын
This is simple and that way very instructive but doesn't work for me. I do my projects without storyboard and sometimes or often times come across something i can not resolve. Any idea where this i could be wrong? I added programmatically all properties and constraints as in storyboard and it looks the same but not working.
@seanallen
7 жыл бұрын
Hey Nebojsa, this is very hard to answer without looking at your code. There's really not much on the storyboard. Just 2 imageViews with constraints. If you're constructing those properly in code, then this should work. But again, without looking at your code, it's hard to tell.
@seanallen
7 жыл бұрын
Did you try downloading the source code from the video description, and compare with yours?
I downloaded the source code and changed it this way. Can you spot where i go wrong.
@nebojsapavlovic2231
7 жыл бұрын
Finally I solved the problem! --> fileImageView.isUserInteractionEnabled = true. Thanks, keep up the good work!
@CrazySkillz15
4 жыл бұрын
Thanks so much for this beautiful informative tutorial. You are the best :D :)
@seanallen
4 жыл бұрын
Happy to help 😀
@ivanpatera5827
4 жыл бұрын
@@seanallen Is it possible to do this with SwiftUI? awesome tutorial btw
@abdouett3676
7 жыл бұрын
Great tutorial!. Thanks Allen
@seanallen
7 жыл бұрын
No problem, Abdou. Glad you enjoyed it!
@gekoskipatric
4 жыл бұрын
How come you don't need to prepend your function with @objc ? My code forces me to when adding a #selector. I'm new to iOS. Is this a new development in SWIFT 5?
@seanallen
4 жыл бұрын
I believe it was new in Swift 4. But yes, it was new after this video was created.
@gekoskipatric
4 жыл бұрын
Cool. Love your videos. Thank you for the quick response
@rgfgish
7 жыл бұрын
It's not work for me, i copy your but it's still not working, why?
@Natena
Жыл бұрын
I always check the videoSpeed when watching your channel, have a feeling that im on 1.25 or 1.5 .. but unfortunately its the real speed :))
@seanallen
Жыл бұрын
These are some of my first ever videos (5 years ago) when I wasn't comfortable on camera. I've worked on slowing down over the years and like to think I've improved a lot in that area :)
@monicaluo1122
4 жыл бұрын
Nice Video! I have a question on let translation = sender.translation(in: view). For this parameter view, is it the main UIView (recognizer.view.superview) or the parameter of moveViewWithPan (recognizer.view). I literally tried both and both are working. I've read the doc from developer.apple.com/documentation/uikit/touches_presses_and_gestures/handling_uikit_gestures/handling_pan_gestures it's showing the superview. But in this project, it's like the recognizer.view. Thanks in advance!
@stevengao8345
7 жыл бұрын
thanks for sharing , i have a question about tapgesturerecognizer, i am trying to make a social media app, like facebook, the like button is an image of red heart, when i click it at normal speed, there is no problem at all, but when i click the heart image like playing my starcraft game, my god, the firebase or likes number count mess up, so my question is : is there a way or property of this uigesturerecognizer that i can use , so everytime i click the image , it will disable itself for maybe 0.5 second or anytime interval before my next tap ? thanks
@seanallen
7 жыл бұрын
Hey Steven, it's possible. I'm not sure it's the best UX implementation... but it's possible. Look into NSTimers. Google that, and you should find some good StackOverflow answers. Basically you would disable your button, start a timer for however long you like, and then re-enable it after the timer is up.
@stevengao8345
7 жыл бұрын
thanks mr.Sean, for taking your pretious time and gave me a prompt reply, this is little funny , i just watched your another animation video tutorial, then i used Uiview.animate method, in that method there is a delay and duration, and i try that , it works !!! i animate the heart image, and it works. but i am not sure will be some fallback, i mean since it is tableviewcell, if i use animate on all cells, will it slow down my app and make it lag or use too much memory if i load lots of cell. or it doesn't matter, since it only activates when i tap the heart image to like it.
@SenorQuichotte
6 жыл бұрын
you can do most of that with IB
@di_nerd_apps
5 жыл бұрын
Another Mahddd video ! Thanks!
@seanallen
5 жыл бұрын
Happy to hear you enjoyed it 👍
@emmanuelogbewe2334
7 жыл бұрын
Hey there I'm currently trying to populate a collection view with video urls from firebase and I'm confused to how to download them and create an index ? And pass data. Sorry if my terminology is incorrect
@seanallen
7 жыл бұрын
Hey Emmanuel, that's a lot to try an answer in a KZitem comment (or even an email). Try breaking the problem down into parts. It appears you have 3 parts: 1. Downloading the URLs from Firebase 2. Populating a collection view 3. Passing data to a detail view I have a video about passing data that may help: kzitem.info/news/bejne/yIRprJaEg2iQh44
@emmanuelogbewe2334
7 жыл бұрын
Sean Allen thank you I will check it out
@emmanuelogbewe2334
7 жыл бұрын
Sean Allen hi there I sent an email , perhaps I don't know if u seen it
@seanallen
7 жыл бұрын
Hey Emmanuel, I apologize... That email slipped through the cracks. I'll get you a response tonight.
@emmanuelogbewe2334
7 жыл бұрын
Sean Allen thanks I appreciate it
@emin_ui
6 жыл бұрын
Such an awesome tutorial and everything was very clean man. Tnx for this! Btw there is an editing error in 9:17 :)
@seanallen
6 жыл бұрын
Haha, yeah... I noticed after I uploaded back then. The video had already been up for a bit, so I didn't want to re upload... just living with it, lol. Glad you enjoyed it!
@thetechsack
5 жыл бұрын
No need to copy paste code when you can refactor-> extract method
@seanallen
5 жыл бұрын
That feature didn't exist in Xcode (for Swift) when this video was created.
@devsang
4 жыл бұрын
Great tutorials!
@MasteRock87
6 жыл бұрын
Didn't get the line where you set the transition for the sender to zero while the pan gesture recognizer is moving or begin to move?
@seanallen
6 жыл бұрын
Did you try downloading the source code in the description? If you're having issues with the code, try downloading that and comparing my code with yours.
@MasteRock87
6 жыл бұрын
Sorry i should've explained my comment further, i didn't understand why you set the transition for the sender to zero :)
@MortalKombatant
6 жыл бұрын
MasteRock87 yes I also wanna ask same why sender.Transaltion(CGPoint.zero ????
@toastrecon
6 жыл бұрын
I found this on StackOverflow: (below) It has to do with making sure that you're using the right reference point. Your gesture is just returning a stream of vectors, and to keep the fileImageView in sync, you have to keep the origin in sync, also. I'm still new, so I'm not 100% on this. stackoverflow.com/questions/29558622/pan-gesture-why-need-settranslation-to-zero
@emmanuelogbewe2334
7 жыл бұрын
Hey there, great tutorial I was wondering if u have a Video on how I can take a video from the phones library and input it into a table cell like a feed similar to Instagram ?
@seanallen
7 жыл бұрын
+Emmanuel Ogbewe Hey Emmanuel, glad you enjoyed the video. I do not currently have a video on how to access video from the phones library, but I've implemented that exact feature before, so I'm happy to help if you'd like to reach out over email or twitter DM.
@emmanuelogbewe2334
7 жыл бұрын
Sean Allen awesome thanks , where can I find your email ?
@seanallen
7 жыл бұрын
Hey Emmanuel, you can find it on my website, seanallen.co at the bottom.
@emmanuelogbewe2334
7 жыл бұрын
Sean Allen thanks
@mak_whisk
2 жыл бұрын
Thank you very much
@huahuapro
5 жыл бұрын
This one is epic!
@seanallen
5 жыл бұрын
Glad you liked it 😀
@arindamsantra2148
6 жыл бұрын
everything is fine . but it is very tough to understand for a fresher , because the speed is very high . so my suggestion is that need to explain every thing clearly . so that it will better to understand
@seanallen
6 жыл бұрын
Yes, these are some of my earlier videos. I'm improved upon the issue of talking fast in my later videos.
@zivconnect3414
5 жыл бұрын
Thanks for this great and very clear tutorial. 1. You could handle the initialization of fileViewOrigin in "case: .began" as specified here developer.apple.com/documentation/uikit/touches_presses_and_gestures/handling_uikit_gestures/handling_pan_gestures, why did you choose to initialize it in viewDidLoad? 2. why is setTranslation in moveWithPan() required, and why is it set to CGPoint.zero
@user-sq7si4jz5h
Күн бұрын
tout son bloque merci a voud❤❤
@jaiswalji1
7 жыл бұрын
you are the best
@seanallen
7 жыл бұрын
Thanks Yogesh! Hope you found the video helpful.
@romaster11111
7 жыл бұрын
Annnnd It's Gone!
@rgfgish
7 жыл бұрын
Add this in viewDidLoad if not working: fileImageView.isUserInteractionEnabled = true
@seanallen
7 жыл бұрын
Got any questions using Gesture Recognizers? Leave a comment, I'm happy to help!
@jagajith
7 жыл бұрын
What is the use for the code "sender.setTranslation(CGPoint.zero, in: view)"?
@monicaluo1122
4 жыл бұрын
@@jagajith We have grabbed the translation already, there is no need to increment it. so set it back to zero.
Пікірлер: 133