Using Terminal:
> cd project_root
virtualenv env
source env/bin/activate
| import FacebookCore |
| let shortest_date = "M.d.yy" // 1.15.17 | |
| let short_date = "M.d.yyyy" // 1.15.2017 | |
| let full_date = "MMMM d, yyyy" // January 15, 2017 |
| extension String: LocalizedError { | |
| public var errorDescription: String? { return self } | |
| } |
| let clipboard = UIPasteboard.general | |
| clipboard.string = <#T##string#> |
| // Do this next part in the background | |
| DispatchQueue.global(qos: .userInitiated).async { | |
| // Do your time-costly work here | |
| // Return to the main thread to update the UI | |
| DispatchQueue.main.async { | |
| // Perform UI updates here | |
| } |
| var keyboardHeight : CGFloat = 0 | |
| func textFieldDidBeginEditing(_ textField: UITextField) { | |
| let y = textField.frame.origin.y | |
| let h = self.scrollView.frame.size.height | |
| let margin = h - (keyboardHeight + textField.frame.size.height) | |
| self.scrollView.setContentOffset(CGPoint(x: 0, y: y >= margin ? y - margin : 0), animated: true) | |
| } |
| override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
| // Get the new view controller using segue.destinationViewController. | |
| // Pass the selected object to the new view controller. | |
| } |
| let fontFamilyNames = UIFont.familyNames | |
| for familyName in fontFamilyNames { | |
| print("------------------------------") | |
| print("Font Family Name = [\(familyName)]") | |
| let names = UIFont.fontNames(forFamilyName: familyName ) | |
| print("Font Names = [\(names)]") | |
| } |