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
// | |
// DeviceLocation.swift | |
// | |
// Created by dede.exe on 28/10/17. | |
// Copyright © 2017 dede.exe. All rights reserved. | |
// | |
import Foundation | |
import CoreLocation |
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
extension URLRequest { | |
public func curl(pretty:Bool = false) -> String { | |
var data : String = "" | |
let complement = pretty ? "\\\n" : "" | |
let method = "-X \(self.httpMethod ?? "GET") \(complement)" | |
let url = "\"" + self.url?.absoluteString ?? "" + "\"" | |
var header = "" |
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 Darwin | |
enum Signal: Int32 { | |
case HUP = 1 | |
case INT = 2 | |
case QUIT = 3 | |
case ABRT = 6 | |
case KILL = 9 | |
case ALRM = 14 | |
case TERM = 15 |
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
// | |
// UIColor+Literals.swift | |
// Created by dede.exe | |
// | |
import UIKit | |
public extension UIColor { | |
public convenience init(red:Int, green:Int, blue:Int, percentAlpha:Int = 100) | |
{ |
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
// | |
// UITextField+MaskPattern.swift | |
// MaskedTextField | |
// | |
// Created by dede.exe on 10/07/16. | |
// | |
// It's totally base on article : "http://vojtastavik.com/2015/03/29/real-time-formatting-in-uitextfield-swift-basics/" | |
// And I don't mind if the original author allow me to publish it :)... But I'll keep the reference | |
// I modified the original implementation to keep it as an Extension... | |
// |
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 UIKit | |
extension UIView { | |
private struct FloatingKeys { | |
static var FKCompletion : String = "FKCompletion" | |
} | |
private class CompletionWrapper { | |
private var completion : (()->Void)? = nil |
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
// | |
// StringMaskFormatter.swift | |
// StringMaskFormatter | |
// | |
// Created by dede.exe on 10/07/16. | |
// It's totally base on article : "http://vojtastavik.com/2015/03/29/real-time-formatting-in-uitextfield-swift-basics/" | |
// And I don't mind if the original author should allow me(or not) to publish it :)... But I'll keep the reference | |
// | |
import UIKit |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Great tutorial: http://www.raywenderlich.com/22167/beginning-core-image-in-ios-6 | |
// Official docs: https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/CoreImaging/ci_intro/ci_intro.html#//apple_ref/doc/uid/TP30001185-CH1-TPXREF101 | |
// Alt-click on function names for more! | |
// Make any old label, with our frame set to the view so we know it's there. | |
UILabel *label = [[UILabel alloc] initWithFrame:self.view.frame]; |
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
extension Dictionary { | |
func joinKeyValuesFor(keyValueToken : String, groupedByToken:String ) -> String | |
{ | |
var str = "" | |
for (key, value) in self | |
{ | |
if str != "" | |
{ |