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
    
  
  
    
  | protocol BaseImagePickerVCDelegate: class { | |
| func mySelectedImage(image: UIImage) | |
| } | |
| class BaseImagePickerVC: UIVIewController { | |
| var imagePickerDelegate: BaseImagePickerVCDelegate? | |
| struct alertPicker { | 
  
    
      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
    
  
  
    
  | //MARK:- implement socket | |
| extension ChatVC { | |
| func notificationSeenLlist() { | |
| guard let id = notificationId else { | |
| return | |
| } | |
| var seenList = [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 | |
| import SocketIO | |
| import AVKit | |
| class SocketIOManager: NSObject { | |
| static let sharedInstance = SocketIOManager() | |
| var socket : SocketIOClient! | |
| var manager : SocketManager! | 
  
    
      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 YourController: UICollectionViewDelegate, UICollectionViewDataSource{ | |
| func setSlider(){ | |
| let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout() | |
| layout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) | |
| layout.itemSize = CGSize(width:self.slidercollection.frame.width, height: self.slidercollection.frame.height) | |
| layout.minimumInteritemSpacing = 0 | |
| layout.minimumLineSpacing = 0 | |
| layout.scrollDirection = .horizontal | 
  
    
      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 | |
| public extension UITableView { | |
| public func beginRefreshing() { | |
| // Make sure that a refresh control to be shown was actually set on the view | |
| // controller and the it is not already animating. Otherwise there's nothing | |
| // to refresh. | |
| guard let refreshControl = refreshControl, !refreshControl.isRefreshing else { | |
| return | 
  
    
      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 | |
| extension UIView { | |
| func anchor(top: NSLayoutYAxisAnchor?, left: NSLayoutXAxisAnchor?, bottom: NSLayoutYAxisAnchor?, right: NSLayoutXAxisAnchor?, paddingTop: CGFloat, paddingLeft: CGFloat, paddingBottom: CGFloat, paddingRight: CGFloat, width: CGFloat, height: CGFloat) { | |
| translatesAutoresizingMaskIntoConstraints = false | |
| if let top = top { | |
| self.topAnchor.constraint(equalTo: top, constant: paddingTop).isActive = true | 
  
    
      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
    
  
  
    
  | // Snippet | |
| typealias AlertActionHandler = ((UIAlertAction) -> Void) | |
| extension UIAlertControllerStyle { | |
| func controller(title: String, message: String, actions: [UIAlertAction]) -> UIAlertController { | |
| let _controller = UIAlertController( | |
| title: title, | |
| message: message, | |
| preferredStyle: 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
    
  
  
    
  | private var maxLengths = [UITextField: Int]() | |
| extension UITextField { | |
| @IBInspectable var placeHolderColor: UIColor?{ | |
| get { | |
| return self.placeHolderColor | |
| } | |
| set { | 
  
    
      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 UITableView { | |
| func dequeueCell<T: UITableViewCell>(withIdentifier identifier: String, for indexPath: IndexPath) -> T { | |
| return dequeueReusableCell(withIdentifier: identifier, for: indexPath) as! T | |
| } | |
| } | |
| // usage exampe | |
| let cell: CustomCell = table.dequeueCell( | |
| withIdentifier: identifier, | |
| for: indexPath | 
  
    
      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 CategoryVC: BaseVC { | |
| @IBOutlet weak var tbl_cats : UITableView! | |
| var catList : [Category] = [] | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| setupView() |