diff --git a/Demo/Podfile b/Demo/Podfile index df63bf82..84ecdd6d 100644 --- a/Demo/Podfile +++ b/Demo/Podfile @@ -2,6 +2,7 @@ use_frameworks! target 'ScrollingNavbarDemo' do pod 'AMScrollingNavbar', path: '../' + pod 'Reveal-iOS-SDK', :configurations => ['Debug'] end target 'ScrollingNavbarDemoTests' do diff --git a/Demo/Podfile.lock b/Demo/Podfile.lock index 9f137922..8016e416 100644 --- a/Demo/Podfile.lock +++ b/Demo/Podfile.lock @@ -7,12 +7,14 @@ PODS: - Nimble (~> 2.0.0-rc.2) - Quick (~> 0.5) - Quick (0.7.0) + - Reveal-iOS-SDK (1.6.1) DEPENDENCIES: - AMScrollingNavbar (from `../`) - Nimble (from `https://github.com/Quick/Nimble.git`, branch `xcode7.1`) - Nimble-Snapshots - Quick (from `https://github.com/andreamazz/Quick.git`, branch `xcode7.1`) + - Reveal-iOS-SDK EXTERNAL SOURCES: AMScrollingNavbar: @@ -38,5 +40,6 @@ SPEC CHECKSUMS: Nimble: 1b4a306f27b2355c8c789087e092decb1a226238 Nimble-Snapshots: c16dd279a4840ec06288198fafd53f3c17750ff3 Quick: c99021edb599f0aae3319455778ce36d00be140b + Reveal-iOS-SDK: ceae964076cebe3efe63e5e9abe3152efce46aa8 COCOAPODS: 0.39.0 diff --git a/Demo/ScrollingNavbarDemo.xcodeproj/project.pbxproj b/Demo/ScrollingNavbarDemo.xcodeproj/project.pbxproj index cce013d1..f3860338 100644 --- a/Demo/ScrollingNavbarDemo.xcodeproj/project.pbxproj +++ b/Demo/ScrollingNavbarDemo.xcodeproj/project.pbxproj @@ -498,6 +498,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "it.fancypixel.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; @@ -510,6 +511,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "it.fancypixel.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; diff --git a/Demo/ScrollingNavbarDemo/Base.lproj/Main.storyboard b/Demo/ScrollingNavbarDemo/Base.lproj/Main.storyboard index 2cea9aa7..1382c11e 100644 --- a/Demo/ScrollingNavbarDemo/Base.lproj/Main.storyboard +++ b/Demo/ScrollingNavbarDemo/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -15,11 +15,11 @@ - + - + @@ -41,7 +41,7 @@ - + @@ -60,14 +60,14 @@ - + - + @@ -75,14 +75,14 @@ - + - + - + - + - + - + - + - + - + @@ -173,7 +173,7 @@ - + @@ -184,24 +184,24 @@ - + - + - + - + @@ -248,11 +248,11 @@ - + - + @@ -276,7 +276,7 @@ - + diff --git a/Demo/ScrollingNavbarDemo/Info.plist b/Demo/ScrollingNavbarDemo/Info.plist index a5eda5e7..68032acf 100644 --- a/Demo/ScrollingNavbarDemo/Info.plist +++ b/Demo/ScrollingNavbarDemo/Info.plist @@ -42,5 +42,9 @@ UIViewControllerBasedStatusBarAppearance + NSAppTransportSecurity + + NSAllowsArbitraryLoads + diff --git a/Demo/ScrollingNavbarDemo/ViewControllers/ScrollViewController.swift b/Demo/ScrollingNavbarDemo/ViewControllers/ScrollViewController.swift index b6d94696..cea09ecb 100644 --- a/Demo/ScrollingNavbarDemo/ViewControllers/ScrollViewController.swift +++ b/Demo/ScrollingNavbarDemo/ViewControllers/ScrollViewController.swift @@ -31,7 +31,7 @@ class ScrollViewController: ScrollingNavigationViewController, ScrollingNavigati scrollView.addSubview(label) // Fake some content - label.text = lyrics[Int(arc4random()) % lyrics.count] + label.text = lyrics.first label.numberOfLines = 0 label.textColor = .whiteColor() label.sizeToFit() diff --git a/Demo/ScrollingNavbarDemo/ViewControllers/WebViewController.swift b/Demo/ScrollingNavbarDemo/ViewControllers/WebViewController.swift index f25c6d88..62dfc1cc 100644 --- a/Demo/ScrollingNavbarDemo/ViewControllers/WebViewController.swift +++ b/Demo/ScrollingNavbarDemo/ViewControllers/WebViewController.swift @@ -23,7 +23,7 @@ class WebViewController: ScrollingNavigationViewController, UIWebViewDelegate { navigationController?.navigationBar.barTintColor = UIColor(red:0.2, green:0.28, blue:0.37, alpha:1) // Load some content - webView.loadHTMLString("

There's an old joke - um... two elderly women are at a Catskill mountain resort, and one of 'em says:

'Boy, the food at this place is really terrible.'

The other one says:

'Yeah, I know; and such small portions.'

Well, that's essentially how I feel about life - full of loneliness, and misery, and suffering, and unhappiness, and it's all over much too quickly.

The... the other important joke, for me, is one that's usually attributed to Groucho Marx, but I think it appears originally in Freud's 'Wit and Its Relation to the Unconscious,' and it goes like this - I'm paraphrasing

'I would never want to belong to any club that would have someone like me for a member.'

That's the key joke of my adult life, in terms of my relationships with women.

Woody Allen", baseURL: nil) + webView.loadHTMLString("

There's an old joke - um... two elderly women are at a Catskill mountain resort, and one of 'em says:

'Boy, the food at this place is really terrible.'

The other one says:

'Yeah, I know; and such small portions.'

Well, that's essentially how I feel about life - full of loneliness, and misery, and suffering, and unhappiness, and it's all over much too quickly.

The... the other important joke, for me, is one that's usually attributed to Groucho Marx, but I think it appears originally in Freud's 'Wit and Its Relation to the Unconscious,' and it goes like this - I'm paraphrasing

'I would never want to belong to any club that would have someone like me for a member.'

That's the key joke of my adult life, in terms of my relationships with women.

Woody Allen", baseURL: nil) // Enable the scrollToTop webView.scrollView.delegate = self diff --git a/Source/ScrollingNavigationController.swift b/Source/ScrollingNavigationController.swift index 68d94011..904f2060 100644 --- a/Source/ScrollingNavigationController.swift +++ b/Source/ScrollingNavigationController.swift @@ -188,6 +188,11 @@ public class ScrollingNavigationController: UINavigationController, UIGestureRec showNavbar() } + public override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) { + super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator) + showNavbar() + } + // MARK: - Notification handler func didBecomeActive(notification: NSNotification) { @@ -248,7 +253,7 @@ public class ScrollingNavigationController: UINavigationController, UIGestureRec delayDistance += delta // Skip if the delay is not over yet - if delayDistance > 0 && self.maxDelay < contentOffset().y { + if delayDistance > 0 && maxDelay < contentOffset().y { return } @@ -280,7 +285,7 @@ public class ScrollingNavigationController: UINavigationController, UIGestureRec // Move the navigation bar frame.origin = CGPoint(x: frame.origin.x, y: frame.origin.y - delta) navigationBar.frame = frame - + // Resize the view if the navigation bar is not translucent if !navigationBar.translucent { let navBarY = navigationBar.frame.origin.y + navigationBar.frame.size.height