https://itunes.apple.com/us/app/macos-10-14-beta/id1354523149?mt=12
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
<?xml version="1.0" encoding="UTF-8"?> | |
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> | |
<device id="retina3_5" orientation="portrait"> | |
<adaptation id="fullscreen"/> | |
</device> | |
<dependencies> | |
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/> | |
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | |
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
</dependencies> |
The attached lldb command pblock
command lets you peek inside an Objective-C block. It tries to tell you where to find the source code for the block, and the values captured by the block when it was created.
Consider this example program:
#import <Foundation/Foundation.h>
@interface Foo: NSObject
@end
@implementation Foo
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 Cocoa | |
import MetalKit | |
@NSApplicationMain | |
class AppDelegate: NSObject, NSApplicationDelegate, MTKViewDelegate { | |
weak var window: NSWindow! | |
weak var metalView: MTKView! | |
let device = MTLCreateSystemDefaultDevice()! | |
var commandQueue: MTLCommandQueue! | |
var pipelineState: MTLRenderPipelineState! |
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 Dispatch | |
import Foundation | |
var x = 7 | |
let dd = withUnsafeBytes(of: &x, { DispatchData.init(bytes: $0) }) | |
print(dd as? Data) // Case 1: nil | |
print(dd as? NSData) // Case 2: nil | |
print(dd as Any as? Data) // Case 3: nil | |
print(dd as Any as? NSData) // Case 4: .some | |
print(dd as Any as? NSData as Data?) // Case 5: .some |
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 UIKit | |
import ImageIO | |
import MobileCoreServices | |
import PlaygroundSupport | |
let documentFolderUrl = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) | |
print(documentFolderUrl) | |
class ShapeView: UIView { | |
override class var layerClass: AnyClass { return CAShapeLayer.self } |
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
if [[ $(defaults read com.apple.Finder CreateDesktop 2>/dev/null) = YES ]]; then | |
defaults write com.apple.Finder CreateDesktop NO | |
else | |
defaults write com.apple.Finder CreateDesktop YES | |
fi |
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
#!/bin/sh | |
defaults read com.apple.finder CreateDesktop > /dev/null 2>&1 | |
enabled=$? | |
if [ "$1" = "off" ]; then | |
if [ $enabled -eq 1 ]; then | |
defaults write com.apple.finder CreateDesktop false | |
osascript -e 'tell application "Finder" to quit' | |
open -a Finder |
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 CoreGraphics; | |
typedef struct __attribute__((objc_boxable)) CGPoint CGPoint; | |
typedef struct __attribute__((objc_boxable)) CGSize CGSize; | |
typedef struct __attribute__((objc_boxable)) CGRect CGRect; | |
typedef struct __attribute__((objc_boxable)) CGVector CGVector; | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { |