- Find
SystemCodeSnippets.codesnippets
file. For Xcode8:
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/SystemCodeSnippets.codesnippets
- Make save copy of snippets
cp SystemCodeSnippets.codesnippets ~/Desktop/
- Open in vim:
sudo vim SystemCodeSnippets.codesnippets
- Move every open bracket on new line
:%s/ {/\r{/g
- Save and close
:wq
- Restart Xcode
- ????
- PROFIT!
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
lane :bluepill do | |
scan(scheme: “myApp”, build_for_testing: true) | |
sh “bash ./bluepill.sh“ | |
end |
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 | |
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { | |
@IBOutlet weak var tableView: UITableView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
NSLayoutConstraint.activate([ | |
tableView.topAnchor.constraint(equalTo: view.topAnchor), |
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
// | |
// ScreenCapture.swift | |
// Screenotate | |
// | |
// Created by Omar Rizwan on 7/6/17. | |
// Copyright © 2017 Omar Rizwan. All rights reserved. | |
// | |
import Foundation | |
import Cocoa |
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/bash | |
# Script configuration | |
devicesArray=( | |
"iPhone 8" | |
"iPhone 8 Plus" | |
"iPhone 5s" | |
"iPhone X") |
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/bash | |
xcrun simctl delete $(xcrun simctl list | grep -o '[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}' | xargs) | |
xcrun simctl delete unavailable |
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/bash | |
xcrun simctl delete $(xcrun simctl list | grep -o '[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}' | xargs) | |
xcrun simctl delete unavailable | |
runtime="com.apple.CoreSimulator.SimRuntime.iOS-12-2" | |
xcrun simctl create "1. Monday (X)" com.apple.CoreSimulator.SimDeviceType.iPhone-X $runtime | |
xcrun simctl create "2. Tuesday (Air 2)" com.apple.CoreSimulator.SimDeviceType.iPad-Air-2 $runtime | |
xcrun simctl create "3. Wednesday (8)" com.apple.CoreSimulator.SimDeviceType.iPhone-8 $runtime | |
xcrun simctl create "4. Thursday (8 Plus)" com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus $runtime | |
xcrun simctl create "5. Friday (SE)" com.apple.CoreSimulator.SimDeviceType.iPhone-SE $runtime |
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
// tl;dr: FileManager.default.url(for:in:appropriateFor:create:) has unexpected behavior in Simulator and creates temporary folders outside the tmp/ directory. | |
let tmpDirClassic = NSTemporaryDirectory() | |
print("tmpDirClassic: \(tmpDirClassic)") | |
// This is the same code, just syntax sugar for NSTemporaryDirectory() | |
// https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/FileManager.swift#L1420-L1422 | |
let tmpDirClassicNewShim = FileManager.default.temporaryDirectory | |
print("tmpDirClassicNewShim: \(tmpDirClassicNewShim)") | |
// Simulator: /Users/steipete/Library/Developer/CoreSimulator/Devices/31C05637-B9C9-482C-A6CE-D063A7CECF64/data/Containers/Data/Application/A68D11A4-88BA-4FCF-A8B1-D102945D0740/tmp/ |
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
/// `ObjectBinding` used as a way to create a `Binding` from a `BindableObject`. In this case the ViewModel | |
/// complies with `BindableObject` which is then translated into a `Binding` which is what `Toggle` is expecting | |
/// NOTE: Since it's a `DynamicViewProperty`, after its value is changed, the body will be updated. | |
class ViewModel: BindableObject { | |
let didChange = PassthroughSubject<ViewModel, Never>() | |
var isEnabled = false { | |
didSet { | |
didChange.send(self) |
After adding the Extension target to a project
- Go to the menu bar -> Product -> Scheme -> Edit Scheme.
- Under the info tab change the executable dropdown menu to "Xcode.app".
- If you have a testing file add it to the "Arguments Passed On Launch" field under the Arguments tab.