Upgrade to Pro — share decks privately, control downloads, hide ads and more …

개발자를 위한 영어 문법

개발자를 위한 영어 문법

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

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

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

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

Soojin Ro

August 21, 2018
Tweet

More Decks by Soojin Ro

Other Decks in Programming

Transcript

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  10. زࢎਗഋ җѢഋ җѢ࠙ࢎഋ
    SFRVFTU SFRVFTUFE SFRVFTUFE
    NBLF NBEF NBEF
    IJEF IJE IJEEFO
    زࢎ੄߸ഋ
    ॶੌ੉হ਺

    View full-size slide

  11. җѢ࠙ࢎഋਊࢎ
    ࣻز੄੄޷
    FHSFRVFTUFE%BUB IJEEFO7JFX
    #PPM߸ࣻ
    FHJT)JEEFO JT4FMFDUFE
    زࢎ੄߸ഋ
    زࢎਗഋ җѢഋ җѢ࠙ࢎഋ
    SFRVFTU SFRVFTUFE SFRVFTUFE
    NBLF NBEF NBEF
    IJEF IJE IJEEFO

    View full-size slide

  12. ݺࢎ৬زࢎоэ਷҃਋ب੓਺
    ݺࢎ৬э਷زࢎ
    ݺࢎ زࢎ
    SFRVFTU SFRVFTU
    TUBSU TUBSU
    QMBZ QMBZ

    View full-size slide

  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

    View full-size slide

  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) }

    View full-size slide

  15. ࠛӏ஗ࠂࣻഋ
    ױࣻ ࠂࣻ
    WJFX WJFXT
    CPY CPYFT
    IBTI IBTIFT
    DBUFHPSZ DBUFHPSJFT
    GBDUPSZ GBDUPSJFT
    IBMG IBMWFT
    DIJME DIJMESFO
    QFSTPO QFPQMF
    JOEFY JOEFYFT JOEJDFT
    EBUVN EBUB

    View full-size slide

  16. ఋੑ߹/BNJOH$POWFOUJPO
    var profileImage: String
    var profileImageUrl: String
    var profileImage: URL
    var thumbnail: URL
    var thumb: UIImage
    var profileImage: UIImage

    View full-size slide

  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

    View full-size slide

  18. 6**NBHF
    var referenceImage: ARReferenceImage? //ARImageAnchor
    var displaySizeImage: UIImage? //PHContentEditingInput
    var fullSizeImage: CIImage //PHLivePhotoEditingContent
    var iconImage: NSImage? //MLMediaGroup
    var artworkImage: NSImage? //MLMediaObject

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  21. FUD
    JT)JEEFOWTIJEEFO
    var isHidden: Bool { get set }
    @property(nonatomic, getter=isHidden) BOOL hidden;

    View full-size slide

  22. ઺ࠂઁѢ
    struct User {
    let userID: String
    }
    let id = user.userID
    struct User {
    let identifier: String
    }
    let id = user.identifier

    View full-size slide

  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)
    ઺ࠂઁѢ

    View full-size slide

  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?

    View full-size slide

  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❌

    View full-size slide

  26. HFU
    GFUDI
    SFRVFTU
    FYFDVUFQFSGPSN
    ݫࢲ٘

    View full-size slide

  27. HFU
    func getPlaylist(with uuid: UUID, creationMetadata: MPMediaPlaylistCreationMetadata?,
    completionHandler: @escaping (MPMediaPlaylist?, Error?) -> Void)
    class func fetchAssets(withLocalIdentifiers identifiers: [String],
    options: PHFetchOptions?) -> PHFetchResult
    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

    View full-size slide

  28. //PHAsset
    class func fetchAssets(withLocalIdentifiers identifiers: [String],
    options: PHFetchOptions?) -> PHFetchResult
    //PHAssetCollection
    class func fetchAssets(in assetCollection: PHAssetCollection,
    options: PHFetchOptions?) -> PHFetchResult
    //NSManagedObjectContext
    func fetch(_ request: NSFetchRequest) throws -> [T] where T : NSFetchRequestResult
    GFUDI

    View full-size slide

  29. //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

    View full-size slide

  30. //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

    View full-size slide

  31. ݃ޖܻ
    թ੉ա੄௏੍٘ܳਸٸܳҊ۰
    ز੄যࢎ੹গਊ IUUQXXXUIFTBVSVTDPN

    ಴ળۄ੉࠳۞ܻ߂೐ۨ੐ਕ௼੍যࠁӝ

    View full-size slide