Open/Close Xcode console:
cmd+shift+y
Jump to definition, but in the assistant editor:
cmd+opt+click
Open/close navigators pane:
cmd+0
Open/close inspectors pane:
# example of a custom lldb command that prints Data as String | |
# store in your home (~) directory | |
command regex printData 's/(.+)/expr print(String(data: %1, encoding: .utf8))/' |
import Foundation | |
protocol Channel: IteratorProtocol { | |
func send(_ value: Element?) | |
} | |
/// A blocking channel for sending values. | |
/// | |
/// `send` and `receive` must run in separate separate execution contexts, otherwise you get a deadlock. | |
final class BlockingChannel<A>: Channel { |
import UIKit | |
final class ExampleViewController: UViewController { | |
private var usersBrightness = UIScreen.main.brightness | |
private var willEnterForegroundWasCalled = false | |
private var viewWillDisappearWasCalled = false | |
override func viewDidLoad() { |
// maybe someone will find this useful | |
// i was going through codewars and | |
// encountered linkedlist challenge | |
// i noticed special A -> B operator | |
// and i decided to recreate it it swift :) | |
//MARK: custom class that holds data | |
class Node<T> { | |
var data: T | |
var next: Node<T>? |
Open/Close Xcode console:
cmd+shift+y
Jump to definition, but in the assistant editor:
cmd+opt+click
Open/close navigators pane:
cmd+0
Open/close inspectors pane:
#!/bin/bash | |
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
open /Applications/Xcode.app |
alias accio=wget | |
alias avadaKedavra='rm -f' | |
alias imperio=sudo | |
alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"' | |
alias stupefy='sleep 5' | |
alias wingardiumLeviosa=mv | |
alias sonorus='set -v' | |
alias quietus='set +v' |
LLDB comes with a great set of commands for powerful debugging.
Your starting point for anything. Type help
to get a list of all commands, plus any user installed ones. Type 'help
for more information on a command. Type help
to get help for a specific option in a command too.