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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Linq; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace DemoMVVM.Models | |
{ |
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
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { | |
NSLog(@"My token is: %@", deviceToken); | |
// Push Device Token to Server | |
} |
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
- (void)scrollViewDidScroll:(UIScrollView *)scrollView | |
{ | |
if(scrollView.contentOffset.y | |
>= | |
(scrollView.contentSize.height - scrollView.frame.size.height)){ | |
NSLog(@"BOTTOM REACHED"); | |
} | |
if(scrollView.contentOffset.y <= 0.0){ | |
NSLog(@"TOP REACHED"); | |
} |
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
// | |
// ManagedDocumentHandler.swift | |
// DominicanFuel | |
// | |
// Created by Julian Tejera on 3/31/15. | |
// Copyright (c) 2015 Julian Tejera. All rights reserved. | |
// | |
import UIKit |
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
let context = CoreDataManager.sharedInstance.managedObjectContext | |
let product = Product(context: context) | |
// modificas el producto como deseas | |
func viewWillDisappear(animated: Bool) { | |
super.viewWillDisappear(animated) | |
CoreDataManager.sharedInstance.managedObjectContext.rollback() | |
} |
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
func sieveOfErastosthene(max: Int) -> [Bool] { | |
// we assume every number is prime | |
var flags = Array(count: max + 1, repeatedValue: true) | |
flags[0] = false | |
flags[1] = false | |
let squareRoot = Int(sqrt(Double(max))) | |
for i in 2...squareRoot { | |
if flags[i] { |
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
// | |
// RepositoryParserLiaison.swift | |
// Fire | |
// | |
// Created by Julian Tejera on 6/13/15. | |
// Copyright (c) 2015 Julian Tejera. All rights reserved. | |
// | |
import Foundation |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
import Foundation | |
import PlaygroundSupport | |
extension UIColor { | |
class var indigo: UIColor { | |
return UIColor(colorLiteralRed: 75.0/255.0, green: 0, blue: 130.0/255.0, alpha: 1) |
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
struct Human: Decodable { | |
let age: Int | |
let name: String | |
} | |
struct Alien: Decodable { | |
let humans: [Human] | |
} |
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
{ | |
"humans": [ | |
{ | |
"age": 28, | |
"name": "Julian" | |
}, | |
{ | |
"age": 32, | |
"name": "Waldo" | |
}, |
OlderNewer