ohtt-ios / bithumb_awesome Goto Github PK
View Code? Open in Web Editor NEW빗썸 - 어썸 ✨ 강경&오뜨 아자아자 화이팅 💪🏻
빗썸 - 어썸 ✨ 강경&오뜨 아자아자 화이팅 💪🏻
dataRequest.responseData{ (response) in
switch response.result {
case .success(_):
guard let value = response.value,
let status = response.response?.statusCode else { return }
switch status {
case 200:
do {
if let json = try JSONSerialization.jsonObject(with: value, options: []) as? [String: Any] {
var items = json["data"] as? [String: Any]
let result = try items?.map { key, value -> Asset in
let valueData = try JSONSerialization.data(withJSONObject: value, options: [])
let assetResponse = try JSONDecoder().decode(AssetResponse.self, from: valueData)
return Asset(ticker: key, data: assetResponse)
}
subscriber.send(result!)
}
} catch {
subscriber.send(completion: .failure(Failure()))
}
default:
break
}
case .failure(_):
subscriber.send(completion: .failure(Failure()))
break
}
}
.validate(statusCode: 200..<300)
를 사용하여 불필요한코드를 줄였으나, 디코딩 부분의 개선이 필요합니다.dataRequest
.validate(statusCode: 200..<300)
.responseData { response in
switch response.result {
case .success(let value):
do {
if let json = try JSONSerialization.jsonObject(with: value, options: []) as? [String: Any] {
var items = json["data"] as? [String: Any]
let result = try items?.map { key, value -> Asset in
let valueData = try JSONSerialization.data(withJSONObject: value, options: [])
let assetResponse = try JSONDecoder().decode(AssetData.self, from: valueData)
return Asset(ticker: key, data: assetResponse)
}
subscriber.send(result!)
}
} catch {
subscriber.send(completion: .failure(Failure()))
}
case .failure(_):
subscriber.send(completion: .failure(Failure()))
break
}
}
List
의 leading에 디폴트 padding이 들어감.padding(.leading, -20)
일단은 반대방향으로 다시 패딩을 주어서 해결했습니다. 좀 더 고민해봐야할거 같아요..😅
List
의 section header
를 사용해서, 윗 뷰와의 간격이 벌어짐List {
Section(header: AssetListHeader()) {
// ForEach(viewStore.assetData) { asset in
// AssetListRow(asset: asset)
// }
}
}
UI적으로 크게 이상하지않아 그대로 두었습니다. 추후 문제가 생긴다면 커스터마이징하게 처리할 예정입니다!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.