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 UIKit | |
import SwiftUI | |
class KeyboardViewController: UIInputViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
struct ContentView: View { | |
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 SwiftUI | |
/// A protocol that enables types whose members are made up of `Animatable` or `VectorArithmetic`-conforming properties | |
/// to become `Animatable` themselves by specifying those members. | |
/// | |
/// Here's an example of how to use this protocol: | |
/// | |
/// ``` | |
/// struct CornerRadii: AnimatableMemberHaving { | |
/// |
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 Cocoa | |
private enum Constants { | |
static let crlf: Character = "\r\n" | |
} | |
/* |
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
let sketch = require('sketch') | |
let settingsAttribute = getSettingsAttributeForKey_Value(kLowerCaseType, kLowerCaseSmallCapsSelector) | |
applySubstringFontModification() | |
//getFontAttributesForSelectedRange() | |
function applySubstringFontModification() { | |
let document = sketch.getSelectedDocument() | |
let textLayer = document.selectedLayers.layers[0] |
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
framework("CoreText"); | |
const DOM = require("sketch/dom"); | |
const textLayer = DOM.getSelectedDocument().pages[0].selectedLayers.layers[0]; | |
const textView = textLayer.sketchObject.editingDelegate().textView(); | |
// [NSTextView selectedRanges] returns an NSArray of NSValues: | |
const selectedRange = textView.selectedRanges()[0].rangeValue(); |
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
class DelegateForwarder<T: NSObjectProtocol>: NSObject { | |
// MARK: - Properties | |
weak var internalDelegate: T? | |
weak var externalDelegate: T? | |
var asConforming: T { |
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
// | |
// UnitBezier.swift | |
// | |
// Created by Matt Curtis on 12/24/18. | |
// Copyright © 2018 Matt Curtis. All rights reserved. | |
// | |
import Foundation | |
// Almost exact translation of WebKit's UnitBezier struct: |
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
framework("CoreText"); | |
const document = require("sketch").getSelectedDocument(); | |
const textLayer = document.selectedLayers.layers[0]; | |
// WORKS (System font has native support for small caps): | |
const font = NSFont.systemFontOfSize_weight(28, NSFontWeightBold); |
Checklist:
- ✅ WIFI
- ✅ Ethernet
- ✅ Display
- ✅ Touchpad
- ✅ USB (2 & 3)
- ❓ HDMI (Video works, haven't bothered to fix audio yet)
- ✅ Sleep
- ✅ Audio (No microphone)
NewerOlder