Naming conflict with the Swift StreamVideo SDK

56 Views Asked by At

How can I solve a naming conflict between e.g. a local User object and the same object name in the StreamVideo SDK?

Regular imports can lead to problems with existing project files that have the same names. Also, there can be a conflict with the StreamVideo class as it's the same name as the package itself.

1

There are 1 best solutions below

0
Stefan Blos On

Create a typealias in a separate file with the custom name (in this case StreamUser) that you want to give the object:

import struct StreamVideo.User

typealias StreamUser = StreamVideo.User

This works for all other naming conflicts that might occur as well.