Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce consectetur risus sed tristique facilisis. Vestibulum ultricies felis sed pulvinar mattis. In hac habitasse platea dictumst. Curabitur pharetra sed mauris sed tempor.

Plugin Overview

The AXStretchableHeaderTabViewController is a plugin that enhances the functionality of a standard tabbed view controller by adding a stretchable header.


  • Stretchable header that adjusts its height as you scroll
  • Supports different content types for the header view (image, text, custom view)
  • Customizable appearance settings for the header and tab bar
  • Smooth animations for scrolling and switching tabs
  • Supports both landscape and portrait orientations


  • iOS 10.0 or later
  • Xcode 11.0 or later
  • Swift 5.0


To install the AXStretchableHeaderTabViewController plugin, follow these steps:

  1. Open your Xcode project
  2. Navigate to File -> Swift Packages -> Add Package Dependency
  3. In the search bar, enter “AXStretchableHeaderTabViewController”
  4. Select the plugin from the search results
  5. Choose the version you want to install
  6. Click Next and follow the instructions to complete the installation


To use the AXStretchableHeaderTabViewController plugin in your project, follow these steps:

  1. Import the plugin module into your view controller file:
  2. // Swift
      import AXStretchableHeaderTabViewController
      // Objective-C
      @import AXStretchableHeaderTabViewController;
  3. Create an instance of AXStretchableHeaderTabViewController:
  4. // Swift
      let stretchableHeaderTabVC = AXStretchableHeaderTabViewController()
      // Objective-C
      AXStretchableHeaderTabViewController *stretchableHeaderTabVC = [[AXStretchableHeaderTabViewController alloc] init];
  5. Set the view controllers for each tab:
  6. // Swift
      let viewController1 = UIViewController()
      let viewController2 = UIViewController()
      stretchableHeaderTabVC.viewControllers = [viewController1, viewController2]
      // Objective-C
      UIViewController *viewController1 = [[UIViewController alloc] init];
      UIViewController *viewController2 = [[UIViewController alloc] init];
      stretchableHeaderTabVC.viewControllers = @[viewController1, viewController2];
  7. Customize the appearance settings as desired:
  8. // Swift
      stretchableHeaderTabVC.headerHeight = 200
      stretchableHeaderTabVC.headerViewContentMode = .scaleAspectFill
      stretchableHeaderTabVC.tabBarBackgroundColor =
      // Objective-C
      stretchableHeaderTabVC.headerHeight = 200;
      stretchableHeaderTabVC.headerViewContentMode = AXHeaderViewContentModeScaleAspectFill;
      stretchableHeaderTabVC.tabBarBackgroundColor = [UIColor redColor];
  9. Present the stretchable header tab view controller:
  10. // Swift
      present(stretchableHeaderTabVC, animated: true, completion: nil)
      // Objective-C
      [self presentViewController:stretchableHeaderTabVC animated:YES completion:nil];


The AXStretchableHeaderTabViewController plugin provides various customization options:

  • Header height: You can adjust the height of the stretchable header to fit your needs. The default height is 200 pixels.
  • Header view content mode: You can choose how the header view should be displayed within its frame. Available options include scale to fill, aspect fit, aspect fill, etc.
  • Tab bar background color: You can customize the background color of the tab bar to match your app’s design.
  • Font and color: You can change the font and color of the tab bar’s title text.

Frequently Asked Questions

Q: Can I use a custom view for the stretchable header?

A: Yes, you can set any custom view as the header view by assigning it to the headerView property of the stretchableHeaderTabVC instance.

Q: How can I respond to tab switching events?

A: You can implement the AXStretchableHeaderTabViewControllerDelegate protocol and set the delegate of the stretchableHeaderTabVC instance to receive tab switching events. The didSwitchToViewController(_:) method will be called when the user switches between tabs.

Q: Can I add more tabs dynamically at runtime?

A: Yes, you can add or remove tabs dynamically by modifying the viewControllers array of the stretchableHeaderTabVC instance.


The AXStretchableHeaderTabViewController plugin simplifies the process of adding a stretchable header to your tabbed view controller. It provides customizable options for the header and tab bar appearance, smooth animations, and support for different content types. Start enhancing your tabbed interface with a stretchable header today!