✅ [Accepted] Solution for Swift
Disclaimer: By using any content from this post or thread, you release the author(s) from all liability and warranties of any kind. You can are to use the cont
<blockquote>
<b>Disclaimer:</b> By using any content from this post or thread, you release the author(s) from all liability and warranties of any kind. You can are to use the content as you see fit. Any suggestions for improvement are welcome and greatly appreciated! Happy coding!
</blockquote>

```swift
class Solution {
    func groupAnagrams(_ strs: [String]) -> [[String]] {
        var dict: [[Character]: [String]] = [:]
        
        for str in strs {
            let sortedStr = str.sorted()
            dict[sortedStr, default: []].append(str)
        }
        
        return Array(dict.values)
    }
}
```
['Swift']