View stringhygiene.swift
import Foundation
/// The direction from which a string floats when
/// padded with repeated characters.
public enum StringPadding { case left, right, center }
extension String {
/// Returns a new string made by removing whitespace from
/// both ends of the source string. Whitespace characters
/// are defined as Unicode General Category Z*,
View trim.md
View dictionaryliteral.md

Renaming the DictionaryLiteral type to KeyValueList

  • Proposal: SE-TBD
  • Author(s): Erica Sadun
  • Status: tbd
  • Review manager: tbd

Introduction

This proposal renames the confusing and misnamed DictionaryLiteral type to KeyValueList. This type is neither a dictionary nor a literal. It is a list of key-value pairs.

View OverloadCoalescingOperator.swift
import Foundation
// Inspired by Maz Jaleel, https://github.com/Mazyod
/// Unconditionally prints a given message and stops execution,
/// allowing placement at any point where a contextual type
/// is required.
///
/// For example, use to fail on unwrap:
///
View fail.swift
import Foundation
import Swift
//345678901234567890123456789012345678901234567890123456789012345678901234567890
// Inspired by Maz Jaleel, https://github.com/Mazyod
/// Unconditionally prints a given message and stops execution,
/// allowing placement at any point where a contextual type
/// is required.
View bt.swift
//
// BTHelper.swift
// Buzz
//
// Created by Erica Sadun on 4/17/18.
// Copyright © 2018 Erica Sadun. All rights reserved.
//
import Foundation
import CoreBluetooth
View buzz.swift
import UIKit
class ViewController: UIViewController {
var btHelper: BTHelper = BTHelper()
var timer: Timer? = nil
var bgTask = BackgroundTask()
@objc func stop() { btHelper.shutOff() }
@objc func action() { btHelper.startUp() }
View stream.swift
/// A type that provides sequential access to generated elements.
///
/// A stream represents an infinite number of data elements made
/// available over time. The data may be algorithmic or random.
/// The most common way to access is to request one or more
/// elements from the stream.
///
/// This capability enables you to perform shared operations that
/// work on any stream.
///
View MapApply.swift
extension Sequence {
/// Returns an array created by applying an instance
/// method to each element of a source sequence.
/// This method address the problem caused by mapping
/// instance methods:
///
/// ["a", "b", "c"].map(String.uppercased)
///
/// This statement returns `[(Function), (Function), (Function)]`,
/// which is essentially `[{ String.uppercased("a"), ... }]`
View Striding.swift
/// A strided non-contiguous sequence of elements that incorporates
/// every nth element of a base sequence.
///
/// When used with collections, the sequence includes the first element
/// followed by the element at the `startIndex` offset by the `stride`,
/// by 2 * the `stride`, etc.
///
/// ```
/// for value in myArray.striding(by: 5) {
/// // process every 5th member, starting with the