diff --git a/README.md b/README.md index d44f848..3d4d3f5 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,34 @@ self.shyNavBarManager.scrollView = self.scrollView; **IMPORTANT!!** If you are assigning a delegate to your scrollView, do that **before** assigning the scrollView to the `TLYShyNavBarManager`! To learn more, [see below](#how-it-works). +### Using TLYShyNavBar in Swift +If you are building apps in Swift and targeting apps to iOS7 Apples [hidesBarsOnSwipe](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationController_Class/#//apple_ref/occ/instp/UINavigationController/hidesBarsOnSwipe) will not work because it is in an iOS 8 feature. As an alternative you can use TLYShyNavBar component in lieu of Apples feature. + +To use this component in Swift + +1. Clone this git repository locally: `git clone https://github.com/telly/TLYShyNavBar.git` +2. Copy the `TLYShyNavBar` directory into your Swift project.
![](resources/Swift-project.png) +3. Create a new header file called `Bridging-Header.h` and add the heades from `TLYShyNavBar` [see headers below](#bridge-headers). +4. Add the bridging header file to the project's build settings. Search `Bridging Header` in `Build Settings` and add `Bridging-Header.h`.
![](resources/Bridged-Header.png) +5. Add **#import <UIKit/UIKit.h>** to `TLYShyNavBarManager.h` and `TLYShyViewController.h` + +Now your project is setup to use the TLYShyNavBar component. Next all you need to do is set the scrollview property in your UIViewController like it was an Objective-c project. + +``` +/* In your UIViewController viewDidLoad or after creating the scroll view. */ +self.shyNavBarManager.scrollView = self.scrollView; +``` + +#### Bridge Headers +``` +#import "TLYShyNavBarManager.h" +#import "TLYShyViewController.h" +#import "TLYDelegateProxy.h" +#import "NSObject+TLYSwizzlingHelpers.h" +#import "UIViewController+BetterLayoutGuides.h" +``` + + ## Design Goals + **Ease of Use**: This is the most important, and should never be compromised. Even if compatability breaks or versatility is limited, the component should remain easy to integrate. diff --git a/resources/Bridged-Header.png b/resources/Bridged-Header.png new file mode 100644 index 0000000..dc37019 Binary files /dev/null and b/resources/Bridged-Header.png differ diff --git a/resources/Swift-project.png b/resources/Swift-project.png new file mode 100644 index 0000000..2a89aed Binary files /dev/null and b/resources/Swift-project.png differ