Skip to content

Instantly share code, notes, and snippets.

View FranDepascuali's full-sized avatar

Depa FranDepascuali

View GitHub Profile
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
protocol Downloader {
func fetch(from url: SecureURLType)
}
protocol SecureURLType {
init?(from url: URL, validator: URL -> Bool)
public final class MyViewController: UIViewController {
@IBOutlet weak var someView: UIView!
@IBOutlet weak var someLabel: UIView!
@IBOutlet weak var someButton: UIView!
@IBOutlet weak var otherView: UIView!
@IBOutlet weak var yetAnotherView: UIView!
protocol UIComponentType {
associatedtype Controller
associatedtype View
associatedtype ViewModel
func createController() -> Controller
input {
syslog {
host => localhost
port => 5000
}
}
filter {
}
# https://labs.kunstmaan.be/blog/ios-continuous-delivery-with-jenkins-and-fastlane?this-one-is-for-you-roderik
# Define the minimal Fastlane version
# fastlane_version "1.41.1"
# Use the iOS platform as default
default_platform :ios
# Define what to do for the iOS platform
platform :ios do
@FranDepascuali
FranDepascuali / CollapseViews.swift
Last active May 17, 2016 20:59
Collapse & uncollapse views
extension UIView {
private var previousHeightConstraint: NSLayoutConstraint? {
return constraints.filterFirst { $0.firstAttribute == .Height }
}
}
/**
Collapse a view by adding/modifying constraint height.
private var AssociatedKey: UInt = 1
private final class AssociatedObjectBox<T> {
let value: T
init(_ x: T) {
value = x
}
}
public final class MyViewController: UIViewController {
// Your implementation
}
extension MyViewController: ViewModelBindable {
public func bindViewModel(viewModel: MyViewModel) {
// binding logic
}
extension ViewModelBindable where Self: AnyObject {
public var viewModel: ViewModel? {
get {
return getAssociatedObject(self, key: &AssociatedKey)
}
set(newViewModel) {
if let viewModel = newViewModel {