UISegmentedControl - Storyboard & Programmatic - Swift

Поділитися
Вставка
  • Опубліковано 18 січ 2025

КОМЕНТАРІ • 33

  • @seanallen
    @seanallen  4 роки тому

    Watch Next - iOS Dev Launchpad - ua-cam.com/video/poQZDVKOZOE/v-deo.html

  • @Vlad999-q9z
    @Vlad999-q9z 4 роки тому +2

    Sean, your explanation on this subject is extremely helpful, thank you very much!

  • @youbillonestv
    @youbillonestv 3 роки тому +2

    Thank Sean! this is what i am looking. Doing segmented controller both tru Storyboard and programmatic.

  • @alexandrgrigoryev9383
    @alexandrgrigoryev9383 4 роки тому +2

    Thanks a lot my friend for your job. You are doing really good stuff. I love it. Respect from CZ.

  • @mracipayam
    @mracipayam 4 роки тому +2

    Great explanation, it clicked for me :) , thanks Sean you are great.

  • @donathmm3881
    @donathmm3881 4 роки тому +1

    I like the arrow Overlays. Good vid

    • @seanallen
      @seanallen  4 роки тому

      Me too. Really helps point things out.

  • @fedemtz6
    @fedemtz6 3 роки тому +1

    I would also add 'segmentedControl.selectedSegmentIndex = 0' in the setup function so that it defaults to selecting the first item and let's the user know what is selected when the app starts

  • @tariqAlmazyad
    @tariqAlmazyad 4 роки тому +1

    Hi Sean . Can you make a video how to add badge counter to UIButton and/or UIImageView ?
    The counter could be Int , or string .

  • @AmitBiswastunebox
    @AmitBiswastunebox 4 роки тому +1

    Hey @sean I bought your course from Teachable , where is the Slack Channel ? I cant see.

    • @seanallen
      @seanallen  4 роки тому +2

      The link for the Slack Channel will show up when the first batch of videos releases in the next day or two.

    • @AmitBiswastunebox
      @AmitBiswastunebox 4 роки тому +2

      Sean Allen Sean is incredible developer and teacher 👨‍🏫. Love to watch his tutorial.

  • @goraghosh4581
    @goraghosh4581 3 роки тому

    Hi Sean, how to change the tint color of segmented control and also the Height?

  • @Tenly2009
    @Tenly2009 4 роки тому +2

    Nicely explained - as usual. Thanks for sharing!
    Also as usual, I have a suggestion, a question and a comment!
    The suggestion - in the videos you do that show both the storyboard and programmatic ways of doing something, it would be nice if the video description contained the time stamp of where the programmatic example starts. Some people have vowed never to use storyboards and would prefer to just watch the programmatic instructions (and vice versa I imagine).
    The question - I’m a “no storyboard” developer, and in today’s programmatic example, when you added the target, you left the brackets on the name of the function in the #selector() clause. Why? I didn’t even know that was possible. All of my targets just contain the function name with no brackets or parameters. What can I put inside those brackets? Can I pass arbitrary parameters (if the function is coded to accept them)? I thought when adding a target like that, I was limited to only (and automatically) having the sender passed...? My @objc functions also always accept “sender” as a parameter. I never thought about using the “_” so that I could use a parameter name more descriptive than “sender”.
    Okay - and my comment - for some of my segmented controls, I found it “better” to build my switch statement based on the “title” for the selectedSegmentIndex rather than the index value itself. It made my code easier to read and therefore to maintain. (Even if the title ends up changing, a simple search would show all the places that need updating). To use title instead of index, I just add:
    let title = sender.titleForSegment(at: sender.selectedSegmentIndex)
    at the top of the function and then switch based on the title value. It makes it easy to see what each case: statement is responding to and saves having to search through the code to find out what 0, 1, 2 and 3 are actually displaying. (This is more a tip for other readers than it is for you Sean - and I’m sure it’s not “always” better to do it this way - but it sure seems to be better for my use cases!)
    Thanks again Sean! Stay safe!

  • @kenroygayle1689
    @kenroygayle1689 4 роки тому +1

    really good video bro!! are these videos apart of your new course?

    • @seanallen
      @seanallen  4 роки тому

      Thanks Kenroy. Nope, this one is a separate video all on its own.

  • @aliufemi
    @aliufemi 4 роки тому

    Hi Sean! Can you please share the image assets you used for this tutorial? I’d like to code along when I rewatch the video. Thanks a lot for all you do.

    • @seanallen
      @seanallen  4 роки тому

      This is where I downloaded the assets from. Be careful. Lot of ads on that site. acbl.mybigcommerce.com/52-playing-cards/

    • @aliufemi
      @aliufemi 4 роки тому +1

      Thanks a lot.

  • @dlatechsolutions
    @dlatechsolutions 4 роки тому

    hola necesito utilizar un segment control pero con mas elementos, necesito que se desplace el componente de forma horizontal, ejemplo los titulares en google news

  • @EthanGromet
    @EthanGromet 4 роки тому

    Hey Sean, love your videos - super helpful! If I wanted to stick with text in the Segmented Control and wanted to customize the text color, is there a way to do that? It doesn't look like there is a text color setting in the Attributes Inspector.

    • @seanallen
      @seanallen  4 роки тому +1

      Yes, off the top of my head, I believe you need to change the "tint color" to change the text color.

  • @anjumali1681
    @anjumali1681 4 роки тому

    How we create a table like a grid in swift4 please help me

  • @michamichalik9719
    @michamichalik9719 2 роки тому

    Hi quick question. Can i change font sizes for each segment? I know i can change for all, but i want each segment to have different font size. Is it possible?

  • @pradeepkumar-tm5et
    @pradeepkumar-tm5et 4 роки тому

    Hey Sean Allen hope you are doing good. Regarding UISegmentControl I am unable to apply gradient colors to selectedSegmentTintColor property can u pls tell me how to apply gradient colors on this.

  • @Mr_Jai_Kalra
    @Mr_Jai_Kalra 4 роки тому

    Superb video as always. Actually I want to ask a question. Can you please tell me from where you learn the short keys? (Like control+i for Alignment)

    • @seanallen
      @seanallen  4 роки тому

      I've just picked them up over time. Try googling Xcode keyboard shortcuts. You'll fine a lot of resources.

  • @adamm3122
    @adamm3122 4 роки тому +1

    Dude I love your examples. Apple needs to hire you to help with explain Swift. Their documentation suuuuuucks

    • @TokyoXtreme
      @TokyoXtreme 4 роки тому

      This particular topic would be in the UIKit documentation, not Swift. What's wrong with their documentation in either one?

  • @anandkhanpara6556
    @anandkhanpara6556 4 роки тому

    Hello Sean
    What is step to change XCode selection color red.

    • @honza_kriz_bass
      @honza_kriz_bass 4 роки тому +1

      I guess I know what you mean...
      Go to Settings -> General & you'll find it there. (It applies to all apps, not just Xcode though)