# enable internal menu
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES
alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
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 | |
protocol TransformerType { | |
associatedtype BaseType | |
associatedtype TypeForCoding: Codable | |
static var encodeTransform: (BaseType) throws -> TypeForCoding { get } | |
static var decodeTransform: (TypeForCoding) throws -> BaseType { get } | |
} | |
@propertyWrapper |
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
struct Contact: Decodable, CustomStringConvertible { | |
var id: String | |
@NestedKey | |
var firstname: String | |
@NestedKey | |
var lastname: String | |
@NestedKey | |
var address: String | |
enum CodingKeys: String, NestableCodingKey { |
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
/*: | |
This is a concept re-implementation of the @Binding and @State property wrappers from SwiftUI | |
The only purpose of this code is to implement those wrappers myself | |
just to understand how they work internally and why they are needed, | |
⚠️ This is not supposed to be a reference implementation nor cover all | |
subtleties of the real Binding and State types. | |
The only purpose of this playground is to show how re-implementing | |
them myself has helped me understand the whole thing better |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Localize.py - Incremental localization on XCode projects | |
# João Moreno 2009 | |
# http://joaomoreno.com/ | |
# Modified by Steve Streeting 2010 http://www.stevestreeting.com | |
# Changes | |
# - Use .strings files encoded as UTF-8 |
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
#!/bin/sh | |
set -e | |
if [ -z "${CONFIGURATION}" ]; then | |
CONFIGURATION=debug | |
fi | |
# Create the development toolchain. | |
rm -rf ~/public/swift-project/build/Ninja-ReleaseAssert/swift-dev.xctoolchain |
- Xcode build duration
defaults write com.apple.dt.Xcode ShowBuildOperationDuration -bool YES
- Faster build times by leveraging multi-core CPU
defaults write com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks `sysctl -n hw.ncpu`
- Flag to emit warnings whenever a function takes longer than some threshold to compile. Add the following to Other Swift Flags
-Xfrontend -warn-long-function-bodies=100
, where 100 is the number of milliseconds you’d like the warning threshold to be
- To enable warn about individual expressions that take a long time to type check, go the Build Settings, “Swift Compiler - Custom Flags”, “Other Swift Flags”, and add:
-Xfrontend -warn-long-expression-type-checking=
where `` is the lower limit of the number of milliseconds that an expression must take to type check in order for the warning to be emitted.
A string identifying the build system action being performed.
The locations of any sparse SDKs that should be layered on top of the one specified by Base SDK (SDKROOT
). If more than one SDK is listed, the first one has highest precedence. Every SDK specified in this setting should be a "sparse" SDK, for example, not an SDK for an entire macOS release.
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
#!/bin/sh | |
PLIST_BUDDY=/usr/libexec/PlistBuddy | |
function add_compatibility() { | |
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \ | |
"$1/Contents/Info.plist" | |
} | |
function has_compatibility() { |
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
#!/bin/sh | |
#ID='A16FF353-8441-459E-A50C-B071F53F51B7' # Xcode 6.2 | |
#ID='992275C1-432A-4CF7-B659-D84ED6D42D3F' # Xcode 6.3 | |
#ID='E969541F-E6F9-4D25-8158-72DC3545A6C6' # Xcode 6.3.2 | |
ID=`/usr/libexec/PlistBuddy -c 'Print DVTPlugInCompatibilityUUID' "$(xcode-select -p)/../Info.plist"` | |
PLIST_BUDDY=/usr/libexec/PlistBuddy |