Uiscrollview zoom code

Discussion in 'iOS Programming' started by nashyo, Mar 23, 2012.

  1. nashyo macrumors 6502

    nashyo

    Joined:
    Oct 1, 2010
    Location:
    Bristol
    #1
    I've found this code on Ray Wenderlich

    UIScrollView *scrollView;

    Code:
    CGRect scrollViewFrame = self.scrollView.frame;
    CGFloat scaleWidth = scrollViewFrame.size.width / self.scrollView.contentSize.width;
    CGFloat scaleHeight = scrollViewFrame.size.height / self.scrollView.contentSize.height;
    Why isn't scrollviewframe.size.width written self.scrollview.scrollviewframe.size.width?

    Source:
    Code:
    http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content
     
  2. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    Not looking at the site, I know ray wenderlich, but think to your self.
    When is self. used? is it a property? or is it an ivar?
     
  3. nashyo thread starter macrumors 6502

    nashyo

    Joined:
    Oct 1, 2010
    Location:
    Bristol
  4. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium

Share This Page