how can i put these print text into Textfield?
UNUserNotificationCenter.current().getPendingNotificationRequests { DispatchQueue.main.async{//Contextual closure type '() -> Void' expects 0 arguments, but 1 was used in closure body let str:String = "" self.finalresulter.text = str self.finalresulter.text = "\($0.map{$0.content.title})" } } You are using $0 inside async { } closure. This closure expects no arguments, which means using $0 argument shortcut is invalid. You are evidently attempting to refer to requests array from getPendingNotificationRequests callback. The reason you can't by using $0 is that it's screened by DispatchQueue