Closed ShotaKashihara closed 5 years ago
https://thoughtbot.com/blog/ordered-collection-diffing
Swift 5.1からCollectionのDiffが取れるようになる。 CollectionからどのIndexがInsert/Deleteされたかが取得できるようになるので、UICollectionViewなどを差分更新するのが簡単になる。 RxCocoaにも差分更新の仕組みがあったけど、代替できるかもしれない。
余談: Androidにも似たようなDiffUtilがあって、それを使ったEpoxyっていうOSSも出ている。
https://applech2.com/archives/20190524-wwdc-for-macos-support-wwdc-2019.html
We shouldn't use these for Auto Layout. but, sometimes I want to decide sizes or margins from these metrics.
https://docs.google.com/spreadsheets/d/1wo2cYCuhNO9nCn-E4mm5mfnwYWW1H1BdzNFZmzxVhnQ/edit#gid=0
Source: https://www.reddit.com/r/swift/comments/btelg6/most_useful_list_of_ios_design_parameter_values
ref: https://app.quicktype.io/
{
"browser_bottom_bar": {
"share_action": {
"enabled": false,
"done": false
},
"enabled": true,
"avatar_url": null,
"description": null,
"like_action": {
"done": false,
"enabled": false,
"target_user_id": null,
"display_email_dialogue": false
},
"coaching": {
"target": "NONE",
"main_description": "",
"sub_description": null
}
},
"advertisement": {
"impression_ad_param": "{}",
"enabled": false,
"display_pr_label": false,
"click_ad_param": "{}"
},
"content_uuid": "066dd7ed-c3b5-4da5-982f-ccff33eb5664",
"title": "外部サイトをアプリ内ブラウザで開く",
"image_url": "https://yashima-updates-contents-qa.s3.ap-northeast-1.amazonaws.com/links/manual_posted/21fe78cb-bc68-49c7-859a-3db157535aa5",
"source_name": "Wikipedia",
"like_action": {
"done": false,
"enabled": false,
"target_user_id": null,
"display_email_dialogue": false
},
"browser_behavior": {
"on_pageload_finished_script": ""
},
"url": "https://en.wikipedia.org/wiki/Cat"
}
このJSONを変換してみる
// This file was generated from JSON Schema using quicktype, do not modify it directly.
// To parse the JSON, add this file to your project and do:
//
// let listItem = try? newJSONDecoder().decode(ListItem.self, from: jsonData)
import Foundation
// MARK: - ListItem
struct ListItem: Codable {
let browserBottomBar: BrowserBottomBar
let advertisement: Advertisement
let contentUUID, title: String
let imageURL: String
let sourceName: String
let likeAction: LikeAction
let browserBehavior: BrowserBehavior
let url: String
enum CodingKeys: String, CodingKey {
case browserBottomBar = "browser_bottom_bar"
case advertisement
case contentUUID = "content_uuid"
case title
case imageURL = "image_url"
case sourceName = "source_name"
case likeAction = "like_action"
case browserBehavior = "browser_behavior"
case url
}
}
// MARK: - Advertisement
struct Advertisement: Codable {
let impressionAdParam: String
let enabled, displayPRLabel: Bool
let clickAdParam: String
enum CodingKeys: String, CodingKey {
case impressionAdParam = "impression_ad_param"
case enabled
case displayPRLabel = "display_pr_label"
case clickAdParam = "click_ad_param"
}
}
// MARK: - BrowserBehavior
struct BrowserBehavior: Codable {
let onPageloadFinishedScript: String
enum CodingKeys: String, CodingKey {
case onPageloadFinishedScript = "on_pageload_finished_script"
}
}
// MARK: - BrowserBottomBar
struct BrowserBottomBar: Codable {
let shareAction: ShareAction
let enabled: Bool
let avatarURL, browserBottomBarDescription: JSONNull?
let likeAction: LikeAction
let coaching: Coaching
enum CodingKeys: String, CodingKey {
case shareAction = "share_action"
case enabled
case avatarURL = "avatar_url"
case browserBottomBarDescription = "description"
case likeAction = "like_action"
case coaching
}
}
// MARK: - Coaching
struct Coaching: Codable {
let target, mainDescription: String
let subDescription: JSONNull?
enum CodingKeys: String, CodingKey {
case target
case mainDescription = "main_description"
case subDescription = "sub_description"
}
}
// MARK: - LikeAction
struct LikeAction: Codable {
let done, enabled: Bool
let targetUserID: JSONNull?
let displayEmailDialogue: Bool
enum CodingKeys: String, CodingKey {
case done, enabled
case targetUserID = "target_user_id"
case displayEmailDialogue = "display_email_dialogue"
}
}
// MARK: - ShareAction
struct ShareAction: Codable {
let enabled, done: Bool
}
// MARK: - Encode/decode helpers
class JSONNull: Codable, Hashable {
public static func == (lhs: JSONNull, rhs: JSONNull) -> Bool {
return true
}
public var hashValue: Int {
return 0
}
public init() {}
public required init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
if !container.decodeNil() {
throw DecodingError.typeMismatch(JSONNull.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for JSONNull"))
}
}
public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
try container.encodeNil()
}
}
InVisionが公開しているデザインのベストプラクティスに関する情報を発信しているメディア。 5/22にアニメーションのハンドブックが公開されてた。
Android ではGoogleがArchitectureについて言及している。 https://developer.android.com/jetpack?hl=en
Why
Where
Pearl Jam (Subject to change)
5F, MG Shirokanedai Building (Wantedly, Inc. Tokyo HQ)
Who
You are working for Wantedly? Sure, you can join anytime. If not, you need to contact us first. Or, you can "want to visit" the meetup, which you can find in www.wantedly.com/companies/wantedly/projects.
What
You write topics like below contents and we talk about these on the meetup. Every participant needs to write one topic at least.
Also, you can find new topics from the newsletters:
How
・・・
参加者は開催までに話したいことを少なくとも1トピックをコメントしましょう。 ネタ被りを避けるために、まずはタイトルだけでコメントすることを推奨します。 より多くの学びを得るためにどんな内容でもアウトプットを歓迎します!😊
cc/ @wantedly/ios
Edit this template
Previous issue
https://github.com/wantedly/ios_night/issues/50