Created
November 5, 2021 07:34
-
-
Save GeekTree0101/6ce05fbda4196e58d76e6ff3c72c500a to your computer and use it in GitHub Desktop.
jay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ViewModel { | |
let id: Int | |
let name: String | |
let hasLock: Bool | |
} | |
let groups: [FleaMarketGroup] = ... | |
let viewModels: [ViewModel] = groups.map { hasLock: true } + [ViewModel( hasLock: false)] | |
// UI | |
// hasLock -> 자물쇠 유무 | |
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { | |
return ASStackLayoutSpec( | |
direction: .horizontal, | |
spacing: 5.8, | |
justifyContent: .start, | |
alignItems: .center, | |
children: [ | |
self.radioButtonNode, | |
self.viewModel.hasLock == true ? self.lockerImageNode : nil | |
].comapactMap { $0 } | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment