- Copy the contents of the last snippet (lldbinit) from the gist page, and paste into your .lldbinit file. This makes the ksdiff macro known inside lldb.
- Put file ksdiff.py in ~/.lldb/
sudo pip install temp- Restart Xcode debug session
(lldb) ksdiff ;
| import Foundation | |
| func findFiles(rootPath: String, suffix: String, ignoreDirs: Bool = true) -> [String]? { | |
| var result = [String]() | |
| let fileManager = FileManager.default | |
| if let paths = fileManager.subpaths(atPath: rootPath) { | |
| let swiftPaths = paths.filter { $0.hasSuffix(suffix) } | |
| for path in swiftPaths { | |
| var isDir : ObjCBool = false | |
| let fullPath = (rootPath as NSString).appendingPathComponent(path) |
| import ReactiveSwift | |
| import Result | |
| // MARK: - Task | |
| final class Task<V, E: Error> { | |
| typealias ProcessingHandler = (@escaping (Result<V, E>) -> Void, DisposableBag) -> Void | |
| enum State { | |
| case idle |
| # Uncomment the next line to define a global platform for your project | |
| # platform :ios, '9.0' | |
| target '%TargetName%' do | |
| # Comment the next line if you're not using Swift and don't want to use dynamic frameworks | |
| use_frameworks! | |
| # Pods for %TargetName% | |
| # pod 'FBSDKCoreKit' | |
| end |
| #!/usr/bin/env bash | |
| # Put this file in /usr/local/bin and then run chmod +x on it to make it executable | |
| command=$1 | |
| shift | |
| case $command in | |
| "init" ) | |
| swift package init "$@" |
| import os.log | |
| import Foundation | |
| public struct Log { | |
| static let log = OSLog(subsystem: "domain", category: "App") | |
| static public func debug(_ message: Any) { | |
| os_log("⚪️ DEBUG - %@", log: log, type: .debug, "\(message)") | |
| } |
| // You have a very very large video file you need to upload to a server while your app is backgrounded. | |
| // Solve by using URLSession background functionality. I will here use Alamofire to enable multipart upload. | |
| class Networking { | |
| static let sharedInstance = Networking() | |
| public var sessionManager: Alamofire.SessionManager // most of your web service clients will call through sessionManager | |
| public var backgroundSessionManager: Alamofire.SessionManager // your web services you intend to keep running when the system backgrounds your app will use this | |
| private init() { | |
| self.sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default) | |
| self.backgroundSessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.background(withIdentifier: "com.lava.app.backgroundtransfer")) |
| # The trick is to link the DeviceSupport folder from the beta to the stable version. | |
| # sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
| # Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
| # Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
| # (A similar approach works for older versions too, just change the version number after DeviceSupport) |
| // UIWindow+AppSwitchScrollStopper.h | |
| // Created by Tim Johnsen on 3/27/16. | |
| #import <UIKit/UIKit.h> | |
| @interface UIWindow (AppSwitchScrollStopper) | |
| /// Call this early on in your app's lifecycle to avoid | |
| /// scroll-related flashing when your app resumes from the background | |
| - (void)installAppSwitchScrollStopper; |