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)calculateBestAttacker | |
{ | |
for (Pokemon *p in self.arrayPokemon) | |
{ | |
if (p.id == self.pokemon1.id) continue; | |
p.killChance = [self calculateChances:p]; | |
if (self.bestAttacker == nil) self.bestAttacker = p; | |
else if (self.bestAttacker.killChance < p.killChance) self.bestAttacker = p; | |
} |
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
// View did load | |
NSData *data = [[NSUserDefaults standardUserDefaults] dataForKey:@"array"]; | |
arrayOfFaceObjects = [NSMutableArray arrayWithArray:[NSKeyedUnarchiver unarchiveObjectWithData:data]]; | |
if (!arrayOfFaceObjects.count) | |
{ | |
arrayOfImages = [NSMutableArray arrayWithObjects:@"1.png", @"2.jpg", @"3.jpg", @"4.jpg", @"5.jpg", @"6.jpg", @"8.jpg", @"9.jpg", @"10.jpg", @"11.jpg", @"12.jpg", @"13.jpg", @"14.jpg", @"15.jpg", nil]; | |
//Converts arrayOfImages to arrayOfFaceObjects |
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 | |
let a : Double = 1.0 / 81.0 | |
var b : Double = 0.0 | |
for var i = 0; i < 729; i++ | |
{ | |
b = a + b |
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
First, update your Parse Framework https://parse.com/docs/downloads | |
### Replace the original Appid/ClientKey with.... | |
Parse.initializeWithConfiguration(ParseClientConfiguration(block: { (configuration: ParseMutableClientConfiguration) -> Void in | |
configuration.applicationId = "myAppId"; | |
configuration.clientKey = "myClientKey"; | |
//need ngrok to host locally, haven't tried it. | |
// configuration.server = @"http://localhost:1337/parse"; |
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
/* | |
Make sure your using a GIF extension for UIImage... Most UIIMageViews will play it automatically w/ extensions. | |
I used this one ... https://github.com/mayoff/uiimage-from-animated-gif | |
This one is more effecient but more code too... https://github.com/Flipboard/FLAnimatedImage | |
*/ |
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
// | |
// TextDetectViewController.swift | |
// iOS9Sampler | |
// | |
// Created by Shuichi Tsutsumi on 2015/06/19. | |
// Copyright © 2015 Shuichi Tsutsumi. All rights reserved. | |
// | |
import UIKit |