Passing An Enum Type As An Generic Argument To a Function in swift 2.2 iOS
<p>I'm new to Swift iOS.. I'm trying to use enum type as input parameter to a function.. here is the </p>

<p>sample enum type:</p>

<pre><code>public enum CFScreen {

public enum CFScreen_Newsfeed: Int {

    case Newsfeed_01 = 2100
    case Newsfeed_02 = 2101
    case Newsfeed_03 = 2102
    case Newsfeed_04 = 2103
    case Newsfeed_05 = 2104
    case Newsfeed_06 = 2105
    case Newsfeed_07 = 2106
    case Newsfeed_08 = 2107
}

public enum CFScreen_Groups: Int {

    case Create = 2200
    case GoBack = 2201
}
}
</code></pre>

<p>sample function using enum type as input parameter</p>

<pre><code>func showCFScreenForEnumType(cFooter: CFScreen.CFScreen_Groups) {

    //Group Related
    switch cFooter {

    case .Create:
        print("Show Create Group")
        break

    case .GoBack:
        print("Show Go Back Screen")
        break
    }
}

func showCFScreenForEnumType(cFooter: CFScreen.CFScreen_Newsfeed) {

    //Group Related
    switch cFooter {

    case .Newsfeed_01:
        print("Show News 01")
        break

    case .Newsfeed_02:
        print("Show News 02")
        break

    case .Newsfeed_03:
        print("Show News 03")
        break

    case .Newsfeed_04:
        print("Show News 04")
        break

    case .Newsfeed_05:
        print("Show News 05")
        break

    case .Newsfeed_06:
        print("Show News 06")
        break

    case .Newsfeed_07:
        print("Show News 07")
        break

    case .Newsfeed_08:
        print("Show News 08")
        break
    }
}
</code></pre>

<p>Calling this functions as follows</p>

<pre><code>let selCFScreenG = CFScreen.CFScreen_Groups.Create
    showCFScreenForEnumType(selCFScreenG)

let selCFScreenNF = CFScreen.CFScreen_Newsfeed.Newsfeed_01
    showCFScreenForEnumType(selCFScreenNF)
</code></pre>

<p>Taken Reference from link: <a href="http://www.codingexplorer.com/enumerations-swift/" rel="nofollow">http://www.codingexplorer.com/enumerations-swift/</a></p>

<p>My question is how i can write a function that will accepting enum types generically so that i can merge these below two functions into one</p>

<pre><code>func showCFScreenForEnumType(cFooter: CFScreen.CFScreen_Groups)
func showCFScreenForEnumType(cFooter: CFScreen.CFScreen_Newsfeed)
</code></pre>