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
| <key>NSAppTransportSecurity</key> | |
| <dict> | |
| <!--Include to allow all connections (DANGER)--> | |
| <key>NSAllowsArbitraryLoads</key> | |
| <true/> | |
| </dict> |
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 | |
| public extension String { | |
| public func trim() -> String { | |
| return self.trimmingCharacters(in: CharacterSet.whitespaces) | |
| } | |
| func isURL() -> Bool { | |
| //swiftlint:disable:next custom_rules | |
| return self.lowercased().hasPrefix("http://") || self.lowercased().hasPrefix("https://") |
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 | |
| public class GCD { | |
| public class func mainThread(block:@escaping () -> Void) { | |
| DispatchQueue.main.async {block()} | |
| } | |
| public class func mainThreadDelayed(delay: TimeInterval, block:@escaping () -> Void) { | |
| DispatchQueue.main.asyncAfter(deadline: .now() + delay) {block()} |
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
| class TemplateDebugClass: CustomDebugStringConvertible { | |
| public var title: String = "" | |
| public init(data: [String:AnyObject]) { | |
| self.title = (data["title"] as? String ?? "").trim() | |
| } | |
| public var debugDescription: String { | |
| return "<title=\(self.title);>" | |
| } |
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 | |
| enum Crud:String { | |
| case get = "GET" | |
| case post = "POST" | |
| case put = "PUT" | |
| case delete = "DELETE" | |
| } | |
| open class APIResponse: CustomDebugStringConvertible { |
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 | |
| @IBDesignable | |
| class InspectableUIView: UIView { | |
| @IBInspectable var cornerRadius: CGFloat = 0 { | |
| didSet { | |
| // layer.cornerRadius = CGRectGetHeight(self.bounds) / 2.0//Circle | |
| layer.cornerRadius = cornerRadius | |
| // layer.masksToBounds = cornerRadius > 0 |
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 | |
| fileprivate var IMAGE_CACHE = NSCache<NSString, UIImage>() | |
| class ImageViewSpinner:UIImageView { | |
| private var loadingIndicator = UIActivityIndicatorView() | |
| var url:String = "" { | |
| didSet { |
NewerOlder