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
| // | |
| // 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 drawRectange(){ | |
| /* create the path */ | |
| let path = GMSMutablePath() | |
| path.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.0)) | |
| path.add(CLLocationCoordinate2D(latitude: 37.45, longitude: -122.0)) | |
| path.add(CLLocationCoordinate2D(latitude: 37.45, longitude: -122.2)) | |
| path.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.2)) | |
| path.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.0)) | |
| /* show what you have drawn */ |
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
| // | |
| // 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
| func polygon(){ | |
| // Create a rectangular path | |
| let rect = GMSMutablePath() | |
| rect.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.0)) | |
| rect.add(CLLocationCoordinate2D(latitude: 37.45, longitude: -122.0)) | |
| rect.add(CLLocationCoordinate2D(latitude: 37.45, longitude: -122.2)) | |
| rect.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.2)) | |
| // Create the polygon, and assign it to the map. | |
| let polygon = GMSPolygon(path: rect) |
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 ViewController: GMSMapViewDelegate{ | |
| /* handles Info Window tap */ | |
| func mapView(_ mapView: GMSMapView, didTapInfoWindowOf marker: GMSMarker) { | |
| print("didTapInfoWindowOf") | |
| } | |
| /* handles Info Window long press */ | |
| func mapView(_ mapView: GMSMapView, didLongPressInfoWindowOf marker: GMSMarker) { | |
| print("didLongPressInfoWindowOf") | |
| } |
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
| override func restoreUserActivityState(_ activity: NSUserActivity) { | |
| if activity.activityType == CSSearchableItemActionType, let info = activity.userInfo, let selectedIdentifier = info[CSSearchableItemActivityIdentifier] as? String { | |
| print("Selected Identifier: \(selectedIdentifier)") | |
| } | |
| } |
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 application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { | |
| let vc = (window?.rootViewController as! UINavigationController).viewControllers[0] | |
| vc.restoreUserActivityState(userActivity) | |
| return true | |
| } |
NewerOlder