2

Im trying to display two xib views onto a scroll view in the main storyboard, this is the code for displaying the views...

let V1: ProfileViewControllerXIB = ProfileViewControllerXIB(nibName: "ProfileViewControllerXIB", bundle: nil)

    let V2: ProfileViewControllerDown = ProfileViewControllerDown(nibName: "ProfileViewControllerDown", bundle: nil)

    self.addChildViewController(V1)
    self.scrollView.addSubview(V1.view)
    V1.didMoveToParentViewController(self)

    self.addChildViewController(V2)
    self.scrollView.addSubview(V2.view)
    V2.didMoveToParentViewController(self)

    var V2Frame: CGRect = V2.view.frame
    V2Frame.origin.y = self.view.frame.height
    V2.view.frame = V2Frame

    self.scrollView.contentSize = CGSizeMake(self.view.frame.width, self.view.frame.size.height * 2)

but it's giving the error "Type of expression is ambiguous without more context" on the first line. However, the scroll view was displaying the two xibs fine before I added things onto "ProfileViewControllerXIB" Does anyone know whats wrong or how to fix this? thanks

Andrew Harris
  • 396
  • 7
  • 24

0 Answers0