Hi Aivars, thank you very much for a great and helpful presentation. I was surfing the internet for a decent and simple solution and luckily I stumbled across yours. Congratulations for the well defined explanations and the clarity of your video. Take care 🙂
Hey man I just want to say this is a massive help. I have spent countless hours watching tutorials on this type of slide-up bottom card that are only like 50% as good and theres always some glitchy part or something isnt quite right. This tutorial does it completely perfectly. It looks so professional. Thank you so much you have earned another subscriber.
Thank you for letting me know this! That's for sure a bit of extra effort to make a tutorial or something that you just figured out how to do, but that's very rewarding to hear back from guys like you, for whom that was helpful :)
Out of all the tutorials I've seen on this feature, this is by far the best one. Ive watched videos that are at least 30 mins long and here you are smashing it in 15 minutes! Thanks and subscribed :)
I know this is maybe a little old to receive a reply but how do you pass parameters from the ViewController to the OverlayView: UIViewController. I have a hard time adding the necessary initializers/init. By the way, this is a great tutorial and I wish I saw more tutorials from you.
I'm passing size only to the UIPresentationController if that should be dynamic All the other parameters for the screen, buttons, etc are in UIViewController which is presented by UIPresentationController.
For everyone wondering how to change the height dynamically: inside the PresentationController class in the init function, check the presentingViewController with an if statement like "if presentingViewController.className == "YourVC", height = 50" and then inside the frameOfPresentedVC function set the height to the global height variable. To get the class name, you need to write an extension somewhere: extension ViewController { var className: String { NSStringFromClass(self.classForCoder).components(separateBy: ".").last! } } Don't forget to implement the delegate method mentioned in the video, otherwise your presentingViewController will return nil.
Hey Aivars, I know this is an older tutorial, but maybe you can help anyways. How to modify the code, so that the view appears from the left and dismisses to the right again (instead from bottom to top). Or does it require massive code changes? Thanks for the great tutorial by the way
Oh, its beed a while since I created that tutorial. There was file where I specify how far slider should go and so one, also I used screen coordinate system to device from where it comes. That could be changed, but dismissing to another side would be significant change.
Hello Aivars! First of all: great tutorial! not too long, not too short. I could follow along and didnt feel lost in between! Thanks for that! I did however run into a problem with the code and I hope you could help: When I swipe and hold the overlayed view really fast up and down, then it freezes. It seems as it does not recognize the "sender.state == .ended" when swiping quickly up and down. Do you by chance know a solution to this problem?
Unfortunately, I can't help you with this issue. Didn't run into that when used it in production, now I'm mostly into SwiftUI for user interface development.
Hello, I want to ask a question. There is more than one button on the page and I want to open different heights of each button when clicked. How can I change the page height for each page. Thank you for answer.
Здравствуйте) Огромное спасибо за этот опыт!!! Подскажите как правильно изменить в коде, что бы оно не полностью вниз дисмиссилось, а оставалось на экране внизу полоской (с серой полоской) ?
Oh, I made that so long ago ... here what I see in my production code; Screen should be dismissed calling function : @objc func dismissController(){ self.presentedViewController.dismiss(animated: true, completion: nil) } So, you can change height of the popup view in that function insted of calling .dismiss Hight of the screen is defined in : override var frameOfPresentedViewInContainerView: CGRect { I would try to change that
First of all, thank you so much for the good lecture. I tried a half-modal View after watching your lecture, but I'm having a hard time with the height of the model view. Even though I did exactly the same as your code, in my simulator, the modal view comes up to the end, not half. I cloned your project and copied and pasted all the codes because I thought there was a problem with my code, but the results were the same. Can I know what the problem is...?
Hard to say what could be the problem if demo project dosen't work. Obviously Apple changed something in Xcode or UIKit and that broke implementation. I see that it still works just fine in project where I'm using that functionality, but didn't test demo project with newest Xcode,.
Thank you too! Thanks for watching 👍 I heard that it is easier to do that now in UIKit after WWDC, but didn't take a look, because spending most of the time in SwiftUI now
It is ok, using it daily for at leat month. Do not see problems with Apps what I use daily. Yeah, sometimes Xcode crashes, but that happened on a production version once in a while as well
Change return value in "override var frameOfPresentedViewInContainerView: CGRect {" I'm using enum to configure different sizes for different use cases
There is a function to dismiss controller: "@objc func dismissController(){ self.presentedViewController.dismiss(animated: true, completion: nil) }" I created a protocol and called dismiss function from it.
first thought... and a suggestion... content, specially text can hardly be read because I am watching this on a small screen. please consider about that next time. You are recording on a larger screen.
Right, sorry about that. I realised that only during editing. There is GitHub with all the project files linked below, please use them to do not write manually all that code.
@@AivarsMeijers tried with GitHub demo project, but it’s not working, can You help me out for this move to top and there is no code for move to top in the GitHub demo project.
@@surendrareddy8374 Ah, you are dragging to the top. Ok, clear, there is size limitation for the popup sheet. Check out: class PresentationController Play around with this function: override var frameOfPresentedViewInContainerView: CGRect { CGRect(origin: CGPoint(x: 0, y: self.containerView!.frame.height * 0.4), size: CGSize(width: self.containerView!.frame.width, height: self.containerView!.frame.height * 0.6)) }
@@AivarsMeijers this function is increasing the pop up sheet but my requirement is Initially I have to show half of the bottom sheet like 500 height .. but when the user moves to the up it should move to a bit up like 600
Hi Aivars, thank you very much for a great and helpful presentation. I was surfing the internet for a decent and simple solution and luckily I stumbled across yours. Congratulations for the well defined explanations and the clarity of your video. Take care 🙂
Glad it helped!
Hey man I just want to say this is a massive help. I have spent countless hours watching tutorials on this type of slide-up bottom card that are only like 50% as good and theres always some glitchy part or something isnt quite right. This tutorial does it completely perfectly. It looks so professional. Thank you so much you have earned another subscriber.
Thank you for letting me know this! That's for sure a bit of extra effort to make a tutorial or something that you just figured out how to do, but that's very rewarding to hear back from guys like you, for whom that was helpful :)
Out of all the tutorials I've seen on this feature, this is by far the best one. Ive watched videos that are at least 30 mins long and here you are smashing it in 15 minutes! Thanks and subscribed :)
Great to hear!
Thanks for the tutorial! And the dog is cute! Hehe
Brilliant and very helpful code!!! Thanks a lot!!!
I know this is maybe a little old to receive a reply but how do you pass parameters from the ViewController to the OverlayView: UIViewController. I have a hard time adding the necessary initializers/init.
By the way, this is a great tutorial and I wish I saw more tutorials from you.
I'm passing size only to the UIPresentationController if that should be dynamic
All the other parameters for the screen, buttons, etc are in UIViewController which is presented by UIPresentationController.
For everyone wondering how to change the height dynamically: inside the PresentationController class in the init function, check the presentingViewController with an if statement like "if presentingViewController.className == "YourVC", height = 50" and then inside the frameOfPresentedVC function set the height to the global height variable.
To get the class name, you need to write an extension somewhere:
extension ViewController {
var className: String {
NSStringFromClass(self.classForCoder).components(separateBy: ".").last!
}
}
Don't forget to implement the delegate method mentioned in the video, otherwise your presentingViewController will return nil.
which delegate do you mean?
@@user-gc6gs6tw8j UIViewControllerTransitionDelegate - see @12:30 in the Video
How can i change the value of a label of the .xib, it retun me a nib. Thanks
finally ! my favorite youtuber
Thank You :) This time tutorial
@@AivarsMeijers Thank u for saving us our time! I appreciate it
Hey Aivars, I know this is an older tutorial, but maybe you can help anyways.
How to modify the code, so that the view appears from the left and dismisses to the right again (instead from bottom to top). Or does it require massive code changes?
Thanks for the great tutorial by the way
Oh, its beed a while since I created that tutorial. There was file where I specify how far slider should go and so one, also I used screen coordinate system to device from where it comes. That could be changed, but dismissing to another side would be significant change.
Hello Aivars! First of all: great tutorial! not too long, not too short. I could follow along and didnt feel lost in between! Thanks for that!
I did however run into a problem with the code and I hope you could help:
When I swipe and hold the overlayed view really fast up and down, then it freezes. It seems as it does not recognize the "sender.state == .ended" when swiping quickly up and down.
Do you by chance know a solution to this problem?
Unfortunately, I can't help you with this issue. Didn't run into that when used it in production, now I'm mostly into SwiftUI for user interface development.
Thank you very much !! I have a question.Why aren't viewdidLoad,ViewWillAppear methods fired in viewController after dismissing the card?
I doubt it should. View is already loaded. You can trigger action on Presenter disappear action. Use delegates for that
Hello, I want to ask a question. There is more than one button on the page and I want to open different heights of each button when clicked. How can I change the page height for each page. Thank you for answer.
Здравствуйте) Огромное спасибо за этот опыт!!! Подскажите как правильно изменить в коде, что бы оно не полностью вниз дисмиссилось, а оставалось на экране внизу полоской (с серой полоской) ?
Oh, I made that so long ago ... here what I see in my production code;
Screen should be dismissed calling function :
@objc func dismissController(){
self.presentedViewController.dismiss(animated: true, completion: nil)
}
So, you can change height of the popup view in that function insted of calling .dismiss
Hight of the screen is defined in : override var frameOfPresentedViewInContainerView: CGRect {
I would try to change that
@@AivarsMeijers Understand))) Great, thanks for the direction and answer , I will try it👍🏼👍🏼👍🏼)
First of all, thank you so much for the good lecture. I tried a half-modal View after watching your lecture, but I'm having a hard time with the height of the model view. Even though I did exactly the same as your code, in my simulator, the modal view comes up to the end, not half. I cloned your project and copied and pasted all the codes because I thought there was a problem with my code, but the results were the same. Can I know what the problem is...?
Hard to say what could be the problem if demo project dosen't work. Obviously Apple changed something in Xcode or UIKit and that broke implementation.
I see that it still works just fine in project where I'm using that functionality, but didn't test demo project with newest Xcode,.
@@AivarsMeijers Thank you for your answer! I've tried more since I left a comment, but I haven't solved it yet. I'll study more and solve it :)
awesome! you saved my day! thank you very much!
Thanks for this amazing guide.. One thing missing is to give it a dynamic height based on the content. Any tips on how we can implement it?
@getbiks Did you figure out how to do this? I’m trying to do the same thing.
@@amaanshah1147 Did u got dynamic height?
is there a way to allow interaction with the view controller in the back? Sort of like how apple maps works?
Sure you can do that. I used protocols for interaction handling between views.
Thank you master ✨
Thank you very much! you save my life.
Glad it helped!
Really nice... thanks
Thank you too! Thanks for watching 👍
I heard that it is easier to do that now in UIKit after WWDC, but didn't take a look, because spending most of the time in SwiftUI now
amazing
How stable is Big Sur beta? Can I use it as my primary system to develop iOS apps?
It is ok, using it daily for at leat month. Do not see problems with Apps what I use daily. Yeah, sometimes Xcode crashes, but that happened on a production version once in a while as well
Классно, давай еще UIKit
I'm balls deep in SwiftUI now, using UIKit only on one older project.
Uzreiz redzams, meistars!
mācos, bet reizēm sanāk :)
i tried to change the height in storyboard but it isnt changing.
Nope, you should change size configuration in code. Check out other comments, I answered this already. I’m on phone, can’t check code now.
@@AivarsMeijers ok, resolved it..
@@roh9934 hi
@@roh9934 how did you do it?
Nice, but when do you making video about android?)
I'm working on iOS only. If will decide one day to start Android project, then will do ¯\_(ツ)_/¯
Hi please suggest how can we handle backend for the apps?
Firebase. Easy to learn and free for up to medium size projects
How to change the height in running time?
Change return value in "override var frameOfPresentedViewInContainerView: CGRect {"
I'm using enum to configure different sizes for different use cases
can you tell me how to close it using like the "subscribe" button or something? please its urgent
There is a function to dismiss controller:
"@objc func dismissController(){
self.presentedViewController.dismiss(animated: true, completion: nil)
}"
I created a protocol and called dismiss function from it.
@@AivarsMeijers You are a life saviour, you know that?
first thought... and a suggestion... content, specially text can hardly be read because I am watching this on a small screen. please consider about that next time. You are recording on a larger screen.
Right, sorry about that. I realised that only during editing. There is GitHub with all the project files linked below, please use them to do not write manually all that code.
I am trying to drag to top but, not working 🧐
Check out link to the GitHub with demo project and try if that works
@@AivarsMeijers tried with GitHub demo project, but it’s not working, can You help me out for this move to top and there is no code for move to top in the GitHub demo project.
@@surendrareddy8374 Ah, you are dragging to the top. Ok, clear, there is size limitation for the popup sheet.
Check out: class PresentationController
Play around with this function:
override var frameOfPresentedViewInContainerView: CGRect {
CGRect(origin: CGPoint(x: 0, y: self.containerView!.frame.height * 0.4),
size: CGSize(width: self.containerView!.frame.width, height: self.containerView!.frame.height *
0.6))
}
@@AivarsMeijers this function is increasing the pop up sheet but my requirement is
Initially I have to show half of the bottom sheet like 500 height .. but when the user moves to the up it should move to a bit up like 600
@@surendrareddy8374 How were you able to achieve this? Any Suggestion will be helpful. Thanks
you saved my ass!