Advertisement
Guest User

Untitled

a guest
May 30th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. func carousel(carousel: iCarousel, viewForItemAtIndex index: Int, reusingView view: UIView?) -> UIView {
  2. let tempView = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) //Adding the buttons
  3.  
  4. if index == 0 {
  5. let actua = UIButton(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
  6.  
  7. actua.setTitle("Actua", forState: .Normal)
  8. actua.setTitleColor(UIColor.blackColor(), forState: .Normal)
  9.  
  10. let HeistLeeftFoto = UIImage.init(named: "HeistLeeft")
  11. actua.setBackgroundImage(HeistLeeftFoto!, forState: .Normal)
  12. tempView.addSubview(actua)
  13.  
  14.  
  15.  
  16. }
  17.  
  18. else if index == 1 {
  19. let shoppen = UIButton(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
  20.  
  21. shoppen.setTitle("Shoppen", forState: .Normal)
  22. shoppen.setTitleColor(UIColor.whiteColor(), forState: .Normal)
  23.  
  24. let BergStraatFoto = UIImage.init(named: "Bergstraat")
  25. shoppen.setBackgroundImage(BergStraatFoto!, forState: .Normal)
  26. tempView.addSubview(shoppen)
  27. }
  28.  
  29. actua.addTarget(self, action: ViewController.pushActua, forControlEvents: UIControlEvents.TouchUpInside)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement