willhbr / swift-by-example

Quick reference for Swift on Linux

Home Page:https://willhbr.net/swift-by-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swift by Example

Build Status Swift 4.2

Inspired by Go by Example. Aimed to give an overview for common things in the standard library and Foundation. All examples should work on Linux using the latest version of the Swift compiler. Documentation for macOS- or iOS-specific APIs is a non-goal.

These are the things that I want to add at some point:

  • closures (+ @autoclosure)
  • parameters (mutability, inout)
  • Builtin datastructures (arrays, dictionaries, sets, strings)
  • Common protocols (printable, debugprintable)
  • Custom literals
  • Reading/writing files
  • TCP sockets (+ udp)
  • HTTP client
  • Threads?
  • Pattern matching
  • Structs & classes
  • Reading methods
  • CLIs + user input
  • Serialisation (JSON/YAML/plist/???)
  • Custom operators
  • Overriding operators
  • @dynamicMemberLookup
  • debugging with lldb
  • generic functions
  • generic structures
  • Parsing URLs
  • Hashing (SHA1, MD5)
  • Base64 encoding/decoding
  • Reading environment variables
  • Working with dates & times
  • Working with Strings (& Index)
  • extensions (& protocol extensions)
  • computed properties, didSet, willSet
  • Errors
  • Collection functions
  • guard
  • Random numbers
  • Tuples
  • typealiases
  • Subprocesses
  • Reflection
  • enums (with initialisers and associated values)

About

Quick reference for Swift on Linux

https://willhbr.net/swift-by-example


Languages

Language:CSS 54.8%Language:Ruby 31.2%Language:HTML 14.0%