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
protocol Animal { | |
func sound() -> String | |
} | |
class Cat: Animal { | |
func sound() -> String { return "😺Meow" } | |
} | |
class Dog: Animal { | |
func sound() -> String { return "🐶Bow wow" } | |
} |
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
import UIKit | |
class ViewController: UIViewController { | |
private var count = 0 | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
Log.info(message: "viewDidLoad") | |
Log.info(message: "API: GET /some/values") | |
Log.info(message: "User did something.") |
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
import UIKit | |
import Fabric | |
import Crashlytics | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
Fabric.with([Crashlytics.self]) |
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
import Foundation | |
import os.log | |
import Crashlytics | |
final class Log { | |
private init() {} | |
static func debug(message: String) { | |
writeLog(message: message, level: .debug) | |
} |
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
// Demo at iOSCon 2017 in London | |
// https://speakerdeck.com/yoichitgy/dependency-injection-in-practice-ioscon | |
// | |
// How to Use: Paste this program to a Playground. | |
// Tested with: Xcode 8.2.1 | |
// Interface (protocol) | |
protocol Logger { | |
func log(_ message: String) | |
} |
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
// Demo at iOSCon 2017 in London | |
// https://speakerdeck.com/yoichitgy/dependency-injection-in-practice-ioscon | |
// | |
// Tested with: Xcode 8.2.1 | |
// | |
// How to Use: | |
// 1. Clone Swinject: git clone --recursive [email protected]:Swinject/Swinject.git | |
// 2. Checkout 2.0.0 branch: cd Swinject; git checkout 2.0.0 | |
// 3. Build the Swinject project for a simulator target | |
// 4. Open the playground in the project |
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
// Demo at iOSCon 2017 in London | |
// https://speakerdeck.com/yoichitgy/dependency-injection-in-practice-ioscon | |
// | |
// How to Use: Paste this program to a Playground. | |
// Tested with: Xcode 8.2.1 | |
protocol Animal: class { } | |
class Cat: Animal { } | |
class Dog: Animal { } |
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
#!/bin/bash | |
while getopts p option | |
do | |
case $option in | |
p) opt_p=TRUE ;; | |
esac | |
done | |
if [ ! -d "public" ] |
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
#!/bin/sh | |
# | |
# genassetimages.sh | |
# Generates iOS asset PNG images from a PSD file for @1x, @2x and @3x scales. | |
# ImageMagick is used to resize the images. | |
# | |
# settings ========== | |
outputDir="image_assets" | |
assetSuffixes=(".png" "@2x.png" "@3x.png") |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Localize.py - Incremental localization on XCode projects | |
# João Moreno 2009 | |
# http://joaomoreno.com/ | |
# Modified by Steve Streeting 2010 http://www.stevestreeting.com | |
# Changes | |
# - Use .strings files encoded as UTF-8 |
NewerOlder