Skip to content

Instantly share code, notes, and snippets.

Davide De Franceschi DeFrenZ

  • ASOS.com
  • London
Block or report user

Report or block DeFrenZ

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View DZKeyboardLayoutProxyView
//
// DZKeyboardLayoutProxyView.swift
//
// Created by Davide De Franceschi on 25/02/2015.
//
import UIKit
final class DZKeyboardLayoutProxyView: UIView {
private var keyboardObserver: NSObjectProtocol?
View groupBy
//MARK: - ??=
infix operator ??= {
associativity right
precedence 90
assignment
}
func ??= <Wrapped> (inout optional: Wrapped?, @autoclosure defaultValue: () throws -> Wrapped?) rethrows {
optional = try optional ?? defaultValue()
}
View Dynamic Dispatch?
protocol Foo: Hashable {
var id: Int { get }
}
extension Foo {
var hashValue: Int { return id }
}
extension Int: Foo {
var id: Int { return self }
}
@DeFrenZ
DeFrenZ / DZPositionedImageButton.swift
Created Jul 9, 2015
UIButton subclass for having the image at different positions
View DZPositionedImageButton.swift
//
// DZPositionedImageButton.swift
// Boppl
//
// Created by Davide De Franceschi on 18/05/2015.
// Copyright (c) 2015 Boppl. All rights reserved.
//
import UIKit
View Dependencies.swift
// Copyright (c) 2014 Rob Rix. All rights reserved.
// MARK: BoxType
/// The type conformed to by all boxes.
public protocol BoxType {
/// The type of the wrapped value.
typealias Value
/// Initializes an intance of the type with a value.
@DeFrenZ
DeFrenZ / EnumerablePlayground
Created Feb 18, 2015
Trying for coalescence in Swift
View EnumerablePlayground
// Playground - noun: a place where people can play
import Swift
struct Yield2Generator<S: SequenceType, C: CollectionType>: GeneratorType {
var sequenceGenerator: S.Generator
var sequenceElement: S.Generator.Element?
let collection: C
var collectionGenerator: C.Generator
init(_ sequenceGenerator : S.Generator, _ collection : C) {
View JSON.swift
//
// JSON.swift
// Boppl
//
// Created by Davide De Franceschi on 26/06/2015.
// Copyright (c) 2015 Boppl. All rights reserved.
//
import Foundation
@DeFrenZ
DeFrenZ / FSLVExample.swift
Created Nov 17, 2014
FiniteStateLayoutView
View FSLVExample.swift
//
// FSLVExample.swift
// FSLVExample
//
// Created by Davide De Franceschi on 16/11/14.
// Copyright (c) 2014 Davide De Franceschi. All rights reserved.
//
import UIKit
You can’t perform that action at this time.