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
(lldb) po [(UIView *)0x148db5234 _whyIsThisViewNotFocusable] | |
ISSUE: This view has userInteractionEnabled set to NO. Views must allow user interaction to be focusable. | |
ISSUE: This view returns NO from -canBecomeFocused. |
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
let timer = NSTimer.scheduledTimerWithTimeInterval(1.0, target: NSBlockOperation { | |
[weak self] in | |
// Do something... | |
}, selector: "main", userInfo: nil, repeats: false) |
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
extension UILabel { | |
@IBInspectable var localizedKey: String? { | |
set { | |
if let s = newValue { | |
text = NSLocalizedString(s, comment:"") | |
} | |
} | |
get { | |
return text |
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
// | |
// Atomic.swift | |
// ReactiveCocoa | |
// | |
// Created by Justin Spahr-Summers on 2014-06-10. | |
// Copyright (c) 2014 GitHub. All rights reserved. | |
// | |
/// An atomic variable. | |
internal final class Atomic<Value> { |
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
git=`sh /etc/profile; which git` | |
appBuild=`"$git" rev-list --all |wc -l` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $appBuild" "${SRCROOT}/${INFOPLIST_FILE}" | |
echo "Updated ${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |
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
private class Block<T> { | |
let f : T | |
init (_ f: T) { self.f = f } | |
} | |
extension NSTimer { | |
static func xxx_scheduledTimerWithTimeInterval(ti: NSTimeInterval, block: ()->(), repeats: Bool) -> NSTimer { | |
return self.scheduledTimerWithTimeInterval(ti, target: | |
self, selector: "xxx_blcokInvoke:", userInfo: Block(block), repeats: repeats) | |
} |
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
// | |
// XCTAssertSwiftError.swift | |
// | |
// Created by LCS on 6/17/15. | |
// Released into public domain; use at your own risk. | |
// | |
import XCTest | |
func XCTempAssertThrowsError(message: String = "", file: String = __FILE__, line: UInt = __LINE__, _ block: () throws -> ()) |
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
- (BOOL)Debugger{ | |
static BOOL debuggerIsAttached = NO; | |
static dispatch_once_t debuggerPredicate; | |
dispatch_once(&debuggerPredicate, ^{ | |
struct kinfo_proc info; | |
size_t info_size = sizeof(info); | |
int name[4]; |
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
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSAllowsArbitraryLoads</key> | |
<true/> | |
</dict> |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
var randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5] | |
func partition(inout v: [Int], left: Int, right: Int) -> Int { | |
var i = left | |
for j in (left + 1) ... right { | |
if v[j] < v[left] { |