Skip to content

Instantly share code, notes, and snippets.

View cesteban's full-sized avatar

César Estébanez Tascón cesteban

View GitHub Profile
@cesteban
cesteban / LSPViolation.m
Last active August 29, 2015 14:21
Crash due to LSP violation
@interface Shape : NSObject
@end
@interface Circle : Shape
@end
@interface Triangle : Shape
- (BOOL)isEquilateral;
@end
// clang -o test-proto -Wall -framework Foundation -fmodules -fobjc-arc test-proto.m && test
@import Foundation;
@protocol A <NSObject>
@property (nonatomic, copy, readonly) NSString *a;
@end
@protocol B <A>
@property (nonatomic, copy, readonly) NSString *b;
@cesteban
cesteban / ASLayoutElement+FluentExtensions.swift
Last active April 5, 2017 23:23
Ideas for ASDKFluentExtensions in Swift
extension ASLayoutElement {
public func withOverlay(_ overlay: ASLayoutElement) -> ASOverlayLayoutSpec {
return ASOverlayLayoutSpec(child: self, overlay: overlay)
}
public func withBackgorund(_ background: ASLayoutElement) -> ASBackgroundLayoutSpec {
return ASBackgroundLayoutSpec(child: self, background: background)
}
public func withRatio(_ ratio: CGFloat) -> ASRatioLayoutSpec {