Skip to content

Instantly share code, notes, and snippets.

View michelgoni's full-sized avatar

Michel Goñi michelgoni

View GitHub Profile
@phynet
phynet / map-reduce-filter-flatMap.swift
Created March 19, 2017 16:54
Examples for flatMap, Map, Reduce, Filter in Swift
//reduce
//Use reduce to combine all items in a collection to create a single new value.
let numbers = [1, 3, 5, 7, 9]
//sum all values from the array (+)
let result = numbers.reduce(0, +)
//sum all values from the array (+) plus one
let result2 = numbers.reduce(1, +)
let result3 = numbers.reduce(1, *)
@victorBaro
victorBaro / CustomDynamicAlertView
Created February 23, 2015 09:52
Small class (Alert View) we made during third week at ironhack bootcamp using UIKit Dynamics. http://victorbaro.com/2015/02/custom-dynamic-alertview/
//
// CustomDynamicAlertView.h
// Week3_inclass
//
// Created by Victor Baro on 18/02/2015.
// Copyright (c) 2015 Produkt. All rights reserved.
//
#import <UIKit/UIKit.h>