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 hash tailor 2>/dev/null; then | |
tailor --except=trailing-whitespace,todo-syntax "${PROJECT_NAME}" | |
else | |
echo "warning: Please install Tailor from https://tailor.sh" | |
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
import XCTest | |
extension XCTestCase { | |
func waitForKeyboard() { | |
expectationForPredicate(Predicate.countEqual1, evaluatedWithObject: XCUIApplication().keyboards, handler: nil) | |
waitForExpectationsWithTimeout(10, handler: nil) | |
} | |
func waitForElementExist(element: XCUIElement, timeout: NSTimeInterval = 10) { |
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
let attributedString = NSMutableAttributedString(string: "") | |
let attrs = [ | |
NSFontAttributeName: UIFont(name: font, size: size)!, | |
NSForegroundColorAttributeName: UIColor.whiteColor()] | |
let attributedText = NSMutableAttributedString(string: label, attributes: attrs) | |
attributedString.appendAttributedString(attributedText) | |
textField.attributedPlaceholder = attributedString |
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 [ $CONFIGURATION == Release ]; then | |
echo "Bumping build number..." | |
plist=${PROJECT_DIR}/${INFOPLIST_FILE} | |
# increment the build number (ie 115 to 116) | |
buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}") | |
if [[ "${buildnum}" == "" ]]; then | |
echo "No build number in $plist" | |
exit 2 | |
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
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
target.build_configurations.each do |config| | |
config.build_settings['ENABLE_BITCODE'] = 'NO' | |
end | |
end | |
end |
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
var window: UIWindow? | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
window = UIWindow(frame: UIScreen.mainScreen().bounds) | |
window?.rootViewController = UINavigationController(rootViewController: PetsViewController()) | |
window?.makeKeyAndVisible() | |
return true | |
} |
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
disabled_rules: | |
- trailing_whitespace | |
excluded: # paths to ignore during linting. Takes precedence over `included`. | |
- Carthage | |
- Pods | |
- R.generated.swift | |
line_length: | |
- 170 | |
- 200 |
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
Xcode > Project > Target > Build Phases > Compile Sources > Compiler Flags: -w | |
Source: http://stackoverflow.com/questions/6921884/in-xcode-how-to-suppress-all-warnings-in-specific-source-files |
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
1. Add #import "MyFirstProjectOnSwift-Swift.h" in "MyObjectiveCLass.m" | |
2. Add @class mySwiftClass in MyObjectiveCLass.h; | |
3. Then in MyObjectiveCLass.m | |
mySwiftClass *myClass = [mySwiftClass new]; {Call Like This in any method wherever you want to call swift method.} | |
4. [myClass methodName]; | |
Source: http://stackoverflow.com/questions/24078043/call-swift-function-from-objective-c-class |
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 recursiveDescription(view: UIView, count: Int) { | |
let subviews = view.subviews | |
if subviews.count == 0 { | |
return | |
} | |
var tabs = "" | |
for i in 0..<count { | |
tabs = tabs+"...." |
OlderNewer