Custom Alerts | Swift 4, Xcode 10

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

ความคิดเห็น • 71

  • @skerzo1880
    @skerzo1880 3 ปีที่แล้ว +1

    Best tutorial I've seen on this kind of thing. Thank you!!!! Also love the production quality

  • @jameskayihura1675
    @jameskayihura1675 4 ปีที่แล้ว

    You've just saved my day. Ure not only a teacher but also a good guy.

  • @nikhilthite2959
    @nikhilthite2959 5 ปีที่แล้ว +4

    This was the best tutorial I have seen, very well explained, awesome presentation. Great work!!!

  • @MarioDelfinoe
    @MarioDelfinoe 3 ปีที่แล้ว

    This was incredible, the explanation was clear, well presented, an excellent teacher. Congratulations and thanks for sharing.

  • @shobhaKhuShbhu35
    @shobhaKhuShbhu35 3 ปีที่แล้ว

    Thank you so much for this video, very easiest way to create custom alert. Nice explanation.

  • @talalbadreddine3978
    @talalbadreddine3978 2 ปีที่แล้ว +1

    Thank you , keep on providing valuable content :)

  • @RobertHolzapfel
    @RobertHolzapfel 5 ปีที่แล้ว

    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. 😁

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      Glad that you can enjoy the content on several levels. Hope I can keep up the quality to keep people like you coming back 😁

  • @xTwisteDx
    @xTwisteDx 4 ปีที่แล้ว

    Fantastic tut. As always

  • @Akonkol2
    @Akonkol2 5 ปีที่แล้ว

    Great job! Your videos are really helping me progress! Straight to the point and relevant.

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      And hopefully a little entertaining while you’re learning 😉

    • @Akonkol2
      @Akonkol2 5 ปีที่แล้ว

      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?

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      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.

  • @ConvicTPL
    @ConvicTPL 5 ปีที่แล้ว

    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.

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      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 😉

  • @Nick6661992
    @Nick6661992 3 ปีที่แล้ว +1

    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?

  • @eduardofulgencio741
    @eduardofulgencio741 4 ปีที่แล้ว

    Muy simple y útil para aplicar. Gracias.

  • @alirezaaj1957
    @alirezaaj1957 5 ปีที่แล้ว

    that was an awwwwsome lesson with great content and passionate explanation , thanks kilo

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      My pleasure 😁

  • @albertyu7051
    @albertyu7051 4 ปีที่แล้ว +1

    "Nice and stretched out" lmao. Thank you for the tutorial

  • @EulerAlvarenga1
    @EulerAlvarenga1 5 ปีที่แล้ว +4

    great job Kilo. I'd like a tutorial on callbacks in Swift plz

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      Will do
      trello.com/c/KYvRtwaB

  • @kareemdasilva
    @kareemdasilva 4 ปีที่แล้ว

    Good job Kilo

    • @Kilo_Loco
      @Kilo_Loco  4 ปีที่แล้ว

      HAHA thanks!

  • @Bamboogalou
    @Bamboogalou 4 ปีที่แล้ว

    Man this is straight sauce.

  • @jordiaguilar658
    @jordiaguilar658 3 ปีที่แล้ว

    Thanks a lot. Great job

  • @donathmm3881
    @donathmm3881 5 ปีที่แล้ว +2

    Great Video :))). Yes it would be cool if you can make a video about closures

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      Alright, I got it down as one of the topics to cover
      trello.com/c/KYvRtwaB

  • @ericsmith2405
    @ericsmith2405 5 ปีที่แล้ว

    Great video Kilo!! Make more!

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว +1

      I plan on keeping them coming. Got big plans for the channel 😁

  • @TheMakdeniz
    @TheMakdeniz 4 ปีที่แล้ว

    Brilliant!

  • @stutidobhal
    @stutidobhal 5 ปีที่แล้ว

    This is an awesome tutorial. Love your videos. Would love to have a video on closures.

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      Glad you liked it. I will definitely add closures to the list of todos trello.com/c/KYvRtwaB

  • @CuriosMindDIY
    @CuriosMindDIY 5 ปีที่แล้ว

    Thank you Kilo, great video as always 👏🏼

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว +1

      Thanks! If there’s anyway to make my content better or if there’s a topic you want covered, please let me know.

    • @CuriosMindDIY
      @CuriosMindDIY 5 ปีที่แล้ว

      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!

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      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

  • @TheTeamojacky
    @TheTeamojacky 5 ปีที่แล้ว +1

    Thank you so much, you're the best !

  • @stotchmania
    @stotchmania 2 ปีที่แล้ว

    yes. yes. omg yes.
    thankyou

  • @bigmtnstudio
    @bigmtnstudio 5 ปีที่แล้ว +1

    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.

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว +1

      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.

    • @bigmtnstudio
      @bigmtnstudio 5 ปีที่แล้ว

      @@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.

  • @maxi_798
    @maxi_798 5 ปีที่แล้ว

    Thank you so much. It is really helpful to me. 👍

  • @aliakkawi4759
    @aliakkawi4759 5 ปีที่แล้ว

    Thanks for the tutorial, we can also use view controllers with xibs instead of a new storyboard

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      Yes absolutely you can

  • @anasilvia4088
    @anasilvia4088 5 ปีที่แล้ว

    Thank you! very helpful

  • @oonarauhala9960
    @oonarauhala9960 5 ปีที่แล้ว

    Thanks! Helped a lot :)

  • @Aamirkhan-bh5yp
    @Aamirkhan-bh5yp 4 ปีที่แล้ว

    This is a life saver any idea how to add a UITableview instead of passing a label this would really help a lot pls!

  • @JohnoOz
    @JohnoOz 4 ปีที่แล้ว

    Fantastic! Thanks...

  • @it_jedi_onchill
    @it_jedi_onchill 4 ปีที่แล้ว

    Thanks so much! You're the best teacher in this fucking world! )

  • @viewsfromthenorth2308
    @viewsfromthenorth2308 4 ปีที่แล้ว +1

    Thanks! But if 2 or more buttons in alert view controller? how do I add another button in alertservice?

  • @guruitcompany
    @guruitcompany 5 ปีที่แล้ว

    Nice! Thank you very much 👍👍👍

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      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.

  • @rodherr9825
    @rodherr9825 3 ปีที่แล้ว

    Hi man, its fantastic, but a have one question, how can I do the callback when I press cancel button

  • @vitorgomes4794
    @vitorgomes4794 3 ปีที่แล้ว

    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?

  • @kapilchouhan9981
    @kapilchouhan9981 5 หลายเดือนก่อน

    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

  • @СергейПротоцкий
    @СергейПротоцкий 5 ปีที่แล้ว

    That was nice!

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      Thanks! If there’s anyway to make my content better or if there’s a topic you want covered, please let me know.

  • @falsanomo
    @falsanomo 5 ปีที่แล้ว +1

    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!

    • @42kenward
      @42kenward 3 ปีที่แล้ว

      Yeah that threw me too! My view comes up as transparent and I've no idea why! :D

  • @ALxD7MY
    @ALxD7MY 5 ปีที่แล้ว

    thank u bro 🌹

  • @luisbert8107
    @luisbert8107 5 ปีที่แล้ว

    Thanks!

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      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.

  • @elviss911
    @elviss911 5 ปีที่แล้ว

    Friend, how to pasa data from custom dialog to main viewcontroller? Can you help me.

  • @musiniganesh
    @musiniganesh 5 ปีที่แล้ว

    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

  • @Neographic84
    @Neographic84 3 ปีที่แล้ว

    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?

  • @mackyy26
    @mackyy26 4 ปีที่แล้ว

    what if the alert action return string how to do it? Thanks pls help

  • @TheKbs95
    @TheKbs95 5 ปีที่แล้ว

    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

    • @Kilo_Loco
      @Kilo_Loco  5 ปีที่แล้ว

      I will add that to the list of todos

  • @MrAmazinG023
    @MrAmazinG023 5 ปีที่แล้ว

    Nice video. Although, I'd prefer extending UIViewController instead of making AlertService. That would result in just calling showAlert("title", bla bla bla) { }

  • @anonweareleague5691
    @anonweareleague5691 4 ปีที่แล้ว

    God damn, its BuTTon, not Buhon..