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 Foundation | |
extension Dictionary { | |
mutating public func setValue(value: Any, forKeyPath keyPath: String) { | |
var keys = keyPath.components(separatedBy: ".") | |
guard let first = keys.first as? Key else { print("Unable to use string as key on type: \(Key.self)"); return } | |
keys.remove(at: 0) | |
if keys.isEmpty, let settable = value as? Value { | |
self[first] = settable | |
} else { |
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 { |
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
# 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
// 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
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
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
//: 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
import UIKit | |
import PlaygroundSupport | |
class physicViewController : UIViewController { | |
lazy var dynamicAnimator: UIDynamicAnimator = { |
NewerOlder