포켓못 이미지
"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"
}
@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.
}
프로젝트 설정에서 코어데이터를 체크안했다면?
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