Skip to content

Instantly share code, notes, and snippets.

View Morbix's full-sized avatar

Henrique Morbin Morbix

  • iFood
  • Porto, Portugal
  • 07:55 (UTC +01:00)
View GitHub Profile
@Morbix
Morbix / .swiftlint.yml
Created October 19, 2016 22:10
swift lint yml example
disabled_rules:
- trailing_whitespace
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
- R.generated.swift
line_length:
- 170
- 200
@Morbix
Morbix / AppDelegate.swift
Created October 16, 2016 14:19
Defining initial controller without storyboard
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
}
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
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
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
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) {
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