Author: Chris Lattner
protocol LayoutGuideProvider { | |
var leadingAnchor: NSLayoutXAxisAnchor { get } | |
var trailingAnchor: NSLayoutXAxisAnchor { get } | |
var leftAnchor: NSLayoutXAxisAnchor { get } | |
var rightAnchor: NSLayoutXAxisAnchor { get } | |
var topAnchor: NSLayoutYAxisAnchor { get } | |
var bottomAnchor: NSLayoutYAxisAnchor { get } | |
var widthAnchor: NSLayoutDimension { get } | |
var heightAnchor: NSLayoutDimension { get } | |
var centerXAnchor: NSLayoutXAxisAnchor { get } |
React: Unexpected use of 'location';
Solution: Use window.location
instead of bare location
.
- Proposal: SE-XXXX
- Authors: Chris Lattner, Joe Groff
Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.
This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.
using System.Threading.Tasks; | |
using Windows.Web.Http; | |
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using Windows.Networking.BackgroundTransfer; | |
using System.Diagnostics; | |
using Windows.Storage; | |
using Windows.Security.Credentials; | |
using Windows.UI.Notifications; |
## Global install of the app generator | |
npm install -g create-react-app | |
## Setup the app (first-time only) | |
create-react-app my-app | |
cd my-app | |
git init | |
# Create the Heroku app; requires free account at https://www.heroku.com/ | |
heroku create -b https://github.com/heroku/heroku-buildpack-static.git |
//: # Swift 3: Working with dates | |
import Foundation | |
let date = Date() | |
let myLocale = Locale(identifier: "bg_BG") | |
//: ### Setting an application-wide `TimeZone` | |
//: Notice how we use if-let in case the abbreviation is wrong. It will fallback to the default timezone in that case. | |
if let myTimezone = TimeZone(abbreviation: "EEST") { | |
print("\(myTimezone.identifier)") |
private var AssociatedKey: UInt = 0 | |
private final class AssociatedObjectBox<T> { | |
let value: T | |
init(_ x: T) { | |
value = x | |
} | |
} |