接下來分享,我如何一次通過考試,並且拿到90分
我是在去年 2020 Cyber Monday 特價的時候買的,連買多少錢都忘了,而且拖到快過期才去考 XD
考試是採用線上考試的方式,考生可以在家上網,找個安靜的空間就可以考試了(後面會詳細講。
// Magical enhanced SwiftyJSON with tree traversal | |
/* | |
ex: | |
let a_b_c = JSONTree(root: demoJSON, keyPath: ["a", "b", "c"]) | |
print(a_b_c.parentNode.parentNode["n"]) | |
*/ | |
struct JSONTree { | |
var root:JSON | |
var keyPath:[JSONSubscriptType] | |
extension Array where Element: Hashable { | |
func after(item: Element) -> Element? { | |
if let index = self.indexOf(item) where index + 1 < self.count { | |
return self[index + 1] | |
} | |
return nil | |
} | |
} |
class MyManager { | |
private static let sharedInstance = MyManager() | |
class var sharedManager : MyManager { | |
return sharedInstance | |
} | |
} |
var fetchedResultsProcessingOperations: [NSBlockOperation] = [] | |
private func addFetchedResultsProcessingBlock(processingBlock:(Void)->Void) { | |
fetchedResultsProcessingOperations.append(NSBlockOperation(block: processingBlock)) | |
} | |
func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) { | |
switch type { | |
case .Insert: |
protocol ImagePickable { | |
var imagePicker:UIImagePickerController { get set } | |
func openPhotoLibrary() | |
} | |
var AssociatedObjectHandle: UInt8 = 0 | |
extension UIViewController : ImagePickable, UIImagePickerControllerDelegate, UINavigationControllerDelegate { | |
var imagePicker:UIImagePickerController { | |
get { |
PS: If you liked this talk or like this concept, let's chat about iOS development at Stitch Fix! #shamelessplug
Speaker: David Abrahams. (Tech lead for Swift standard library)
"Crusty" is an old-school programmer who doesn't trust IDE's, debuggers, programming fads. He's cynical, grumpy.
OOP has been around since the 1970's. It's not actually new.
Classes are Awesome
// Fix for IOS 9 pop-over arrow anchor bug | |
// --------------------------------------- | |
// - IOS9 points pop-over arrows on the top left corner of the anchor view | |
// - It seems that the popover controller's sourceRect is not being set | |
// so, if it is empty CGRect(0,0,0,0), we simply set it to the source view's bounds | |
// which produces the same result as the IOS8 behaviour. | |
// - This method is to be called in the prepareForSegue method override of all | |
// view controllers that use a PopOver segue | |
// | |
// example use: |
extension NSManagedObject { | |
// Returns the unqualified class name, i.e. the last component. | |
// Can be overridden in a subclass. | |
class func entityName() -> String { | |
return String(self) | |
} | |
convenience init(context: NSManagedObjectContext) { | |
let eName = self.dynamicType.entityName() |
// | |
// ViewController.swift | |
// WatchPairedExample | |
// | |
// Created by 張 景隆 on 2015/11/26. | |
// Copyright © 2015年 張 景隆. All rights reserved. | |
// | |
import UIKit | |
import WatchConnectivity |