title: ios swizzle better understanding
body: <p>I have a UIViewController with this code:</p>
  
  <pre><code>- (void)viewDidAppear:(BOOL)animated
  {
      [super viewDidAppear:animated];
      NSLog(@"CLASIC");
  }
  </code></pre>
  
  <p>And then I have a framework with a UIViewController category that does swizzling in this manner:</p>
  
  <pre><code>+ (void)load {
      static dispatch_once_t onceToken;
      dispatch_once(&amp;onceToken, ^{
  
          SEL viewWillAppearSelector = @selector(viewDidAppear:);
          SEL viewWillAppearLoggerSelector = @selector(logged_viewDidAppear:);
          Method originalMethod = class_getInstanceMethod(self, viewWillAppearSelector);
          Method extendedMethod = class_getInstanceMethod(self, viewWillAppearLoggerSelector);
          method_exchangeImplementations(originalMethod, extendedMethod);
  
      });
  }
  
  - (void)logged_viewDidAppear:(BOOL)animated
  {
      [self logged_viewDidAppear:animated];
  
      NSLog(@"SWIZZLED");
  }
  </code></pre>
  
  <p>The output is SWIZZLED and then CLASIC.</p>
  
  <p>Now my question is: if in my viewcontroller I comment the [super viewDidAppear:animated]; then the swizzled method does not get called anymore; why is that? I understood most of the aspects but it seems this one somehow slipped.</p>
  
  <pre><code>- (void)viewDidAppear:(BOOL)animated
  {
      // we comment this and this will trigger the swizzled method not being called anymore
      //[super viewDidAppear:animated];
      NSLog(@"CLASIC");
  }
  
  // ========================
  
  + (void)load {
      static dispatch_once_t onceToken;
      dispatch_once(&amp;onceToken, ^{
  
          SEL viewWillAppearSelector = @selector(viewDidAppear:);
          SEL viewWillAppearLoggerSelector = @selector(logged_viewDidAppear:);
          Method originalMethod = class_getInstanceMethod(self, viewWillAppearSelector);
          Method extendedMethod = class_getInstanceMethod(self, viewWillAppearLoggerSelector);
          method_exchangeImplementations(originalMethod, extendedMethod);
  
      });
  }
  
  - (void)logged_viewDidAppear:(BOOL)animated
  {
      [self logged_viewDidAppear:animated];
  
      NSLog(@"SWIZZLED");
  }
  </code></pre>