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
| // | |
| // ViewFactory.swift | |
| // FetchingView | |
| // | |
| // Created by NeilsUltimateLab. | |
| // | |
| import UIKit | |
| public class ViewFactory { |
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
| static func postResource<A>(_ resource: WebResource<A>, completion: @escaping (Result<A>)->Void, progressCompletion: ((Double)->Void)?) { | |
| guard let url = resource.urlPath.url else { | |
| return | |
| } | |
| let parameter = resource.method.parameter | |
| let header = resource.header | |
| guard isReachable else { | |
| UIApplication.shared.isNetworkActivityIndicatorVisible = false |
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 | |
| extension String { | |
| var initials: String { | |
| let split = self | |
| .split(separator: " ") | |
| .prefix(2) | |
| .compactMap { $0.first } | |
| .compactMap { String($0).uppercased() } | |
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
| https://drive.google.com/file/d/14fHWSzV9FSZvo8nkFyrjQU2a3V5bKv0u/view |
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 ReusableView: class { | |
| static var reuseIdentifier: String { get } | |
| } | |
| extension ReusableView where Self: UIView { | |
| static var reuseIdentifier: String { | |
| return String(describing: self) | |
| } |
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 | |
| import AVFoundation | |
| import Photos | |
| protocol ImagePickerDiplaying: class { | |
| func pickerAction(sourceType : UIImagePickerControllerSourceType) | |
| func alertForPermissionChange(forFeature feature: String, library: String, action: String) | |
| func cameraAccessPermissionCheck(completion: @escaping (Bool) -> Void) | |
| func photosAccessPermissionCheck(completion: @escaping (Bool)->Void) | |
| } |
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 CoreData | |
| class CoreDataController: NSObject { | |
| private override init() { | |
| super.init() | |
| } | |
| static let shared: CoreDataController = CoreDataController() |
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 CoreLocation | |
| extension Int { | |
| func queryItem(for name: String) -> URLQueryItem { | |
| return URLQueryItem(name: name, value: "\(self)") | |
| } | |
| } | |
| extension 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 Foundation | |
| import MessageUI | |
| class MessageComposer: NSObject, MFMessageComposeViewControllerDelegate { | |
| var reciepient: String? | |
| var message: String? | |
| weak var alertPresenter: UIViewController? | |
| convenience init(reciepient: String?, message: String?, alertPresenter: UIViewController? = nil) { |
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 | |
| struct DataSourceManager<A> { | |
| private var _currentPage: UInt = 1 | |
| private var _initialPageIndex: UInt = 1 | |
| init(intialPageIndex: UInt = 1, dataPerPage: Int = 10) { | |
| self._currentPage = intialPageIndex | |
| self._initialPageIndex = intialPageIndex | |
| self.dataPerPage = dataPerPage |