Try with this way
View --> Debug Area --> Activate Console
same answer as @Nazmul Hasan, but with an image to help others.
I found that you could not type print("the data you want to print") in normal class with no type.
print("the data you want to print")
You need to type this code in general viewController, such as UIViewController or UITableViewController.
viewController
UIViewController
UITableViewController