If you have a lot of schemes in your Xcode project, searching for the one you want to run may be slow, even if you use the “search as you type” feature. Because of this, you may choose to hide or not generate schemes that you don’t regularly use. Here’s an example of an Xcode project with a lot of schemes:
import Foundation | |
import UIKit | |
/// Some helpers for having nice test assertions. | |
public func expectationFailure( | |
_ reason: String, | |
trace message: String) { | |
print(reason, terminator: reason == "" ? "" : "\n") | |
print(message, terminator: message == "" ? "" : "\n") | |
} |
(defun dm/kill-diff (arg) | |
"Kill added/removed lines of diff output, removing the diff markers. | |
Without a prefix argument or a positive argument, kill the added | |
lines. With a negative argument, kill the removed lines." | |
(interactive "P") | |
(kill-new | |
(thread-last (buffer-substring-no-properties | |
(region-beginning) | |
(region-end)) | |
(replace-regexp-in-string |
Most people is familiar with Xcode theme support for the text editor. You simply open Preferences, Fonts & Colors and duplicate
an existing theme (or create a new one from scratch). Xcode editor themes have the .dvtcolortheme
extension.
However, there's some support for themeing Xcode itself (fonts, gradients, colors). Xcode loads the default theme from
/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Default.dvttheme
.
.dvttheme
files are simply XML files that conform to an undocumented schema. If you want to modify any of the settings in
Default.dvttheme
, instead of modifying the bundle resource file you can instruct Xcode to load your custom .dvttheme
from
wherever you want:
(defun dm/copy-as-rtf () | |
"Export region to RTF and copy it to the clipboard." | |
(interactive) | |
(save-window-excursion | |
(let* ((buf (org-export-to-buffer 'html "*Formatted Copy*" nil nil t t)) | |
(html (with-current-buffer buf (buffer-string)))) | |
(with-current-buffer buf | |
(shell-command-on-region | |
(point-min) | |
(point-max) |
[ | |
{ | |
"spec": "com.apple.compilers.metal", | |
"path": "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Metal.xcplugin/Contents/Resources/Metal Compiler.xcspec", | |
"options": [ | |
{ | |
"name": "CLANG_DIAGNOSTICS_FILE" | |
}, | |
{ | |
"name": "MTLCOMPILER_DEPENDENCY_INFO_FILE" |
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:
defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View"