Thanks Kyle Lee -> It is always a pleasure listening to you boy, it is funny on the one hand but also very instructive and informativ. You always make me feel better due to your strong positive attitude and joy you seem to have when coding. Thumbs up! 👍🏻 Have a nice day and thank you very much indeed. 😁
Absolutely! That’s actually the whole point of the Slack community. It makes it easier for me to respond as I check Slack constantly throughout the day and it allows my students to send code snippets as to what they’re doing and what’s wrong in their project.
Hey Kyle, really like your approach, and a big fan. What would you think of using Dependency Injection instead of the method in the Alertservice class?
Kilo Loco I have two topics actually lol. The callback method would be great for a start, also a collectionView inside a tableViewCell, how to achieve it’s dataSource and delegate! Ty again!
A good place to start for closures/callbacks would be these two videos th-cam.com/video/vST4UN4s1kg/w-d-xo.html th-cam.com/video/YqhvVyiEpI0/w-d-xo.html I will add collection views inside of tables views to the list of topics to cover trello.com/c/yT5m5a3M
What? 35% for the background transparency? Darn it, Kyle, you told me 40% once when I asked on Twitter! Ha ha ha. Just giving you a hard time. I like how you made the popup expandable on the content. That was super cool. Hey, I had an idea with the AlertService class. My coworker gave us this idea. He started creating the view controller initialization function right in the view controller itself. So maybe instead of the AlertService, that logic would be in the AlertViewController. Something like this: It's static so in other view controllers you would use like this: class AlertViewController: UIViewController { @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var bodyLabel: UILabel! @IBOutlet weak var actionButton: UIButton! var buttonAction: (() -> Void)? static func create(title: String, body: String, buttonTitle: String, completion: @escaping () -> Void) -> AlertViewController { let storyboard = UIStoryboard(name: "AlertStoryboard", bundle: nil) let alertVC = storyboard.instantiateInitialViewController() as! AlertViewController alertVC.titleLabel.text = title alertVC.bodyLabel.text = body alertVC.actionButton.setTitle(buttonTitle, for: .normal) alertVC.buttonAction = completion return alertVC } // Other functions } It's static so you'd call it something like this from other view controllers: class ViewController: UIViewController { @IBOutlet weak var emojiLabel: UILabel! @IBAction func didTapSubscribe() { let alertVC = AlertViewController.create(title: "Subscribe?", body: "Please subscribe to the channel if you found this helpful", buttonTitle: "Confirm") { [weak self] in self?.emojiLabel.text = "😁" } present(alertVC, animated: true) } } Just wanted to share that. Since our coworker showed us this way, we've been using it ever since because it's just so handy.
Lol, actually what I told you on twitter was exactly right. Only problem is that I forgot what that number was and I was too lazy to go back and find the video. At least now I'll remember that it is 40% In regards to the your method for the Alert View Controller, that is a really good idea, I've actually come up with several ways of making alert controllers dynamic like this. The problem is there's always this huge debate on what's the best and proper way of doing these things and some people argue about static properties, others argue about singletons, but the one thing no1 seems to argue about is dependency injection. At work I actually use a method very similar to your suggestion on one of the projects, except its a distance method in the extension of UIViewController. I just call it like presentAlert(title: String, message: String, execute: @escaping () -> Void) . Alerts are always used in view controllers but this is something that would be frowned upon in some groups. Anyways, I appreciate the suggestion, and I love your content 😁 Also if there's something we can collaborate on, let me know. I think we're the only two iOS content creators with family to support, so I think there might be a lot in common or something that we could come together on with a perspective that some other content creators don't have.
@@Kilo_Loco , oh that's cool too. You said, "...distance method in the extension..."? I'm not sure what you mean. I hear ya on the family, ha ha. If I think of anything I'll definitely let you know. Got my hands full right now. I'm starting to create a new course for this company Pluralsight that's here in Utah. Online tech training company. We'll see how that goes and if it's financially viable.
First of all, thanks for sharing this nice tutorial with us man :). Second, I would like to ask you something. In case that my alert has some textfields, switches, date pickers, how can I retrieve data from there?
At 3:27 you selected a view but referred to it as a container view. That threw me off a bit. But nevertheless this was an awesome and extremely useful tutorial. Thank-you!
Hi Kilo, nice tutorial. Just i have one query, if i want to create callback for cancel button also, then how can we do and how can we access in alertservices file, Please can you write just one line cod e here. Thanks in advance
Hello I wanted to ask you a question .. If the text of the alert is longer than the view that contains it? How can this be solved? can you give a small example?
can you do video, where we have a minimised controller over a mainViewController, just like. youtube where you can interact with both the view controllers
Nice video. Although, I'd prefer extending UIViewController instead of making AlertService. That would result in just calling showAlert("title", bla bla bla) { }
Best tutorial I've seen on this kind of thing. Thank you!!!! Also love the production quality
You've just saved my day. Ure not only a teacher but also a good guy.
This was the best tutorial I have seen, very well explained, awesome presentation. Great work!!!
This was incredible, the explanation was clear, well presented, an excellent teacher. Congratulations and thanks for sharing.
Thank you so much for this video, very easiest way to create custom alert. Nice explanation.
Thank you , keep on providing valuable content :)
Thanks Kyle Lee -> It is always a pleasure listening to you boy, it is funny on the one hand but also very instructive and informativ. You always make me feel better due to your strong positive attitude and joy you seem to have when coding. Thumbs up! 👍🏻 Have a nice day and thank you very much indeed. 😁
Glad that you can enjoy the content on several levels. Hope I can keep up the quality to keep people like you coming back 😁
Fantastic tut. As always
Great job! Your videos are really helping me progress! Straight to the point and relevant.
And hopefully a little entertaining while you’re learning 😉
Kilo Loco if we sign up for the monthly thing can we get assistance on slack with questions about other items besides what’s in the videos?
Absolutely! That’s actually the whole point of the Slack community. It makes it easier for me to respond as I check Slack constantly throughout the day and it allows my students to send code snippets as to what they’re doing and what’s wrong in their project.
God dammit, its 3:07 AM and instead of sleeping im laying in bed watching Your tutorial how to make sexy ass alerts, that how good Your content is.
Haha! Glad to hear that my content is entertaining enough to keep you awake. Help me deprive more people of sleep by sharing the channel 😉
Hey Kyle, really like your approach, and a big fan.
What would you think of using Dependency Injection instead of the method in the Alertservice class?
Muy simple y útil para aplicar. Gracias.
that was an awwwwsome lesson with great content and passionate explanation , thanks kilo
My pleasure 😁
"Nice and stretched out" lmao. Thank you for the tutorial
great job Kilo. I'd like a tutorial on callbacks in Swift plz
Will do
trello.com/c/KYvRtwaB
Good job Kilo
HAHA thanks!
Man this is straight sauce.
Thanks a lot. Great job
Great Video :))). Yes it would be cool if you can make a video about closures
Alright, I got it down as one of the topics to cover
trello.com/c/KYvRtwaB
Great video Kilo!! Make more!
I plan on keeping them coming. Got big plans for the channel 😁
Brilliant!
This is an awesome tutorial. Love your videos. Would love to have a video on closures.
Glad you liked it. I will definitely add closures to the list of todos trello.com/c/KYvRtwaB
Thank you Kilo, great video as always 👏🏼
Thanks! If there’s anyway to make my content better or if there’s a topic you want covered, please let me know.
Kilo Loco I have two topics actually lol. The callback method would be great for a start, also a collectionView inside a tableViewCell, how to achieve it’s dataSource and delegate! Ty again!
A good place to start for closures/callbacks would be these two videos
th-cam.com/video/vST4UN4s1kg/w-d-xo.html
th-cam.com/video/YqhvVyiEpI0/w-d-xo.html
I will add collection views inside of tables views to the list of topics to cover
trello.com/c/yT5m5a3M
Thank you so much, you're the best !
yes. yes. omg yes.
thankyou
What? 35% for the background transparency? Darn it, Kyle, you told me 40% once when I asked on Twitter! Ha ha ha. Just giving you a hard time.
I like how you made the popup expandable on the content. That was super cool.
Hey, I had an idea with the AlertService class. My coworker gave us this idea. He started creating the view controller initialization function right in the view controller itself. So maybe instead of the AlertService, that logic would be in the AlertViewController. Something like this:
It's static so in other view controllers you would use like this:
class AlertViewController: UIViewController {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var bodyLabel: UILabel!
@IBOutlet weak var actionButton: UIButton!
var buttonAction: (() -> Void)?
static func create(title: String, body: String, buttonTitle: String, completion: @escaping () -> Void) -> AlertViewController {
let storyboard = UIStoryboard(name: "AlertStoryboard", bundle: nil)
let alertVC = storyboard.instantiateInitialViewController() as! AlertViewController
alertVC.titleLabel.text = title
alertVC.bodyLabel.text = body
alertVC.actionButton.setTitle(buttonTitle, for: .normal)
alertVC.buttonAction = completion
return alertVC
}
// Other functions
}
It's static so you'd call it something like this from other view controllers:
class ViewController: UIViewController {
@IBOutlet weak var emojiLabel: UILabel!
@IBAction func didTapSubscribe() {
let alertVC = AlertViewController.create(title: "Subscribe?", body: "Please subscribe to the channel if you found this helpful", buttonTitle: "Confirm") { [weak self] in
self?.emojiLabel.text = "😁"
}
present(alertVC, animated: true)
}
}
Just wanted to share that. Since our coworker showed us this way, we've been using it ever since because it's just so handy.
Lol, actually what I told you on twitter was exactly right. Only problem is that I forgot what that number was and I was too lazy to go back and find the video. At least now I'll remember that it is 40%
In regards to the your method for the Alert View Controller, that is a really good idea, I've actually come up with several ways of making alert controllers dynamic like this. The problem is there's always this huge debate on what's the best and proper way of doing these things and some people argue about static properties, others argue about singletons, but the one thing no1 seems to argue about is dependency injection.
At work I actually use a method very similar to your suggestion on one of the projects, except its a distance method in the extension of UIViewController. I just call it like presentAlert(title: String, message: String, execute: @escaping () -> Void) . Alerts are always used in view controllers but this is something that would be frowned upon in some groups.
Anyways, I appreciate the suggestion, and I love your content 😁
Also if there's something we can collaborate on, let me know. I think we're the only two iOS content creators with family to support, so I think there might be a lot in common or something that we could come together on with a perspective that some other content creators don't have.
@@Kilo_Loco , oh that's cool too. You said, "...distance method in the extension..."? I'm not sure what you mean. I hear ya on the family, ha ha. If I think of anything I'll definitely let you know. Got my hands full right now. I'm starting to create a new course for this company Pluralsight that's here in Utah. Online tech training company. We'll see how that goes and if it's financially viable.
Thank you so much. It is really helpful to me. 👍
Thanks for the tutorial, we can also use view controllers with xibs instead of a new storyboard
Yes absolutely you can
Thank you! very helpful
Thanks! Helped a lot :)
This is a life saver any idea how to add a UITableview instead of passing a label this would really help a lot pls!
Fantastic! Thanks...
Thanks so much! You're the best teacher in this fucking world! )
Thanks! But if 2 or more buttons in alert view controller? how do I add another button in alertservice?
Nice! Thank you very much 👍👍👍
Always a pleasure! If there’s anyway to make my content better or if there’s a topic you want covered, please let me know.
Hi man, its fantastic, but a have one question, how can I do the callback when I press cancel button
First of all, thanks for sharing this nice tutorial with us man :). Second, I would like to ask you something. In case that my alert has some textfields, switches, date pickers, how can I retrieve data from there?
If we want to show this popup just before view controller appear, that is on to the splash screen then what we can do here? Please suggest
That was nice!
Thanks! If there’s anyway to make my content better or if there’s a topic you want covered, please let me know.
At 3:27 you selected a view but referred to it as a container view. That threw me off a bit. But nevertheless this was an awesome and extremely useful tutorial. Thank-you!
Yeah that threw me too! My view comes up as transparent and I've no idea why! :D
thank u bro 🌹
Thanks!
You’re welcome 😇 If there’s anyway to make my content better or if there’s a topic you want covered, please let me know.
Friend, how to pasa data from custom dialog to main viewcontroller? Can you help me.
Hi Kilo, nice tutorial. Just i have one query, if i want to create callback for cancel button also, then how can we do and how can we access in alertservices file, Please can you write just one line cod e here. Thanks in advance
Hello I wanted to ask you a question .. If the text of the alert is longer than the view that contains it? How can this be solved? can you give a small example?
what if the alert action return string how to do it? Thanks pls help
can you do video, where we have a minimised controller over a mainViewController, just like. youtube where you can interact with both the view controllers
I will add that to the list of todos
Nice video. Although, I'd prefer extending UIViewController instead of making AlertService. That would result in just calling showAlert("title", bla bla bla) { }
God damn, its BuTTon, not Buhon..