Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

joaogfmoreira

macrumors newbie
Original poster
Feb 24, 2015
24
0
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!
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.