Skip to content

Instantly share code, notes, and snippets.

View FranDepascuali's full-sized avatar

Depa FranDepascuali

View GitHub Profile
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
public protocol PaginationServiceType {
associatedtype Element
init(elementProvider: (page: Int, numberOfElements: Int) -> SignalProducer<[Element], NoError>)
func fetchNextPage(numberOfElements: Int) -> SignalProducer<[Element], NoError>
}
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.
@FranDepascuali
FranDepascuali / AssociatedObjects.swift
Last active April 7, 2022 18:37
Full implementation
private var AssociatedKey: UInt = 0
private final class AssociatedObjectBox<T> {
let value: T
init(_ x: T) {
value = x
}
}
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 {