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 | |
typealias textFieldConfigurationClosure = (UITextField) -> Void | |
extension UIViewController { | |
func alertController(title : String?, message : String?, preferredStyle : UIAlertControllerStyle, actions: [UIAlertAction], textFieldConfigures: [textFieldConfigurationClosure]) -> UIAlertController { | |
let alertController = UIAlertController(title: title, message: message, preferredStyle: preferredStyle) |
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 String{ | |
static func randomEmoji()->String{ | |
let emojiStart = 0x1F601 | |
let ascii = emojiStart + Int(arc4random_uniform(UInt32(35))) | |
let emoji = UnicodeScalar(ascii)?.description | |
return emoji ?? "😍" | |
} | |
} |
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 PlaygroundSupport | |
class physicViewController : UIViewController { | |
lazy var dynamicAnimator: UIDynamicAnimator = { |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
class 房子 { | |
enum 房間 { | |
case 臥室 | |
case 客廳 | |
case 廚房 |
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
04701fc449ad45ca8021126385e675190b15355b2f625e7f2df9b9bbbb756a5f90af56ddb980f2825d6b133dc5195c2b7087c94221561286556f082fe81dbe2219;davidleeplaysmart |
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
Verifying my Blockstack ID is secured with the address 18vwJJzJH3ompdsFyLbYeGoDAiKK33FY6z https://explorer.blockstack.org/address/18vwJJzJH3ompdsFyLbYeGoDAiKK33FY6z |
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
// let videoLink = "https://www.youtube.com/watch?v=[your-video-id]" | |
if let videoId = URLComponents(string: videoLink)?.queryItems?.first(where: { $0.name == "v" })?.value { | |
let videoWebView = UIWebView(frame: self.videoContainerView.bounds) | |
videoWebView.allowsInlineMediaPlayback = true | |
videoWebView.autoresizesSubviews = true | |
videoWebView.scrollView.bounces = false | |
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
# move .graphql files to ${SRCROOT}/ProjectName/GraphQL/ | |
# move schema.json to ${SRCROOT}/ProjectName/GraphQL/schema.json | |
# move GraphQLAPIs.swift to ${SRCROOT}/ProjectName/Models/GraphQLAPIs.swift | |
npm install -g aws-appsync-codegen | |
aws-appsync-codegen generate "${SRCROOT}/ProjectName/GraphQL/"*.graphql --schema ${SRCROOT}/ProjectName/GraphQL/schema.json --output ${SRCROOT}/ProjectName/Models/GraphQLAPIs.swift | |
# output file ${SRCROOT}/ProjectName/Models/GraphQLAPIs.swift will be updated after build |
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 ViewController { | |
@IBOutlet weak var scrollView: UIScrollView! | |
// ... | |
} | |
extension ViewController { | |
func registerKeyboardNotifications() { |
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 ViewController { | |
@IBOutlet weak var emailTextField: OyaRoundCornerTextField! | |
@IBOutlet weak var passwordTextField: OyaRoundCornerTextField! | |
// ... | |
var textFields: [UITextField] { | |
get { |
OlderNewer