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
| #if DEBUG | |
| func dLog(message: String, filename: String = #file, function: String = #function, line: Int = #line) { | |
| print("[\((filename as NSString).lastPathComponent):\(line)] \(function) - \(String(describing: message))") | |
| } | |
| func classStart(filename: String = #file, function: String = #function, line: Int = #line) { | |
| print("ClassStart", "[\((filename as NSString).lastPathComponent):\(line)] \(function)") | |
| } | |
| func classEnd(filename: String = #file, function: String = #function, line: Int = #line) { |
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
| To detect use of UIWebView in project. | |
| 1. Open Terminal | |
| 2. CD <Path to your App> | |
| 3. Press return | |
| 4. grep -r UIWebView . | |
| To detect use of UIWebView in binary frameworks. |
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
| self.btn.addTarget(self, action: #selector(tapBtn(sender:)), for: .touchUpInside) | |
| // MARK: - Selectors Actions :: | |
| @IBAction func tapBtn(sender: UIButton) { | |
| } |
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 func emptyTableCell() -> UITableViewCell { | |
| let cellDefault: UITableViewCell = UITableViewCell(style: .default, reuseIdentifier: "Cell") | |
| cellDefault.selectionStyle = .none | |
| cellDefault.textLabel?.text = "" | |
| cellDefault.imageView?.image = nil | |
| return cellDefault | |
| } |
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: UIScrollViewDelegate { | |
| func scrollViewDidScroll(_ scrollView: UIScrollView) { | |
| guard let tableView = scrollView as? UITableView, | |
| let visible = tableView.indexPathsForVisibleRows, | |
| let first = visible.first else { | |
| return | |
| } | |
| let headerHeight = tableView.rectForHeader(inSection: first.section).size.height |
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 func makeLabelClickable() { | |
| self.label.isUserInteractionEnabled = true | |
| let guestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(labelClicked(_:))) | |
| self.label.addGestureRecognizer(guestureRecognizer) | |
| } | |
| @objc func labelClicked(_ sender: Any) { | |
| } |
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 AWSS3 | |
| //pod 'AWSS3' | |
| //https://github.com/maximbilan/Swift-Amazon-S3-Uploading-Tutorial | |
| //https://www.swiftdevcenter.com/upload-image-video-audio-and-any-type-of-files-to-aws-s3-bucket-swift/ | |
| typealias progressBlock = (_ progress: Double) -> Void | |
| typealias completionBlock = (_ response: Any?, _ error: Error?) -> 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
| //Step 2: Install below given Pod | |
| pod 'CCBottomRefreshControl' | |
| //Step 2: Add below given line in bridging header file | |
| #import <CCBottomRefreshControl/UIScrollView+BottomRefreshControl.h> | |
| //Step 3: |
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
| @IBOutlet private weak var tblView: UITableView! | |
| private func registerNibs() { | |
| self.tblView.register(UINib(nibName: "TableHeaderView", bundle: nil), forHeaderFooterViewReuseIdentifier: "TableHeaderView") | |
| self.tblView.register(UINib(nibName: "TableFooterView", bundle: nil), forHeaderFooterViewReuseIdentifier: "TableFooterView") | |
| self.tblView.register(UINib(nibName: "TableViewCell", bundle: nil), forCellReuseIdentifier: "TableViewCell") | |
| } | |
| // MARK: - Extension :: UITableViewDelegate, UITableViewDataSource :: | |
| extension ViewController: UITableViewDelegate, UITableViewDataSource { |
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
| @IBOutlet private weak var collectionView: UICollectionView! | |
| private func registerNibs() { | |
| self.collectionView.register(UINib(nibName: "CollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "CollectionViewCell") | |
| } | |
| // MARK: - Extension :: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout :: | |
| extension MyProfileViewC: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { |
OlderNewer