This repo contains an Xcode 9 playground for exploring Swift 4 generics. Question 1: Can I write one Swift function that can find the index/position of any specific instance of any type stored in any array that stores objects of that type? Question 2: Can I write one Swift function that can determine if any specific instance of any type exists in any array that stores objects of that type? When I say "any type," I mean including custom types (like classes) that I define myself. NOTE: Yes, I know that I could use Swift Array type's built-in functions, index and contains, but I'll be using simple example code today to illustrate some points about Swift generics.
-
Notifications
You must be signed in to change notification settings - Fork 0
An Xcode 9 playground for exploring Swift 4 generics.
License
iosbrain/Swift-4-Generics-Playground
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
An Xcode 9 playground for exploring Swift 4 generics.
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published