Skip to content

Instantly share code, notes, and snippets.

View anthonyvitocuaderno's full-sized avatar

Vito Cuaderno anthonyvitocuaderno

View GitHub Profile
@anthonyvitocuaderno
anthonyvitocuaderno / Logger.swift
Created June 5, 2018 09:06
Pretty print for Swift
public func printV( _ message:Any..., file:String = #file, function:String = #function, line:Int = #line) {
let type = Constants.logs.v
if !type.status {
return
}
if let f = file.split(separator: "/").last {
print("<<<\(type.symbol) \(f) Line - \(line)", "\(function) says:", message, "\(DateUtil.convert(date: DateUtil.convert(toSgDateFormat: Date())))")
} else {
print("<<<\(type.symbol) \(file) \(function)", "Line: \(line)", message, "\(DateUtil.convert(date: DateUtil.convert(toSgDateFormat: Date())))")
@anthonyvitocuaderno
anthonyvitocuaderno / UISearchBar.swift
Created June 5, 2018 09:03
iOS Swift 3.3 UISearchBar extension
//
// UISearchBar.swift
// R2S
//
// Created by Vito Cuaderno on 5/7/18.
// Copyright © 2018 Total Integrated Resources. All rights reserved.
//
import UIKit
@anthonyvitocuaderno
anthonyvitocuaderno / UITableView.swift
Created June 5, 2018 09:02
iOS Swift 3.3 UITableView extension
//
// UITableView.swift
// R2S
//
// Created by Vito Cuaderno on 4/30/18.
// Copyright © 2018 Total Integrated Resources. All rights reserved.
//
import UIKit
extension UITableView {
@anthonyvitocuaderno
anthonyvitocuaderno / UIImage.swift
Created June 5, 2018 09:01
iOS Swift 3.3 UIImage extension
//
// UIImage.swift
// R2S
//
// Created by Vito Cuaderno on 3/22/18.
// Copyright © 2018 Total Integrated Resources. All rights reserved.
//
import UIKit
@anthonyvitocuaderno
anthonyvitocuaderno / UIColor.swift
Created June 5, 2018 09:00
iOS Swift 3.3 UIColor extension
import UIKit
extension UIColor {
convenience init(hex: String) {
self.init(hex: hex, alpha:1)
}
convenience init(hex: String, alpha: CGFloat) {
let hexWithoutSymbol = hex
let scanner = Scanner(string: hexWithoutSymbol)
@anthonyvitocuaderno
anthonyvitocuaderno / Promise.swift
Created June 5, 2018 08:57
Promise Prototype for iOS Swift 3.3
//
// Promise.swift
// R2S
//
// Created by Vito Cuaderno on 5/9/18.
// Copyright © 2018 Total Integrated Resources. All rights reserved.
//
import Foundation
@anthonyvitocuaderno
anthonyvitocuaderno / EventBus.swift
Last active June 26, 2018 09:14
Prototype lightweight event bus for iOS swift 3.3
//
// EventBus.swift
// R2S
//
// Created by Vito Cuaderno on 6/1/18.
// Copyright © 2018 Total Integrated Resources. All rights reserved.
//
import Foundation
final class EventBus {