swift - How to convert Optional String to String -


@iboutlet var navbar: uinavigationbar! @iboutlet var menubutton: uibarbuttonitem! @iboutlet var topicnamelabel: uilabel! var topicname:string! override func viewdidload() {     super.viewdidload()      // additional setup after loading view.     menubutton.target = self.revealviewcontroller()     menubutton.action = selector("revealtoggle:")      navbar.bartintcolor = uicolor(red: 0, green: 0.4176, blue: 0.4608, alpha: 1)     topicnamelabel.text = self.topicname  } 

that's code, pass string topicname prepareforsegue, however, find in simulator, topicnamelabel shows "optional(the text want)". want "the text want", not need optional. 1 me?

i think problem string contains "optional", can try indexat(0) see "o" or not.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -