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 | |
modulesDirectory=$DERIVED_FILES_DIR/modules | |
modulesMap=$modulesDirectory/module.modulemap | |
modulesMapTemp=$modulesDirectory/module.modulemap.tmp | |
mkdir -p "$modulesDirectory" | |
cat > "$modulesMapTemp" << MAP | |
module sqlite3 [system] { |
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
public func optionalMax <T: Comparable>(elements: T? ...) -> T? { | |
var maximumElement: T? | |
for element in elements { | |
if let element = element { | |
if let existingMaximumElement = maximumElement { | |
if element > existingMaximumElement { | |
maximumElement = element | |
} | |
} |
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
{ | |
"name": "Fabric", | |
"version": "1.3.0", | |
"summary": "Fabric by Twitter, Inc.", | |
"homepage": "https://fabric.io", | |
"authors": "Twitter", | |
"license": { | |
"type": "Commercial", | |
"text": "Fabric: Copyright 2015 Twitter, Inc. All Rights Reserved. Use of this software is subject to the terms and conditions of the Fabric Software and Services Agreement located at https://fabric.io/terms. OSS: http://get.fabric.io/terms/opensource.txt" | |
}, |
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
func makeEscaping<Parameters,Result>(_ closure: (Parameters) -> Result) -> (Parameters) -> Result { | |
func cast<From,To>(_ instance: From) -> To { | |
return (instance as Any) as! To | |
} | |
return cast(closure) | |
} | |
// Example |
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
(lldb) po 0x12fbada50 | |
<UIPageControl: 0x12fbada50; frame = (134.5 46.5; 7 37); autoresize = W; userInteractionEnabled = NO; layer = <WLayer: 0x12fbabe80>> | |
(lldb) p (NSInteger)[0x12fbada50 numberOfPages] | |
(NSInteger) $2 = 1 | |
(lldb) p (NSInteger)[0x12fbada50 currentPage] | |
(NSInteger) $3 = 0 | |
(lldb) p (void)[0x12fbada50 setCurrentPage:1] |
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
VIEW CONTROLLER LIFECYCLE BROKEN! | |
MFMailComposeInternalViewController (indirectly) called super.viewDidAppear() multiple times. | |
Possible causes: | |
- MFMailComposeInternalViewController or one of its superclasses called super.viewDidAppear() multiple times | |
- it was called manually (it should never be called manually) | |
- the controller containment implementation of MFMailComposeViewController or one if its parents is broken |
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
(lldb) po 0x7c953600 // UISplitViewController | |
<UISplitViewController: 0x7c953600> | |
(lldb) po [0x7c953600 childViewControllers] // UISplitViewController's children | |
NSArray( | |
<UIViewController: 0x7be5a6e0>, | |
<UIViewController: 0x7be9b130> | |
) | |
(lldb) po [0x7be5a6e0 parentViewController] // master child's parent |
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
struct Path: CustomStringConvertible { | |
private var hasParent = HasParent.No | |
var key: String | |
init(forKey key: String, inParent parent: Path? = nil) { | |
self.key = key | |
self.parent = parent |
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
workspace 'OurApp' | |
xcodeproj 'App' | |
platform :ios, '8.2' | |
use_frameworks! | |
link_with 'App Store', 'Beta', 'Development', 'Testing' | |
# a lot of pods here | |
pre_install do |installer| | |
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3957 |
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
protocol _TypeerasedOptional { | |
var typeerasedSelf: Any? { get } | |
} | |
extension Optional: _TypeerasedOptional { | |
var typeerasedSelf: Any? { | |
guard let value = self else { |
OlderNewer