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
// | |
// Obfuscator.swift | |
// | |
// Created by Dejan Atanasov on 2017-05-31. | |
// | |
import Foundation | |
class Obfuscator: AnyObject { | |
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
// | |
// ViewController.swift | |
// | |
// Created by Dejan Atanasov on 01/04/2017. | |
// Copyright © 2017 Dejan Atanasov. All rights reserved. | |
// | |
import UIKit | |
class ViewController: UIViewController { |
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
// | |
// CameraHandler.swift | |
// theappspace.com | |
// | |
// Created by Dejan Atanasov on 26/06/2017. | |
// Copyright © 2017 Dejan Atanasov. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
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
func requestWith(endUrl: String, imageData: Data?, parameters: [String : Any], onCompletion: ((JSON?) -> Void)? = nil, onError: ((Error?) -> Void)? = nil){ | |
let url = "http://google.com" /* your API url */ | |
let headers: HTTPHeaders = [ | |
/* "Authorization": "your_access_token", in case you need authorization header */ | |
"Content-type": "multipart/form-data" | |
] | |
Alamofire.upload(multipartFormData: { (multipartFormData) in |
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 Foundation | |
import UIKit | |
extension UITextField{ | |
@IBInspectable var doneAccessory: Bool{ | |
get{ | |
return self.doneAccessory | |
} | |
set (hasDone) { |
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
// | |
// IAPHandler.swift | |
// | |
// Created by Dejan Atanasov on 13/07/2017. | |
// Copyright © 2017 Dejan Atanasov. All rights reserved. | |
// | |
import UIKit | |
import StoreKit |
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
fileprivate var longPressGesture: UILongPressGestureRecognizer! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
longPressGesture = UILongPressGestureRecognizer(target: self, action: #selector(self.handleLongGesture(gesture:))) | |
reorderCollectionView.addGestureRecognizer(longPressGesture) | |
} | |
@objc func handleLongGesture(gesture: UILongPressGestureRecognizer) { |
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 | |
struct TestModel{ | |
struct Fetch { | |
struct Request | |
{ | |
var itemId = 0 | |
var keyword: String? | |
var count: String? | |
} |
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 | |
protocol TestRouterInput { | |
func showSomeVC() | |
} | |
class TestRouter: TestRouterInput | |
{ | |
weak var viewController: ViewController! | |
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
typealias responseHandler = (_ response:TestModel.Fetch.Response) ->() | |
class TestWorker{ | |
func fetch(itemId:Int!, keyword:String!, count: String!, success:@escaping(responseHandler), fail:@escaping(responseHandler)) | |
{ | |
// NOTE: Do the work | |
//call network etc. | |
let manager = YourApiManager() | |
OlderNewer