View silly.swift
//: Playground - noun: a place where people can play
import UIKit
public protocol Constructible {
init()
}
public final class MyDataSource<T: Constructible>: NSObject, UICollectionViewDataSource {
var x = T()
View miband.swift
import Cocoa
import CoreBluetooth
import PlaygroundSupport
public class BTHelper: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate {
// BLE Access
var centralManager: CBCentralManager
override init() {
self.centralManager = CBCentralManager(delegate: nil, queue: nil)
View BTWhee.swift
import Cocoa
import CoreBluetooth
import PlaygroundSupport
class BTHelper: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate {
var centralManager: CBCentralManager
override init() {
self.centralManager = CBCentralManager(delegate: nil, queue: nil)
super.init()
View CrossPlatformDefines.swift
/*
Erica Sadun, http://ericasadun.com
Cross Platform Defines
Apple Platforms Only
Will update to #if canImport() when available
*/
View sample.xml
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
View unwrap.md

Better Unwrapping

Unwrapping values is one of the most common Swift tasks and it is unnecessarily complex.

Consider the following solutions:

  • Introduce an unwrap keyword for Optional values
  • Introduce an Unwrappable protocol for associated-value enumerations.
  • Apply unwrap to non-Optional values.
View binding.md

Simplifying case syntax

  • Proposal: TBD
  • Author: Erica Sadun
  • Status: TBD
  • Review manager: TBD

Introduction

This proposal re-architects case syntax grammar to reduce potential errors and simplify unwrapping enumerations.

View diagnose.swift
import Foundation
/*
There is no problem so big so strong so bad that it cannot be solved with a surfeit of print statements
*/
// -----------------------------------------------------------
// Debug-only Printing
// -----------------------------------------------------------
View enumerated.md
View swift.rb
# -*- coding: utf-8 -*- #
module Rouge
module Lexers
class Swift < RegexLexer
tag 'swift'
filenames '*.swift'
title "Swift"