I made a pot... on Swift.



  • self.view.backgroundColor = UIColor(patternImage: UIImage(named: background[9])!)
    

    (this works. ♪ ♪ I don't need a keyboard. ♪ ♪ )

    I wish I could.

    self.view.backgroundColor = UIColor(patternImage: UIImage!(named: (UInt32(arc4random_uniform(9))), background)!)
    

    (for each launch the background was different. ♪ ♪ )

    I swear.

    Cannot invoke initializer for type 'UIImage!' with an argument list of type '(named: (UInt32), [String])'

    and fix it. ♪ ♪



  • approximately:

    self.view.backgroundColor = UIColor(patternImage: UIImage(named: background[Int(arc4random_uniform(UInt32(background.count)))])!)
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2