- OmniFocus 4
- iA Writer
- Slack
- Hudlum
This file contains hidden or 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
| // Excerpt from https://github.com/krzyzanowskim/CoreTextWorkshop | |
| // Licence BSD-2 clause | |
| // Marcin Krzyzanowski marcin@krzyzanowskim.com | |
| func getSizeThatFits(_ attributedString: NSAttributedString, maxWidth: CGFloat) -> CGSize { | |
| let framesetter = CTFramesetterCreateWithAttributedString(attributedString) | |
| let rectPath = CGRect(origin: .zero, size: CGSize(width: maxWidth, height: 50000)) | |
| let ctFrame = CTFramesetterCreateFrame(framesetter, CFRange(), CGPath(rect: rectPath, transform: nil), nil) |
This file contains hidden or 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 | |
| enum PreviewProviderMode: CaseIterable { | |
| /// Use for a light appearance preview. | |
| case lightMode | |
| /// Use for a dark appearance preview. | |
| case darkMode | |
This file contains hidden or 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 | |
| struct Post: Decodable { | |
| let id: String | |
| let title: String | |
| let body: String | |
| } | |
| struct GraphQLResult<T: Decodable>: Decodable { | |
| let object: T? |
This file contains hidden or 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 | |
| import PlaygroundSupport | |
| struct Screen: View { | |
| var body: some View { | |
| ScrollView { | |
| VStack { | |
| Text("5:45").font(.system(size: 64, weight: .thin)) | |
| Text("Monday, May 11").font(.system(size: 24)) | |
| }.padding(.vertical, 32) |
This file contains hidden or 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
| If you work on a Swift project that follows the Model-View-ViewModel (MVVM) architecture or similar, you may want to | |
| jump to counterpart in Xcode from your view to your model, and then to your view model. (ie. by using Ctrl+Cmd+Up and Ctrl+Cmd+Down). | |
| You can do this in recent versions of Xcode by setting a configuration default. | |
| From a terminal, just type this command and press Enter: | |
| #+BEGIN_SRC sh | |
| defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View" | |
| #+END_SRC |
This file contains hidden or 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
| // MIT License applies. | |
| import UIKit | |
| /** | |
| A `UILabel` subclass that provides a way of adding padding to the label. | |
| */ | |
| open class Label: UILabel { | |
| /// The amount of padding for each side in the label. |
This file contains hidden or 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
| W = 500 | |
| H = 585 | |
| W1 = W - 1 | |
| H1 = H - 1 | |
| def setup | |
| @img = load_image '../scratch/girl.png' | |
| @img.filter BLUR, 3 | |
| @img.load_pixels | |
| end |
This file contains hidden or 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
| // | |
| // NSAttributedString+HTML.swift | |
| // | |
| // Created by Amitai Blickstein on 6/22/16. | |
| // Copyright © 2016 Amitai Blickstein, LLC. All rights reserved. | |
| // | |
| import UIKit | |
| //////////////////////// |
This file contains hidden or 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
| . |
NewerOlder