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
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
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
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
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
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
#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) { |
NewerOlder