Help implementing GitHub repository

Discussion in 'iOS Programming' started by joaogfmoreira, Oct 4, 2015.

  1. joaogfmoreira macrumors newbie

    Joined:
    Feb 24, 2015
    #1
    Hello,
    I am quite new to Swift and XCode. Recently I have been implementing some github repositories into my apps but I can't seem to get this one working.
    https://github.com/yemeksepeti/YSSegmentedControl/tree/swift2.0
    Starting from a blank XCode project, I installed the file manually as it says in the instructions, but what should I do now to get something that that?
    I only have ViewController.Swift and YSSegmentedControl.swift.
    I do not really know where to go from here.. What files to create or how to call methods..

    Any help would be useful! Thank you!
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    Just to be clear: you want to use the YSSegmentedControl class from that repo in your project. You're not the author of YSSegmentedControl.

    I looked at the class and it isn't written in a way that allows it to be used from a storyboard, which is odd, and bad. It's intended that you call its initWithFrame:appearance:action: init method and add it to your view hierarchy. I guess the sample shows how to do that (I didn't look). You also need to adopt its delegate callback protocol, again, like the sample code (must) show.

    If any of that doesn't make sense you probably shouldn't use this class at this point. You'll need to learn some more about iOS development first.
     

Share This Page