swift cheat sheets generics and protocols