Transitions from one image to another of a differing dimensions by unfolding.
protocol AnalyticsBackEnd { | |
static func log(_ name: String) | |
} | |
extension Analytics: AnalyticsBackEnd {} |
extension UIImage.Orientation { | |
/// Get the equivalent `CGImagePropertyOrientation` enum case. | |
var cgOrientation: CGImagePropertyOrientation { | |
switch self { | |
case .up: return .up | |
case .down: return .down | |
case .left: return .left | |
case .right: return .right | |
case .upMirrored: return .upMirrored | |
case .downMirrored: return .downMirrored |
//: # Natural Language Framework | |
//: by Josh Sullivan | |
import Swift | |
import NaturalLanguage | |
//: Create a short string to test. | |
let str = "I am the very model of a modern major general! 😎" | |
//: And a longer one. Yay, multi-line String literals! | |
let longStr = """ |
//: # Setting up Swift 4 KVO | |
import Foundation | |
//: This class has a pair of properties that can be observied by KVO. | |
//: - Note: This class *must* inheret from `NSObject` in order to posess the KVO functionality. | |
class ObservableClass: NSObject { | |
/// An observable string property. Note that it most be annotated with both "@objc" (expose the property to the | |
/// Objective-C runtime) and "dynamic" (enables KVO for the property). | |
@objc dynamic private(set) var stringProperty: String = "Starting string!" |
class MobiusRing { | |
float majorRadius, minorRadius; | |
int segments; | |
PVector[] vertices; | |
MobiusRing(float majorRadius, float minorRadius, int segments) { | |
this.majorRadius = majorRadius; | |
this.minorRadius = minorRadius; | |
this.segments = segments; |
// | |
// CollectionViewDelegateSplitter.swift | |
// | |
// Created by Joshua Sullivan on 12/7/17. | |
// | |
import UIKit | |
class CollectionViewDelegateSplitter: NSObject, UICollectionViewDelegate { | |
/// The object which will receive collection-related delegate actions. |
First things first: Augmented Reality is an inherently 3D activity. The ease with which you pick it up will be directly proportional to your existing experience working in 3D. This is not to say someone without 3D experience can't do AR, but it will be harder for you until you become more familiar with common 3D principles. The skill set used for creating 3D games and AR experiences are essentially the same.
If your'e a complete 3D noob, I suggest checking out some of the RayWenderlich.com tutorials on getting started with 3D game development.
The first decision to make is whether you want to use Xcode or a 3D game framework such as Unity or Unreal to create your experience. For the purposes of this guide, I'll assume you will choose Xcode, simply because I have no personal experience with the other two options. If you're already experienced with one of them or are feeling adventurous, then I'm sure you can find AR learning resources online.
// | |
// CapturedImageSampler.swift | |
// ARKitTest | |
// | |
// Created by Joshua Sullivan on 9/22/17. | |
// Copyright © 2017 Joshua Sullivan. All rights reserved. | |
// | |
import UIKit | |
import ARKit |
import Swift | |
struct Giver { | |
enum Receiver { | |
case ya | |
} | |
private var name: String | |
init(name: String) { |