This file contains hidden or 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 UIKit | |
// MARK: - Friends | |
class Person:Equatable{ | |
static func == (lhs: Person, rhs: Person) -> Bool { | |
return lhs.name == rhs.name | |
} | |
This file contains hidden or 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
/// Gets the Last Modified and Created Date of the file at path. | |
func fileDateAttributes(at path:String) -> (created:Date?, modified:Date?) { | |
do { | |
let attributes:[FileAttributeKey:Any] = try FileManager.default.attributesOfItem(atPath: path) | |
let modificationDate = attributes[FileAttributeKey.modificationDate] as? Date | |
let creationDate = attributes[FileAttributeKey.creationDate] as? Date | |
return (creationDate, modificationDate) | |
}catch{ | |
print("Error getting attributes of file: \(path). Check if file exists and that the system can access its attributes.") |
This file contains hidden or 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
/** | |
A CIFilter that uses a Metal function that converts a black pixel (or almost black) to a transparent pixel. | |
*/ | |
class BLKTransparent: CIFilter { | |
private var kernel: CIColorKernel | |
var inputImage: CIImage? | |
var threshold: Float? | |
This file contains hidden or 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
extension NSImage { | |
/// Returns the height of the current image. | |
var height: CGFloat { | |
return self.size.height | |
} | |
/// Returns the width of the current image. | |
var width: CGFloat { | |
return self.size.width |
This file contains hidden or 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
// Pathfinder | |
// Created by Carlos Farini on 8/21/21. | |
/** | |
This is a tutorial that tries to approach the following question: | |
How to make a `SCNNode` follow a 3D Path (with orientation) created with Blender NURBS curve. | |
A: Simple. Move and Point to the next object. | |