과제 해결중..

이진욱(JIN WOOK)·2024년 12월 11일
0

작성중

목록 보기
2/5

서버에서 데이터 가져오기

포켓못 이미지

"sprites": {
    "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/35.png",
    "back_female": null,
    "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/35.png",
    "back_shiny_female": null,
    "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/35.png",
    "front_female": null,
    "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/35.png",
    "front_shiny_female": null,
    "other": {
      "dream_world": {
        "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/dream-world/35.svg",
        "front_female": null
      },
struct Sprites: Codable {
    let other: Other
}
struct Other: Codable {
    let dreamWorld: DreamWorld
}
struct DreamWorld: Codable {
    let frontDefault: String
    
    enum CodingKeys: String, CodingKey {
        case frontDefault = "front_default"
    }

addArrangedSubview(<#T##view: UIView##UIView#>), addSubview(<#T##view: UIView##UIView#>) 차이점??

오토레이아웃 문제 발생이유

스크린샷 2024-12-10 오후 1.34.02.png

스크린샷 2024-12-10 오후 1.34.12.png

다음화면도 네비바를 띄우려면?

  
   @objc private func naviBarButtonTapped() {
       let phoneBookVC = PhoneBookViewController()
    
       phoneBookVC.modalPresentationStyle = .fullScreen
       //self.present(phoneBookVC, animated: true, completion: nil)
       navigationController?.pushViewController(phoneBookVC, animated: true)
       print("네비버튼눌림")
    }

https://0urtrees.tistory.com/43

한글이름 제이슨 데이터 분석

struct KRNameJson: Codable {
    let names: [Name]
}

struct Name: Codable {
    let name: String
    let language: Language
}
struct Language: Codable {
    let name: String
}
[Pokemon_Contact.Name(name: "グレイシア", language: Pokemon_Contact.Language(name: "ja-Hrkt")), 
Pokemon_Contact.Name(name: "Glacia", language: Pokemon_Contact.Language(name: "roomaji")), 
Pokemon_Contact.Name(name: "글레이시아", language: Pokemon_Contact.Language(name: "ko")), 
Pokemon_Contact.Name(name: "冰伊布", language: Pokemon_Contact.Language(name: "zh-Hant")), Pokemon_Contact.Name(name: "Givrali", language: Pokemon_Contact.Language(name: "fr")), Pokemon_Contact.Name(name: "Glaziola", language: Pokemon_Contact.Language(name: "de")), Pokemon_Contact.Name(name: "Glaceon", language: Pokemon_Contact.Language(name: "es")), Pokemon_Contact.Name(name: "Glaceon", language: Pokemon_Contact.Language(name: "it")), Pokemon_Contact.Name(name: "Glaceon", language: Pokemon_Contact.Language(name: "en")), Pokemon_Contact.Name(name: "グレイシア", language: Pokemon_Contact.Language(name: "ja")), Pokemon_Contact.Name(name: "冰伊布", language: Pokemon_Contact.Language(name: "zh-Hans"))]

리스트 형태로 이렇게 출력됨.

Name 리스트에 존재하는 language 부분

for i in names {
if i. 
}

코어데이터 구성 하기

프로젝트 설정에서 코어데이터를 체크안했다면?

forEach문

let numberWords = ["one", "two", "three"]
for word in numberWords {
    print(word)
}
// Prints "one"
// Prints "two"
// Prints "three"

numberWords.forEach { word in
    print(word)
}
// Same as above

https://developer.apple.com/documentation/swift/array/foreach(_:)

코어데이터 이미지 저장하기

NSSecureUnarchiveFromData

아님

Binary Data

profile
기술로부터 소외 되는 사람이 없도록 우리 모두를 위한 서비스를 만들고 싶습니다.

0개의 댓글

관련 채용 정보