This file contains 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
print("ERROR: \(error.localizedDescription)") |
This file contains 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
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/[application name].app/Contents/Info.plist |
This file contains 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
/usr/libexec/PlistBuddy -c 'Delete :LSUIElement' /Applications/[AppName].app/Contents/Info.plist |
This file contains 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.navigationItem.title = "TITLE" | |
self.navigationItem.prompt = "Prompt" |
This file contains 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 { | |
// Converts String to Integer | |
public func toInteger() -> Int? { | |
if let num = NumberFormatter().number(from: self) { | |
return num.intValue | |
} else { | |
return nil | |
} |
This file contains 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 | |
// USE: | |
var dateString = "14.05.2020T10:30:10" | |
let dateFormat = DateFormatter(format: "dd.MM.yyyy'T'HH:mm:ss") | |
let dateFormat1 = DateFormatter(format: "MM/dd/yyyy '@' HH:mm") | |
let date = Date() | |
print("date String -> toDate: \(dateString.toDate(dateFormatter: dateFormat)!)") | |
print("date String -> toDateString: \(dateString.toDateString(dateFormatter: dateFormat, outputFormat: "MM/dd/yy")!)") |
This file contains 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
// ************************************ | |
// ADD TO VIEW DID LOAD | |
// ------------------------------------ | |
let tap: UITapGestureRecognizer = UITapGestureRecognizer( | |
target: self, | |
action: #selector(UIInputViewController.dismissKeyboard)) | |
//Uncomment to prevent interference of cancel button | |
//tap.cancelsTouchesInView = false |
This file contains 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
func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { | |
let action = UIContextualAction(style: .normal, title: "", handler: { (ac:UIContextualAction, view:UIView, success:(Bool) -> Void) in | |
// *** add object To be deleted *** | |
// object.delete | |
success(true) | |
}) | |
action.image = UIImage(systemName: "trash.fill") | |
action.backgroundColor = .green | |
return UISwipeActionsConfiguration(actions: [action]) | |
} |
This file contains 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
// ------------------------------------------- | |
// Settings: Select the table view controller | |
// open the attributes inspector, and enable | |
// refreshing | |
// Add title color and center | |
// **************************** | |
// ADD TO VIEW DID LOAD |
This file contains 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
let alertTitle = "Test" | |
let alertMessage = "Test Message" | |
let alert = UIAlertController(title: alertTitle, message: alertMessage, preferredStyle: .actionSheet) | |
alert.addAction(UIAlertAction(title: "Yes", style: .default, handler: { action in | |
// Add Actions to this closure | |
print("Test Response") | |
})) | |
alert.addAction(UIAlertAction(title: "No", style: .cancel, handler: nil)) | |
self.present(alert, animated: true) |
OlderNewer