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 | |
indirect enum Tree<T> { | |
case empty | |
case node(_ value: T, _ left: Tree<T>, _ right: Tree<T>) | |
} | |
extension Tree: CustomStringConvertible where T: CustomStringConvertible { | |
var description: String { | |
switch 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
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
var monitor1 = Monitor.sharedMonitor() | |
_sharedMonitor = Monitor() | |
var monitor2 = Monitor.sharedMonitor() | |
if monitor1 === monitor2 { | |
println("Singleton are working") |
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
// | |
// ALEViewController.m | |
// FLKAutoLayoutExample | |
// | |
// Created by Rafa on 2014/05/21. | |
// | |
#import "ALEViewController.h" | |
#import "UIView+FLKAutoLayout.h" |
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
__block NSUInteger outerIndex = -1; | |
[lista enumerateObjectsUsingBlock:^(NSString *word, NSUInteger idx, BOOL *stop) { | |
__block NSUInteger innerIndex = -1; | |
[datos enumerateObjectsUsingBlock:^(NSString *palabra, NSUInteger indice, BOOL *parada) { | |
if ([word isEqualToString:palabra]) { | |
NSLog(@"log1: coinciden el %d", indice); //(log1) si pongo este log deja de aparecer el log3 | |
innerIndex = idx; |
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
// | |
// main.m | |
// enumeration | |
// | |
// Created by Rafa Barberá on 26/04/13. | |
// Copyright (c) 2013 Rafa Barbera. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <Cocoa/Cocoa.h> |