Skip to content

Commit 3841c5b

Browse files
committed
update
1 parent 9ceb9a0 commit 3841c5b

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

_posts/2023/02/2023-02-17-ios-dicontainer-3-property-wrapper.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,13 @@ let list = Runtime.classList
134134
.compactMap { $0 as? SampleClass.Type }
135135

136136
dump(list)
137-
// Output : ▿ 1 element
138-
// - ModuleName.SampleClass #0
137+
// Output :
138+
// ▿ 1 element
139+
// - ModuleName.SampleClass #0
139140

140141
list.forEach { $0.output() }
141-
// Output : Hello SampleClass
142+
// Output :
143+
// Hello SampleClass
142144
```
143145

144146
모듈에 SampleClass 이름을 가진 클래스는 하나 밖에 없기 때문에, filter를 통해 일치하는 클래스는 하나만 존재하는 것을 확인할 수 있습니다.
@@ -182,8 +184,8 @@ dump(list)
182184

183185
list.forEach { $0.output() }
184186
// Output :
185-
/// Hello SampleClassString String
186-
/// Hello SampleClassInt Int
187+
// Hello SampleClassString String
188+
// Hello SampleClassInt Int
187189
```
188190

189191
compactMap으로 타입 캐스팅을 통해서 SampleProtocol을 채택한 클래스를 쉽게 찾을 수 있었습니다.

0 commit comments

Comments
 (0)