> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/ios/swift/pattern-matching/sentence-patterns/...-as-....md).

# ... as! ...

[Swift](/ios/swift.md) ⟩ [Pattern Matching](/ios/swift/pattern-matching.md) ⟩ [Sentence Patterns](/ios/swift/pattern-matching/sentence-patterns.md) ⟩

{% hint style="info" %}

* <mark style="color:red;">**as!**</mark>: force type casting.
  {% endhint %}

{% tabs %}
{% tab title="💈範例" %}
💾 程式： [Mirror.handleChildren()](/ios/swift/debugging/mirror/mirror.handlechildren.md)

```swift
// mirror self
let mirror = Mirror(reflecting: self)

//            ↱ child.label ignored        ╭─── ⭐ where clause ────╮
for case let (_, value) in mirror.children where value is Resettable {

    // ⭐ `as!` force type casting (from Any to Resettable)
    //    "where clause" ensures `value` IS `Resettable`!
    (value as! Resettable).reset()
}
```

{% endtab %}

{% tab title="👥 相關" %}

* [Mirror.handleChildren()](/ios/swift/debugging/mirror/mirror.handlechildren.md) - use <mark style="color:purple;">**`(... as! ...)`**</mark> sentence pattern.
  {% endtab %}
  {% endtabs %}
