개발자를 위한 영어 문법

84588f0a570b054c4cfd34d9096a2507?s=47 Soojin Ro
August 21, 2018

개발자를 위한 영어 문법

“프로그램은 사람들에게 읽히기 위한 목적으로 만들어져야 하고, 우연히 컴퓨터가 실행할 수 있다면 더욱 좋다.”
- SICP

사람에게 잘 읽히는 스위프트 코드를 작성하기 위해 알아야하는 최소한의 영어 문법을 정리했습니다.

발표 녹화본: https://tv.naver.com/v/4980432

같이 읽으면 좋은 글
https://soojin.ro/blog/naming-boolean-variables
https://soojin.ro/blog/english-for-developers-swift

84588f0a570b054c4cfd34d9096a2507?s=128

Soojin Ro

August 21, 2018
Tweet

Transcript

  1. ֢ࣻ૓ IUUQTTPPKJOSP ѐߊ੗ܳਤೠ৔য

  2. 4USVDUVSFTBOE*OUFSQSFUBUJPOPG$PNQVUFS1SPHSBNT ஹೊఠ೐۽Ӓ۔੄ҳઑ৬೧ࢳ t1SPHSBNTTIPVMECFXSJUUFOGPSQFPQMFUPSFBE  BOEPOMZJODJEFOUBMMZGPSNBDIJOFTUPFYFDVUFu t೐۽Ӓ۔਷ࢎۈٜীѱ੍൤ӝਤೠݾ੸ਵ۽ٜ݅যઉঠೞҊ  ਋ো൤ஹೊఠоप೯ೡࣻ੓׮ݶ؊਌જ׮u

  3. ৔য ஶ߮࣌ ੜ੍൤ח ௏٘

  4. ੉૕੸ੋ ו՝ ӝ҅ܳ ਤೠ௏٘ ೧ࢳ੉ য়ېѦܿ ৔য ஶ߮࣌ ੜ੍൤ח ௏٘

  5. ই݃ب਋ܻٜ ӝ҅ܳ ਤೠ௏٘ ੉૕੸ੋ ו՝ ೧ࢳ੉ য়ېѦܿ ੜ੍൤ח ௏٘ ৔য

    ஶ߮࣌
  6. ਃ੿بݾ಴ ӝ҅ܳ ਤೠ௏٘ ੉૕੸ੋ ו՝ ೧ࢳ੉ য়ېѦܿ ੜ੍൤ח ௏٘ ৔য

    ஶ߮࣌
  7. ઱য زࢎ ݾ੸য যڌѱ view.insertSubview(gradientView, at: 2) ೐۽Ӓ۔Ӗ

  8. ݺࢎ زࢎ ഋਊࢎ ݺࢎ ੹஖ࢎ view.insertSubview(gradientView, at: 2) ৢ߄ܲಿࢎࢎਊ ݺࢎ

    ݺࢎ buyButton
  9. زࢎਗഋ җѢഋ җѢ࠙ࢎഋ SFRVFTU SFRVFTUFE SFRVFTUFE NBLF NBEF NBEF IJEF

    IJE IJEEFO ೣࣻݫࢲ٘ীࢎਊ ઑزࢎ DBOTIPVME١ ٍী FHDBO#FDPNF'JSTU3FTQPOEFS -JGF$ZDMFҙ۲EFMFHBUF FHEJE3FDFJWF XJMM"QQFBS EJE$PNQMFUF زࢎ੄߸ഋ
  10. زࢎਗഋ җѢഋ җѢ࠙ࢎഋ SFRVFTU SFRVFTUFE SFRVFTUFE NBLF NBEF NBEF IJEF

    IJE IJEEFO زࢎ੄߸ഋ ॶੌ੉হ਺
  11. җѢ࠙ࢎഋਊࢎ ࣻز੄੄޷ FHSFRVFTUFE%BUB IJEEFO7JFX #PPM߸ࣻ FHJT)JEEFO JT4FMFDUFE زࢎ੄߸ഋ زࢎਗഋ җѢഋ

    җѢ࠙ࢎഋ SFRVFTU SFRVFTUFE SFRVFTUFE NBLF NBEF NBEF IJEF IJE IJEEFO
  12. ݺࢎ৬زࢎоэ਷҃਋ب੓਺ ݺࢎ৬э਷زࢎ ݺࢎ زࢎ SFRVFTU SFRVFTU TUBSU TUBSU QMBZ QMBZ

  13. #PPM ੄޷ ৘द JT ݺࢎ _ੋо JT%FTDBOEBOU PG JT7JEFP JT'BWPSJUF

    JT അ੤૓೯ഋ _JOH _ೞח઺ੋо JT&YFDVUJOH JT1FOEJOH JT ഋਊࢎ _ੋо JT0QBRVF JT&EJUBCMF _غ঻חо JT4FMFDUFE JT)JEEFO DBOTIPVMEXJMM زࢎਗഋ _ೡࣻ੓ա _೧ঠೞա  _ೡѪੋо  DBO#FDPNF'JSTU3FTQPOEFS IBT ݺࢎ _ਸо૑Ҋ੓חо IBT7JEFP IBTJ$MPVE"DDPVOU IBT җѢ࠙ࢎ _غ঻חо  ࢚క੄૑ࣘъઑ IBT$POOFDUFE IBT&OEFE زࢎਗഋਊߨ  QSFTFSWFT4VQFSWJFX-BZPVU.BSHJOT JT زࢎਗഋ ൔ൤ೞחपࣻ JT"VUIPSJ[F JT%FMFUF JT'JOE JT"EE ❗
  14. ױࣻ৬ࠂࣻ let album: Album let albums: [Album] for album in

    albums { } var album: [Album] let coverSongs = album.map { $0.coverSong } var album: Album? let artwork = album.map { downloader.image(from: $0.artworkURL) } ❓
  15. ࠛӏ஗ࠂࣻഋ ױࣻ ࠂࣻ WJFX WJFXT CPY CPYFT IBTI IBTIFT DBUFHPSZ

    DBUFHPSJFT GBDUPSZ GBDUPSJFT IBMG IBMWFT DIJME DIJMESFO QFSTPO QFPQMF JOEFY JOEFYFT JOEJDFT EBUVN EBUB
  16. ఋੑ߹/BNJOH$POWFOUJPO var profileImage: String var profileImageUrl: String var profileImage: URL

    var thumbnail: URL var thumb: UIImage var profileImage: UIImage
  17. 63- var fullSizeImageURL: URL? //PHContentEditingInput var renderedContentURL: URL //PHContentEditingOutput var

    originalURL: URL? //MLMediaObject var thumbnailURL: URL? //MLMediaObject var assetURL: URL? //MPMediaItem var referenceURL: URL //SCNReferenceNode
  18. 6**NBHF var referenceImage: ARReferenceImage? //ARImageAnchor var displaySizeImage: UIImage? //PHContentEditingInput var

    fullSizeImage: CIImage //PHLivePhotoEditingContent var iconImage: NSImage? //MLMediaGroup var artworkImage: NSImage? //MLMediaObject
  19. 4J[F %BUF %BUB var physicalSize: CGSize //ARReferenceImage var startDate: Date

    //AVMutable…Group var creationDate: Date? //PHAsset var arrivalDate: Date //CLVisit var adjustmentData: PHAdjustmentData? //PHContentEditingInput
  20. FUD var identifier: AVMetadataIdentifier? { get } //AVMetadataItem var localIdentifier:

    String { get } //PHObject var formatIdentifier: String { get } //PHAdjustmentData var identifier: String { get } //CLRegion var identifier: String { get } //MLMediaGroup var identifier: String { get } //SCNReferenceNode var identifier: String { get } //NSPersistentStore var objectID: NSManagedObjectID { get } //NSManagedObjectID var recordID: CKRecordID { get } //CKRecord var uniqueID: String? { get } //AVMetadataGroup *%WT*EWTJEFOUJGJFS
  21. FUD JT)JEEFOWTIJEEFO var isHidden: Bool { get set } @property(nonatomic,

    getter=isHidden) BOOL hidden;
  22. ઺ࠂઁѢ struct User { let userID: String } let id

    = user.userID struct User { let identifier: String } let id = user.identifier
  23. struct ImageDownloader { func downloadImage(from url: URL) {} } let

    imageDownloader = ImageDownloader() imageDownloader.downloadImage(from: imageURL) imageDownloader.download(from: imageURL) imageManager.download(from: imageURL) imageDownloader.fetch(from: imageURL) ઺ࠂઁѢ
  24. HFU❌ func date(from string: String) -> Date? func anchor(for node:

    SCNNode) -> ARAnchor? func distance(from location: CLLocation) -> CLLocationDistance func track(withTrackID trackID: CMPersistentTrackID) -> AVAssetTrack?
  25. let date = formatter.date(from: dateString) let imageAnchor = sceneView.anchor(for: node)

    let distance = startLocation.distance(from: destination) let track = asset.track(withTrackID: identifier) HFU❌
  26. HFU GFUDI SFRVFTU FYFDVUFQFSGPSN ݫࢲ٘

  27. HFU func getPlaylist(with uuid: UUID, creationMetadata: MPMediaPlaylistCreationMetadata?, completionHandler: @escaping (MPMediaPlaylist?,

    Error?) -> Void) class func fetchAssets(withLocalIdentifiers identifiers: [String], options: PHFetchOptions?) -> PHFetchResult<PHAsset> func requestImage(for asset: PHAsset, targetSize: CGSize, contentMode: PHImageContentMode, options: PHImageRequestOptions?, resultHandler: @escaping (UIImage?, [AnyHashable : Any]?) -> Void) -> PHImageRequestID func execute(_ request: NSPersistentStoreRequest) throws -> NSPersistentStoreResult ݫࢲ٘ SFRVFTU GFUDI FYFDVUFQFSGPSN
  28. //PHAsset class func fetchAssets(withLocalIdentifiers identifiers: [String], options: PHFetchOptions?) -> PHFetchResult<PHAsset>

    //PHAssetCollection class func fetchAssets(in assetCollection: PHAssetCollection, options: PHFetchOptions?) -> PHFetchResult<PHAsset> //NSManagedObjectContext func fetch<T>(_ request: NSFetchRequest<T>) throws -> [T] where T : NSFetchRequestResult GFUDI
  29. None
  30. //PHImageManager func requestImage(for asset: PHAsset, targetSize: CGSize, contentMode: PHImageContentMode, options:

    PHImageRequestOptions?, resultHandler: @escaping (UIImage?, [AnyHashable : Any]?) -> Void) -> PHImageRequestID //PHAssetResourceManager func requestData(for resource: PHAssetResource, options: PHAssetResourceRequestOptions?, dataReceivedHandler handler: @escaping (Data) -> Void, completionHandler: @escaping (Error?) -> Void) -> PHAssetResourceDataRequestID //CLLocationManager func requestAlwaysAuthorization() func requestLocation() //MLMediaLibrary class func requestAuthorization(_ handler: @escaping (MPMediaLibraryAuthorizationStatus) -> Void) SFRVFTU
  31. None
  32. //VNImageRequestHandler func perform(_ requests: [VNRequest]) throws //PHAssetResourceManager func performChanges(_ changeBlock:

    @escaping () -> Void, completionHandler: ((Bool, Error?) -> Void)? = nil) //NSManagedObjectContext func perform(_ block: @escaping () -> Void) //CNContactStore func execute(_ saveRequest: CNSaveRequest) throws //NSFetchRequest func execute() throws -> [ResultType] FYFDVUFQFSGPSN
  33. ݃ޖܻ թ੉ա੄௏੍٘ܳਸٸܳҊ۰ ز੄যࢎ੹গਊ IUUQXXXUIFTBVSVTDPN  ಴ળۄ੉࠳۞ܻ߂೐ۨ੐ਕ௼੍যࠁӝ

  34. 2"