josshad/EHHorizontalSelectionView

Issue in Swift

Closed this issue · 4 comments

I was added all three methods in my swift view controller

screen shot 2016-09-21 at 4 17 46 pm

func numberOfItemsInHorizontalSelection(hSelView: EHHorizontalSelectionView) -> UInt {

}

func titleForItemAtIndex(index: Int, forHorisontalSelection hSelView: EHHorizontalSelectionView) -> String? {

}

func horizontalSelection(hSelView: EHHorizontalSelectionView, didSelectObjectAtIndex index: UInt) {

}

getting error for protocol does not confirmed.

please help me.

Thanks.

Hello

func numberOfItemsInHorizontalSelection(hSelView: EHHorizontalSelectionView) -> UInt {
    return 0;
}

func titleForItemAtIndex(index: UInt, forHorisontalSelection hSelView: EHHorizontalSelectionView) -> String? {
    return "";
}

func horizontalSelection(hSelView: EHHorizontalSelectionView, didSelectObjectAtIndex index: UInt) {

}

With these methods my project succesfully compiles.

I am compiled project in xCode 8. and got this error.

Xcode 8 suggests this syntax

func numberOfItems(inHorizontalSelection hSelView: EHHorizontalSelectionView) -> UInt {
    return 0;
}

func titleForItem(at index: UInt, forHorisontalSelection hSelView: EHHorizontalSelectionView) -> String? {
    return "";
}

func horizontalSelection(_ hSelView: EHHorizontalSelectionView, didSelectObjectAt index: UInt) {

}

Thank you @joashad

It's working for me.

Thanks again.