Skip to content
A simple cheat sheet for Swift Optionals
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
css
js
LICENSE
index.html
readme.md

readme.md

optionals.org

A simple cheat sheet for Swift Optionals.

Contributions

It was designed to make contributing easy and uses Splash for syntax highlighting.

You can send a pull request or create an issue.

Pull Requests

Headings

The site uses h2 tags as section headings and h3 headings for optional subheadings (headings are lowercase).

Example:

<h2>guard</h2> 
<h3>optional subheading for guard</h3>

Code Snippet

Simply use Splash or splash.rambo.codes to create the html code.

For example:

Splash Command

swift run SplashHTMLGen "guard let value = optional else { return }"

Generated HTML

<span class="keyword">guard let</span> value = optional <span class="keyword">else</span> { <span class="keyword">return</span> }

Final Result

<h2>guard</h2> 
<span class="keyword">guard let</span> value = optional <span class="keyword">else</span> { <span class="keyword">return</span> }

Note: Use &nbsp;&nbsp; for indent spacing

You can’t perform that action at this time.