Skip to content

Instantly share code, notes, and snippets.

View CrystDragon's full-sized avatar

Lincoln Wu CrystDragon

View GitHub Profile
@objc func _needsDoubleUpdateConstraintsPass() -> Bool {
return true
}
override var intrinsicContentSize: CGSize {
  return attributedText?.size(forWidth: (engineBounds ?? bounds).width) ?? .zero
}
var engineBounds: CGRect? {
let objcSelector = "_nsis_compatibleBoundsInEngine:")
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

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.

@nevan
nevan / gist:3e1174f27e753db4731e
Last active January 9, 2022 19:04
WWDC 2015 Session Videos
https://developer.apple.com/videos/wwdc/2015/?id=101 101 Keynote
https://developer.apple.com/videos/wwdc/2015/?id=102 102 Platforms State of the Union
https://developer.apple.com/videos/wwdc/2015/?id=103 103 Apple Design Awards
https://developer.apple.com/videos/wwdc/2015/?id=104 104 What's New in Xcode
https://developer.apple.com/videos/wwdc/2015/?id=105 105 Introducing WatchKit for watchOS 2
https://developer.apple.com/videos/wwdc/2015/?id=106 106 What's New in Swift
https://developer.apple.com/videos/wwdc/2015/?id=107 107 What's New in Cocoa Touch
https://developer.apple.com/videos/wwdc/2015/?id=108 108 Building Watch Apps
https://developer.apple.com/videos/wwdc/2015/?id=112 112 Think Audacious
https://developer.apple.com/videos/wwdc/2015/?id=201 201 iOS Accessibility