Kingfisher
: 이미지를 손쉽게 관리할 수 있게 해주는 라이브러리
Kingfisher 설치
Podfile 안에 pod 'Kingfisher', '~> 7.0'
추가하기
import Kingfisher
....
if let urlString = arrayCat[indexPath.row - 1].url {
let url = URL(string: urlString)
cell.imageViewFeed.kf.setImage(with: url)
}
<Kingfisher 라이브러리를 통해 이미지 url을 이미지뷰에 띄어보기>
Decodable
: Decodable -> data를 원하는 모델로 Decode 해주는 것
Encodable
: Encodable -> data를 Encoder에서 변환해주려는 프로토콜로 바꿔주는 것
Multipart
: Alamofire에서 제공해주는 기능으로 이미지를 data로 전환해서 전송하는 방식
multipart/form-data
서버에게 이미지파일 자체를 보내는 방법 = upload 메소드를 사용해서 MultiPart의 형태로 보내기
multipart 통신에서는 일반적으로 String, Int, Double, 이런 식으로 바로 데이터를 보내는 것이 아니라, byte buffer 형식으로 보내야 한다.
그렇게 때문에 보내고자 하는 값 각각을 최종적으로 Data() 를 이용하여 형변환을 해 준 다음에 append 해줘야 한다. 각 값에 utf8 을 적용한 이유는 인코딩을 위해서다.
Firebase
<Firebase에서 제공해주는 기능>
error.localizedDescription
: error의 코멘트 역할
LocalizedDescription 활용 방법
LocalizedError