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
// | |
// FlowersTableViewController.swift | |
// Flowers++ | |
// | |
// Created by Mohammad Azam on 6/6/14. | |
// Copyright (c) 2014 AzamSharp Consulting LLC. All rights reserved. | |
// www.azamsharp.com | |
// www.youtube.com/azamsharp |
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 LoginViewModel : ViewModel { | |
var userName :String | |
var password :String | |
} | |
class UIEngine<ViewModel> { | |
var viewModel :ViewModel | |
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
[ | |
{ | |
"id":1, | |
"imageURL":"http:\/\/vignette4.wikia.nocookie.net\/pokemon\/images\/5\/5f\/025Pikachu_OS_anime_11.png", | |
"latitude":29.817841, | |
"longitude":-95.387421, | |
"name":"Pikachu" | |
}, | |
{ | |
"id":2, |
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
/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/java "-javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=60983:/Applications/IntelliJ IDEA CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/sunec.jar |
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
I am using ARKit to find horizontal plane and then cover the plane with a grid image using SCNPlane geometry. If I use the following code to update my plane extend then it works fine. | |
func update(anchor :ARPlaneAnchor) { | |
self.planeGeometry.width = CGFloat(anchor.extent.x * Float(scaleX)); // scaleX is 10 | |
self.planeGeometry.height = CGFloat(anchor.extent.z); | |
self.position = SCNVector3Make(anchor.center.x, 0, anchor.center.z); | |
let planeNode = self.childNodes.first! |
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 datetime | |
poolTables = [] | |
class PoolTable: | |
def __init__(self): | |
self.number = 0 | |
self.startDate = 0 |
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
ViewController.swift: | |
for item in response.mapItems { | |
let placeLocation = (item.placemark.location)! | |
let placeAnnotationNode = PlaceAnnotation(location: placeLocation) | |
placeAnnotationNode.scale = SCNVector3(0.1, 0.1, 0.1) | |
DispatchQueue.main.async { | |
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 loadArticles(callback :([Article] -> ())) { | |
URLSession.shared.dataTask(with: url) { data, response, error in | |
if let data = data { | |
let json = try! JSONSerialization.jsonObject(with: data, options: []) | |
let dictionary = json as! JSONDictionary | |
let articleDictionaries = dictionary["articles"] as! [JSONDictionary] |
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 loadArticles(callback :([Article] -> ())) { | |
URLSession.shared.dataTask(with: url) { data, response, error in | |
if let data = data { | |
let json = try! JSONSerialization.jsonObject(with: data, options: []) | |
let dictionary = json as! JSONDictionary | |
let articleDictionaries = dictionary["articles"] as! [JSONDictionary] |
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 ArticleListViewModel { | |
var title :String? = "Articles" | |
var articles :[ArticleViewModel] = [ArticleViewModel]() | |
} | |
extension ArticleListViewModel { | |
init(articles :[ArticleViewModel]) { | |
self.articles = articles |
OlderNewer