Shortcut | Description | Overridable?[^1] |
---|---|---|
Fn-A |
Navigate Dock | No |
Fn-Shift-A |
Launchpad | No |
Fn-C |
Control Center | No |
Fn-E |
Emoji & Symbols | Yes |
Fn-F |
Enter/Exit Full Screen | Yes |
Fn-H |
Desktop | No |
Fn-M |
Navigate Main Menu | Yes |
Fn-N |
Notifications | No |
View fn-shortcuts.md
View Bundle+TestFlight.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Security | |
extension Bundle { | |
/// Returns whether the bundle was signed for TestFlight beta distribution by checking | |
/// the existence of a specific extension (marker OID) on the code signing certificate. | |
/// | |
/// This routine is inspired by the source code from ProcInfo, the underlying library | |
/// of the WhatsYourSign code signature checking tool developed by Objective-See. Initially, |
View XCTAssertThrowsError.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
public func XCTAssertThrowsError<T, E: Error & Equatable>( | |
_ expression: @autoclosure () throws -> T, | |
expected expectedError: E, | |
_ message: String = "", | |
file: StaticString = #filePath, | |
line: UInt = #line | |
) { | |
XCTAssertThrowsError(try expression(), message, file: file, line: line) { error in |
View NSView Drawing Issue on macOS Big Sur.md
This is an excerpt from our internal documentation describing an issue with drawing in NSView
s on macOS Big Sur.
1️⃣ Introduction
In macOS Big Sur (probably starting with β9), Apple changed the default contents format for backing layers of NSView
s. Instead of an explicit CALayerContentsFormat.RGBA8Uint
value, an „Automatic“ value is now used. Even though it also resolves into „RGBA8“ in our testing, it has some serious implications as it breaks assumptions our code relies on.
I first stumbled upon this issue in this tweet by Frank. It links to a thread on Apple Forums by Mark that contains valuable information as well as ideas for workarounds. The changed behavior was also confirmed by Marcin in this tweet.
2️⃣ Impact on Diagrams
View Example.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AppKit | |
class ClockView: NSView { | |
var date: Date? | |
} | |
class ClockViewController: NSViewController { | |
View OptionalAssignment.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optional Assignment | |
infix operator =? { associativity right precedence 90 } | |
/// Given a variable and an optional value it unwraps the optional value | |
/// and if it is non-nil it assigns the value to the variable. If the value | |
/// is nil it does nothing. | |
public func =? <T>(inout variable: T, optionalValue: T?) { | |
if let value = optionalValue { | |
variable = value |
View swift-3-wishes.md
My Wishes for Swift 3.0
- Typed errors
- Property observers from outside as a replacement for KVO
- Resolving the limitation in failable class initializers which require setting all stored properties before throwing an error or returning
nil
- Operator for reversed ranges (https://medium.com/@icex33/boundary-extension-in-swift-1f577af1aaa)
- Nested types in generic types
- Packages (inside frameworks, allowing cyclic dependencies)
- Members for protocols tied to the protocol type (e.g. for implementing factories on the protocol types)
- Abstract classes & class methods
View FailableMap.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// FailableMap.swift | |
// | |
// Created by Lukas Kubanek on 06/10/15. | |
// Copyright © 2015 Lukas Kubanek. All rights reserved. | |
// | |
public extension Array { | |
/// Maps the transform over `self` and if **all** calls return a non-nil result it returns |
View NSBezierPath+CGPath.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AppKit | |
public extension NSBezierPath { | |
public convenience init(path: CGPath) { | |
self.init() | |
let pathPtr = UnsafeMutablePointer<NSBezierPath>.alloc(1) | |
pathPtr.initialize(self) | |
NewerOlder