xcode-select --print-path
xcodebuild -version
swift --version
swift build --version
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version // Check Xcode Command-Line-Tools Version
This file contains hidden or 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 <objc/runtime.h> | |
- (NSArray *)discoverAppModuleClasses | |
{ | |
NSMutableArray *appModuleClasses = [NSMutableArray array]; | |
// Integrate all classes which comply to the provider protocol | |
unsigned int count = 0; | |
Class *classList = objc_copyClassList(&count); | |
for (NSUInteger index = 0; index < count; index++) |
This file contains hidden or 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
/** | |
* Determines the properties of @c className and returns list of these properties as strings. | |
* The method will iterate through @c className superclass hierarchy and fetch the properties from | |
* the superclass hierarchy as well. | |
* | |
* @return the list of properties found on @c className | |
*/ | |
- (NSOrderedSet<NSString *> *)getMethodListForClass:(Class)className | |
{ | |
NSMutableOrderedSet<NSString *> *propertiesList = [NSMutableOrderedSet orderedSet]; |
This file contains hidden or 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
git checkout develop | |
git pull origin develop | |
git checkout stage | |
git reset --hard develop | |
git push origin stage --force-with-lease |
This file contains hidden or 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
/// Quickly dump a UIImage from memory into a tmp file. | |
var image: UIImage? | |
// ... | |
let imageFilePath = NSTemporaryDirectory() + "\(Date().timeIntervalSince1970).png" | |
try? image.pngData()!.write(to: URL(fileURLWithPath: imageFilePath)) | |
print("Saved turn-by-turn advice image to: \(imageFilePath)") | |
You can constrain the content, the UIStackView
, to the contentLayoutGuide
top, bottom, leading, and trailing to define the scrollable area. You can then constrain the UIStackView
’s width to the frameLayoutGuide
so that it only scrolls vertically. That’s it—your content can now scroll as it shrinks or grows!
final class SomeView: UIView {
This file contains hidden or 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 | |
import UIKit | |
import Combine | |
import PlaygroundSupport | |
/// The `ScopedReceivePublisher` modifies any returned `Publisher` property of `V` to receive | |
/// published elements on the specified `Scheduler`. | |
/// | |
/// Usage: | |
/// ``` |
This file contains hidden or 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 Combine | |
import UIKit | |
/// View controller, that publishes events for it's `view`'s lifecycle, | |
/// and allows type safe access to it's main `UIView`. | |
class ObservableViewController<V: UIView>: UIViewController { | |
typealias LifecycleEvent = (view: V, animated: Bool) | |
/// Broadcasts event after the controller's view is loaded, e.g. `viewDidLoad()`. |