Skip to content

Instantly share code, notes, and snippets.

// Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
class Foo: NSObject {
public var changingProperty: Int = 0
public func change() {
//
// AGSQueryTask.swift
// swift-samples
//
// Created by Eric Ito on 7/28/14.
// Copyright (c) 2014 Esri. All rights reserved.
//
import ArcGIS
//
// AGSQueryTask.swift
// swift-samples
//
// Created by Eric Ito on 7/28/14.
// Copyright (c) 2014 Esri. All rights reserved.
//
import ArcGIS
//
// AGSQueryTask.swift
// swift-samples
//
// Created by Eric Ito on 7/28/14.
// Copyright (c) 2014 Esri. All rights reserved.
//
import ArcGIS
//
// AGSQueryTask.swift
// swift-samples
//
// Created by Eric Ito on 7/28/14.
// Copyright (c) 2014 Esri. All rights reserved.
//
import ArcGIS
@eito
eito / modulify.sh
Created September 5, 2014 20:53
Allow the ArcGIS Runtime SDK for iOS v10.2.3 to be used within swift
#!/bin/bash
FRAMEWORK_MODULE_DIRECTORY="~/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/Modules"
mkdir -p ${FRAMEWORK_MODULE_DIRECTORY}
echo "framework module ArcGIS {
umbrella header \"ArcGIS.h\"
export *
module * { export * }
@eito
eito / fp.swift
Created October 7, 2014 06:28
functional programming
// Functional Programming exercises.
//
// Rules:
// 1. No loops (for, while, do/while)!
// 2. No if, else, or switch statements.
// 3. No "var" variables - only "let".
//
// Functions to use:
// map, reduce, filter
//
@eito
eito / main.swift
Created February 25, 2015 03:56
swift conditional compile
#if DEBUG
println("Debug mode")
#else
println("Release Mode")
#endif
#if false
println("This code will never run")
#endif
//
// ViewController.swift
// TweetPing_iOS
import UIKit
class TweetPingLayer: CAShapeLayer {
var pingColor: UIColor! {
@eito
eito / auth.swift
Created February 20, 2019 23:47
iOS Authentication Session for iOS 11/12
import Foundation
import SafariServices
import AuthenticationServices
private protocol AuthenticationSessionProvider {
func start() -> Bool
func cancel()
}
extension SFAuthenticationSession: AuthenticationSessionProvider {}