Ongoing series of playground exploring Swift.
Swift
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ArrayValueVsReference.playground
CircularText.playground
ClosureASdelegate.playground
Closures.playground
ConformToCollection.playground
Enums.playground
FlatMap.playground
LetterAnimation.playground
Map.playground
ProtocolsForDataModel.playground
SafeCollection.playground
Selfie.playground
SequenceTypeExtensions.playground
StoredPropertiesInExtensions.playground
StructsToJSON.playground
Tuples.playground
weak-Unowned.playground
.gitignore
LICENSE.md
README.md

README.md

Swift-Playgrounds

Ongoing series of playgrounds exploring Swift 3.0

Tuples.playground
  • Basics.
  • Using Pattern Matching with Tuples in Switch statements.
  • Iterating over Tuples.
ArrayValueVsReference.playground
  • Explore value and reference semantics in arrays holding class objects and Structs.
Selfie.playground
  • Use Mirror to create custom string description of class objects.
ProtocolsForDataModel.playground
  • Using Protocols for a simple data model.
ClosureASdelegate.playground
  • Examples of:
    1. Traditional Delegate Pattern.
    2. Closure To Emulate the Delegate Pattern.
      
    3. A protocol that allows a type to register an object or closure for callbacks.
      
Map.playground
  • map with optional and collection types use cases.
  • map with lazy sequences.
FlatMap.playground
  • Two approaches to removing nil occurrences from an array of optionals.
CircularText.playground
  • Draws a String in a circular path into a UIGraphicsGetCurrentContext
ConformToCollection.playground
  • Example of how to make a custom linked list type conform to the Collection protocol.
SafeCollection.playground
  • Extending the Collection protocol to allow safely fetching an Element by its Index. If the subscript index is valid it return an optional: otherwise return nil.

Closures.playground

  • @escaping vs @non-escaping overview in Swift 3.

LetterAnimation.playground

  • An example of how to animate each individual letter in a string.

StoredPropertiesInExtensions.playground

  • A workaround and example of how to add extend a type with a stored properties via swift extensions.