答案 0 :(得分:1)
struct SomePost: Post {
var referenceIndex: Int
var likeCount: Int
var likeStatus: Bool
var commentCount: Int
var commentStatus: Bool
}
let somePost1 = SomePost(referenceIndex: 1, likeCount: 1, likeStatus: true, commentCount: 1, commentStatus: true)
let somePost2 = SomePost(referenceIndex: 2, likeCount: 1, likeStatus: true, commentCount: 1, commentStatus: true)
let somePost3 = SomePost(referenceIndex: 1, likeCount: 1, likeStatus: true, commentCount: 1, commentStatus: true)
somePost1 == somePost2 //false
somePost1 == somePost3 //true