├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── Test.yml ├── .gitignore ├── .hound.yml ├── .swiftlint.yml ├── AMScrollingNavbar.podspec ├── AMScrollingNavbar.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── AMScrollingNavbar.xcscheme ├── AMScrollingNavbar ├── AMScrollingNavbar.h └── Info.plist ├── CHANGELOG.md ├── Demo ├── Podfile ├── Podfile.lock ├── Pods │ ├── AMScrollingNavbar │ │ ├── LICENSE │ │ ├── README.md │ │ └── Source │ │ │ ├── ScrollingNavbar+Sizes.swift │ │ │ ├── ScrollingNavigationController.swift │ │ │ └── ScrollingNavigationViewController.swift │ ├── Local Podspecs │ │ └── AMScrollingNavbar.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ └── Target Support Files │ │ ├── AMScrollingNavbar │ │ ├── AMScrollingNavbar-dummy.m │ │ ├── AMScrollingNavbar-prefix.pch │ │ ├── AMScrollingNavbar-umbrella.h │ │ ├── AMScrollingNavbar.modulemap │ │ ├── AMScrollingNavbar.xcconfig │ │ └── Info.plist │ │ ├── Pods-ScrollingNavbarDemo │ │ ├── Info.plist │ │ ├── Pods-ScrollingNavbarDemo-acknowledgements.markdown │ │ ├── Pods-ScrollingNavbarDemo-acknowledgements.plist │ │ ├── Pods-ScrollingNavbarDemo-dummy.m │ │ ├── Pods-ScrollingNavbarDemo-frameworks.sh │ │ ├── Pods-ScrollingNavbarDemo-resources.sh │ │ ├── Pods-ScrollingNavbarDemo-umbrella.h │ │ ├── Pods-ScrollingNavbarDemo.debug.xcconfig │ │ ├── Pods-ScrollingNavbarDemo.modulemap │ │ └── Pods-ScrollingNavbarDemo.release.xcconfig │ │ └── Pods-ScrollingNavbarDemoTests │ │ ├── Info.plist │ │ ├── Pods-ScrollingNavbarDemoTests-acknowledgements.markdown │ │ ├── Pods-ScrollingNavbarDemoTests-acknowledgements.plist │ │ ├── Pods-ScrollingNavbarDemoTests-dummy.m │ │ ├── Pods-ScrollingNavbarDemoTests-frameworks.sh │ │ ├── Pods-ScrollingNavbarDemoTests-resources.sh │ │ ├── Pods-ScrollingNavbarDemoTests-umbrella.h │ │ ├── Pods-ScrollingNavbarDemoTests.debug.xcconfig │ │ ├── Pods-ScrollingNavbarDemoTests.modulemap │ │ └── Pods-ScrollingNavbarDemoTests.release.xcconfig ├── ScrollingNavbarDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── ScrollingNavbarDemo.xcscheme ├── ScrollingNavbarDemo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── ScrollingNavbarDemo │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── CollectionViewCell.swift │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── AMScrollingNavbar-120.png │ │ │ ├── AMScrollingNavbar-121.png │ │ │ ├── AMScrollingNavbar-152.png │ │ │ ├── AMScrollingNavbar-167.png │ │ │ ├── AMScrollingNavbar-180.png │ │ │ ├── AMScrollingNavbar-20.png │ │ │ ├── AMScrollingNavbar-29.png │ │ │ ├── AMScrollingNavbar-40.png │ │ │ ├── AMScrollingNavbar-41.png │ │ │ ├── AMScrollingNavbar-42.png │ │ │ ├── AMScrollingNavbar-58.png │ │ │ ├── AMScrollingNavbar-59.png │ │ │ ├── AMScrollingNavbar-60.png │ │ │ ├── AMScrollingNavbar-76.png │ │ │ ├── AMScrollingNavbar-80.png │ │ │ ├── AMScrollingNavbar-81.png │ │ │ ├── AMScrollingNavbar-87.png │ │ │ └── Contents.json │ │ └── logo.imageset │ │ │ ├── Contents.json │ │ │ └── logo.pdf │ ├── Info.plist │ ├── ViewController.swift │ ├── ViewControllers │ │ ├── CollectionViewController.swift │ │ ├── LargeTitleViewController.swift │ │ ├── ScrollViewController.swift │ │ ├── TableViewController.swift │ │ ├── TestViewController.swift │ │ └── WebViewController.swift │ └── index.html └── ScrollingNavbarDemoTests │ ├── Info.plist │ ├── ReferenceImages │ └── ScrollingNavbarDemoTests │ │ ├── hideNavbar__should_hide_the_navigation_bar@2x.png │ │ ├── hideNavbar__should_hide_the_navigation_bar@3x.png │ │ ├── showNavbar__should_show_the_navigation_bar@2x.png │ │ └── showNavbar__should_show_the_navigation_bar@3x.png │ └── ScrollingNavbarDemoTests.swift ├── LICENSE ├── Package.swift ├── README.md ├── Source ├── ScrollingNavbar+Sizes.swift ├── ScrollingNavigationController.swift └── ScrollingNavigationViewController.swift └── assets ├── demo-button.png ├── logo.png └── screenshot.gif /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: andreamazz 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. Do this 13 | 2. Do that 14 | 3. Observe error 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Screenshots** 20 | If applicable, add screenshots to help explain your problem. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.github/workflows/Test.yml: -------------------------------------------------------------------------------- 1 | name: Test suite 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: macos-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v1 16 | - name: Select Xcode 11 17 | run: sudo xcode-select -switch /Applications/Xcode_11.6.app 18 | - name: Run tests 19 | run: xcodebuild -workspace Demo/ScrollingNavbarDemo.xcworkspace -scheme ScrollingNavbarDemo -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8,OS=13.6' test 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | *.xcscmblueprint 20 | 21 | # Carthage 22 | Carthage/Build 23 | -------------------------------------------------------------------------------- /.hound.yml: -------------------------------------------------------------------------------- 1 | swift: 2 | config_file: .swiftlint.yml 3 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - line_length 3 | included: 4 | excluded: 5 | - Carthage 6 | - Pods 7 | -------------------------------------------------------------------------------- /AMScrollingNavbar.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "AMScrollingNavbar" 3 | s.version = "5.7.3" 4 | s.summary = "A custom UINavigationController that enables the scrolling of the navigation bar alongside the scrolling of an observed content view" 5 | s.description = <<-DESC 6 | A custom UINavigationController that enables the scrolling of the 7 | navigation bar alongisde the scrolling of the observed view's content. 8 | DESC 9 | s.homepage = "https://github.com/andreamazz/AMScrollingNavbar" 10 | s.license = { :type => 'MIT', :file => 'LICENSE' } 11 | s.author = { "Andrea Mazzini" => "andrea.mazzini@gmail.com" } 12 | s.source = { :git => "https://github.com/andreamazz/AMScrollingNavbar.git", :tag => s.version } 13 | s.platform = :ios, '8.0' 14 | s.source_files = 'Source/*.swift' 15 | s.requires_arc = true 16 | s.swift_version = '5.0' 17 | s.social_media_url = 'https://twitter.com/theandreamazz' 18 | end 19 | -------------------------------------------------------------------------------- /AMScrollingNavbar.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 656662181B84EE6A004C5D31 /* ScrollingNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 656662171B84EE6A004C5D31 /* ScrollingNavigationController.swift */; }; 11 | 658FA18B1B83943000EB32A4 /* AMScrollingNavbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 658FA18A1B83943000EB32A4 /* AMScrollingNavbar.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 658FA1A51B83951E00EB32A4 /* ScrollingNavbar+Sizes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658FA1A21B83951E00EB32A4 /* ScrollingNavbar+Sizes.swift */; }; 13 | 658FA1A71B83951E00EB32A4 /* ScrollingNavigationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658FA1A41B83951E00EB32A4 /* ScrollingNavigationViewController.swift */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | 656662171B84EE6A004C5D31 /* ScrollingNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = ScrollingNavigationController.swift; sourceTree = ""; tabWidth = 2; }; 18 | 658FA1851B83943000EB32A4 /* AMScrollingNavbar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AMScrollingNavbar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 19 | 658FA1891B83943000EB32A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 20 | 658FA18A1B83943000EB32A4 /* AMScrollingNavbar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AMScrollingNavbar.h; sourceTree = ""; }; 21 | 658FA1A21B83951E00EB32A4 /* ScrollingNavbar+Sizes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ScrollingNavbar+Sizes.swift"; sourceTree = ""; }; 22 | 658FA1A41B83951E00EB32A4 /* ScrollingNavigationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScrollingNavigationViewController.swift; sourceTree = ""; }; 23 | /* End PBXFileReference section */ 24 | 25 | /* Begin PBXFrameworksBuildPhase section */ 26 | 658FA1811B83943000EB32A4 /* Frameworks */ = { 27 | isa = PBXFrameworksBuildPhase; 28 | buildActionMask = 2147483647; 29 | files = ( 30 | ); 31 | runOnlyForDeploymentPostprocessing = 0; 32 | }; 33 | /* End PBXFrameworksBuildPhase section */ 34 | 35 | /* Begin PBXGroup section */ 36 | 658FA17B1B83943000EB32A4 = { 37 | isa = PBXGroup; 38 | children = ( 39 | 658FA1871B83943000EB32A4 /* AMScrollingNavbar */, 40 | 658FA1861B83943000EB32A4 /* Products */, 41 | ); 42 | indentWidth = 2; 43 | sourceTree = ""; 44 | tabWidth = 2; 45 | }; 46 | 658FA1861B83943000EB32A4 /* Products */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 658FA1851B83943000EB32A4 /* AMScrollingNavbar.framework */, 50 | ); 51 | name = Products; 52 | sourceTree = ""; 53 | }; 54 | 658FA1871B83943000EB32A4 /* AMScrollingNavbar */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 658FA18A1B83943000EB32A4 /* AMScrollingNavbar.h */, 58 | 658FA1A11B83951E00EB32A4 /* Source */, 59 | 658FA1881B83943000EB32A4 /* Supporting Files */, 60 | ); 61 | path = AMScrollingNavbar; 62 | sourceTree = ""; 63 | }; 64 | 658FA1881B83943000EB32A4 /* Supporting Files */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 658FA1891B83943000EB32A4 /* Info.plist */, 68 | ); 69 | name = "Supporting Files"; 70 | sourceTree = ""; 71 | }; 72 | 658FA1A11B83951E00EB32A4 /* Source */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 656662171B84EE6A004C5D31 /* ScrollingNavigationController.swift */, 76 | 658FA1A21B83951E00EB32A4 /* ScrollingNavbar+Sizes.swift */, 77 | 658FA1A41B83951E00EB32A4 /* ScrollingNavigationViewController.swift */, 78 | ); 79 | path = Source; 80 | sourceTree = SOURCE_ROOT; 81 | }; 82 | /* End PBXGroup section */ 83 | 84 | /* Begin PBXHeadersBuildPhase section */ 85 | 658FA1821B83943000EB32A4 /* Headers */ = { 86 | isa = PBXHeadersBuildPhase; 87 | buildActionMask = 2147483647; 88 | files = ( 89 | 658FA18B1B83943000EB32A4 /* AMScrollingNavbar.h in Headers */, 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | /* End PBXHeadersBuildPhase section */ 94 | 95 | /* Begin PBXNativeTarget section */ 96 | 658FA1841B83943000EB32A4 /* AMScrollingNavbar */ = { 97 | isa = PBXNativeTarget; 98 | buildConfigurationList = 658FA19B1B83943000EB32A4 /* Build configuration list for PBXNativeTarget "AMScrollingNavbar" */; 99 | buildPhases = ( 100 | 658FA1801B83943000EB32A4 /* Sources */, 101 | 658FA1811B83943000EB32A4 /* Frameworks */, 102 | 658FA1821B83943000EB32A4 /* Headers */, 103 | 658FA1831B83943000EB32A4 /* Resources */, 104 | ); 105 | buildRules = ( 106 | ); 107 | dependencies = ( 108 | ); 109 | name = AMScrollingNavbar; 110 | productName = AMScrollingNavbar; 111 | productReference = 658FA1851B83943000EB32A4 /* AMScrollingNavbar.framework */; 112 | productType = "com.apple.product-type.framework"; 113 | }; 114 | /* End PBXNativeTarget section */ 115 | 116 | /* Begin PBXProject section */ 117 | 658FA17C1B83943000EB32A4 /* Project object */ = { 118 | isa = PBXProject; 119 | attributes = { 120 | LastSwiftUpdateCheck = 0700; 121 | LastUpgradeCheck = 1000; 122 | ORGANIZATIONNAME = "Fancy Pixel"; 123 | TargetAttributes = { 124 | 658FA1841B83943000EB32A4 = { 125 | CreatedOnToolsVersion = 6.4; 126 | LastSwiftMigration = 1000; 127 | }; 128 | }; 129 | }; 130 | buildConfigurationList = 658FA17F1B83943000EB32A4 /* Build configuration list for PBXProject "AMScrollingNavbar" */; 131 | compatibilityVersion = "Xcode 3.2"; 132 | developmentRegion = English; 133 | hasScannedForEncodings = 0; 134 | knownRegions = ( 135 | en, 136 | ); 137 | mainGroup = 658FA17B1B83943000EB32A4; 138 | productRefGroup = 658FA1861B83943000EB32A4 /* Products */; 139 | projectDirPath = ""; 140 | projectRoot = ""; 141 | targets = ( 142 | 658FA1841B83943000EB32A4 /* AMScrollingNavbar */, 143 | ); 144 | }; 145 | /* End PBXProject section */ 146 | 147 | /* Begin PBXResourcesBuildPhase section */ 148 | 658FA1831B83943000EB32A4 /* Resources */ = { 149 | isa = PBXResourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | /* End PBXResourcesBuildPhase section */ 156 | 157 | /* Begin PBXSourcesBuildPhase section */ 158 | 658FA1801B83943000EB32A4 /* Sources */ = { 159 | isa = PBXSourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 658FA1A51B83951E00EB32A4 /* ScrollingNavbar+Sizes.swift in Sources */, 163 | 656662181B84EE6A004C5D31 /* ScrollingNavigationController.swift in Sources */, 164 | 658FA1A71B83951E00EB32A4 /* ScrollingNavigationViewController.swift in Sources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXSourcesBuildPhase section */ 169 | 170 | /* Begin XCBuildConfiguration section */ 171 | 658FA1991B83943000EB32A4 /* Debug */ = { 172 | isa = XCBuildConfiguration; 173 | buildSettings = { 174 | ALWAYS_SEARCH_USER_PATHS = NO; 175 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 176 | CLANG_CXX_LIBRARY = "libc++"; 177 | CLANG_ENABLE_MODULES = YES; 178 | CLANG_ENABLE_OBJC_ARC = YES; 179 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 180 | CLANG_WARN_BOOL_CONVERSION = YES; 181 | CLANG_WARN_COMMA = YES; 182 | CLANG_WARN_CONSTANT_CONVERSION = YES; 183 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 184 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 185 | CLANG_WARN_EMPTY_BODY = YES; 186 | CLANG_WARN_ENUM_CONVERSION = YES; 187 | CLANG_WARN_INFINITE_RECURSION = YES; 188 | CLANG_WARN_INT_CONVERSION = YES; 189 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 190 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 191 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 192 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 193 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 194 | CLANG_WARN_STRICT_PROTOTYPES = YES; 195 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 196 | CLANG_WARN_UNREACHABLE_CODE = YES; 197 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 198 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 199 | COPY_PHASE_STRIP = NO; 200 | CURRENT_PROJECT_VERSION = 1; 201 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 202 | ENABLE_STRICT_OBJC_MSGSEND = YES; 203 | ENABLE_TESTABILITY = YES; 204 | GCC_C_LANGUAGE_STANDARD = gnu99; 205 | GCC_DYNAMIC_NO_PIC = NO; 206 | GCC_NO_COMMON_BLOCKS = YES; 207 | GCC_OPTIMIZATION_LEVEL = 0; 208 | GCC_PREPROCESSOR_DEFINITIONS = ( 209 | "DEBUG=1", 210 | "$(inherited)", 211 | ); 212 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 213 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 214 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 215 | GCC_WARN_UNDECLARED_SELECTOR = YES; 216 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 217 | GCC_WARN_UNUSED_FUNCTION = YES; 218 | GCC_WARN_UNUSED_VARIABLE = YES; 219 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 220 | MTL_ENABLE_DEBUG_INFO = YES; 221 | ONLY_ACTIVE_ARCH = YES; 222 | SDKROOT = iphoneos; 223 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 224 | SWIFT_VERSION = 4.2; 225 | TARGETED_DEVICE_FAMILY = "1,2"; 226 | VERSIONING_SYSTEM = "apple-generic"; 227 | VERSION_INFO_PREFIX = ""; 228 | }; 229 | name = Debug; 230 | }; 231 | 658FA19A1B83943000EB32A4 /* Release */ = { 232 | isa = XCBuildConfiguration; 233 | buildSettings = { 234 | ALWAYS_SEARCH_USER_PATHS = NO; 235 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 236 | CLANG_CXX_LIBRARY = "libc++"; 237 | CLANG_ENABLE_MODULES = YES; 238 | CLANG_ENABLE_OBJC_ARC = YES; 239 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 240 | CLANG_WARN_BOOL_CONVERSION = YES; 241 | CLANG_WARN_COMMA = YES; 242 | CLANG_WARN_CONSTANT_CONVERSION = YES; 243 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 244 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 245 | CLANG_WARN_EMPTY_BODY = YES; 246 | CLANG_WARN_ENUM_CONVERSION = YES; 247 | CLANG_WARN_INFINITE_RECURSION = YES; 248 | CLANG_WARN_INT_CONVERSION = YES; 249 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 250 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 251 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 252 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 253 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 254 | CLANG_WARN_STRICT_PROTOTYPES = YES; 255 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 256 | CLANG_WARN_UNREACHABLE_CODE = YES; 257 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 258 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 259 | COPY_PHASE_STRIP = NO; 260 | CURRENT_PROJECT_VERSION = 1; 261 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 262 | ENABLE_NS_ASSERTIONS = NO; 263 | ENABLE_STRICT_OBJC_MSGSEND = YES; 264 | GCC_C_LANGUAGE_STANDARD = gnu99; 265 | GCC_NO_COMMON_BLOCKS = YES; 266 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 267 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 268 | GCC_WARN_UNDECLARED_SELECTOR = YES; 269 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 270 | GCC_WARN_UNUSED_FUNCTION = YES; 271 | GCC_WARN_UNUSED_VARIABLE = YES; 272 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 273 | MTL_ENABLE_DEBUG_INFO = NO; 274 | SDKROOT = iphoneos; 275 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 276 | SWIFT_VERSION = 4.2; 277 | TARGETED_DEVICE_FAMILY = "1,2"; 278 | VALIDATE_PRODUCT = YES; 279 | VERSIONING_SYSTEM = "apple-generic"; 280 | VERSION_INFO_PREFIX = ""; 281 | }; 282 | name = Release; 283 | }; 284 | 658FA19C1B83943000EB32A4 /* Debug */ = { 285 | isa = XCBuildConfiguration; 286 | buildSettings = { 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 288 | DEFINES_MODULE = YES; 289 | DYLIB_COMPATIBILITY_VERSION = 1; 290 | DYLIB_CURRENT_VERSION = 1; 291 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 292 | INFOPLIST_FILE = AMScrollingNavbar/Info.plist; 293 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 294 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 295 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 296 | PRODUCT_BUNDLE_IDENTIFIER = "it.fancypixel.$(PRODUCT_NAME:rfc1034identifier)"; 297 | PRODUCT_NAME = "$(TARGET_NAME)"; 298 | SKIP_INSTALL = YES; 299 | SWIFT_VERSION = 4.2; 300 | }; 301 | name = Debug; 302 | }; 303 | 658FA19D1B83943000EB32A4 /* Release */ = { 304 | isa = XCBuildConfiguration; 305 | buildSettings = { 306 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 307 | DEFINES_MODULE = YES; 308 | DYLIB_COMPATIBILITY_VERSION = 1; 309 | DYLIB_CURRENT_VERSION = 1; 310 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 311 | INFOPLIST_FILE = AMScrollingNavbar/Info.plist; 312 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 313 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 314 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 315 | PRODUCT_BUNDLE_IDENTIFIER = "it.fancypixel.$(PRODUCT_NAME:rfc1034identifier)"; 316 | PRODUCT_NAME = "$(TARGET_NAME)"; 317 | SKIP_INSTALL = YES; 318 | SWIFT_VERSION = 4.2; 319 | }; 320 | name = Release; 321 | }; 322 | /* End XCBuildConfiguration section */ 323 | 324 | /* Begin XCConfigurationList section */ 325 | 658FA17F1B83943000EB32A4 /* Build configuration list for PBXProject "AMScrollingNavbar" */ = { 326 | isa = XCConfigurationList; 327 | buildConfigurations = ( 328 | 658FA1991B83943000EB32A4 /* Debug */, 329 | 658FA19A1B83943000EB32A4 /* Release */, 330 | ); 331 | defaultConfigurationIsVisible = 0; 332 | defaultConfigurationName = Release; 333 | }; 334 | 658FA19B1B83943000EB32A4 /* Build configuration list for PBXNativeTarget "AMScrollingNavbar" */ = { 335 | isa = XCConfigurationList; 336 | buildConfigurations = ( 337 | 658FA19C1B83943000EB32A4 /* Debug */, 338 | 658FA19D1B83943000EB32A4 /* Release */, 339 | ); 340 | defaultConfigurationIsVisible = 0; 341 | defaultConfigurationName = Release; 342 | }; 343 | /* End XCConfigurationList section */ 344 | }; 345 | rootObject = 658FA17C1B83943000EB32A4 /* Project object */; 346 | } 347 | -------------------------------------------------------------------------------- /AMScrollingNavbar.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AMScrollingNavbar.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AMScrollingNavbar.xcodeproj/xcshareddata/xcschemes/AMScrollingNavbar.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 79 | 85 | 86 | 87 | 88 | 89 | 90 | 96 | 97 | 103 | 104 | 105 | 106 | 108 | 109 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /AMScrollingNavbar/AMScrollingNavbar.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMScrollingNavbar.h 3 | // AMScrollingNavbar 4 | // 5 | // Created by Andrea Mazzini on 18/08/15. 6 | // Copyright (c) 2015 Fancy Pixel. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for AMScrollingNavbar. 12 | FOUNDATION_EXPORT double AMScrollingNavbarVersionNumber; 13 | 14 | //! Project version string for AMScrollingNavbar. 15 | FOUNDATION_EXPORT const unsigned char AMScrollingNavbarVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /AMScrollingNavbar/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.3.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | `AMScrollingNavbar` adheres to [Semantic Versioning](http://semver.org/). 4 | 5 | - `5.7.x` Releases - [5.7.0](#570) | [5.7.1](#571) | [5.7.2](#572) | [5.7.3](#573) 6 | - `5.6.x` Releases - [5.6.0](#560) | [5.6.1](#561) 7 | - `5.5.x` Releases - [5.5.0](#550) | [5.5.1](#551) | [5.5.2](#552) 8 | - `5.4.x` Releases - [5.4.0](#540) | [5.4.1](#541) 9 | - `5.3.x` Releases - [5.3.0](#530) 10 | - `5.2.x` Releases - [5.2.0](#520) 11 | - `5.1.x` Releases - [5.1.0](#510) | [5.1.1](#511) 12 | - `5.0.x` Releases - [5.0.0](#500) | [5.0.1](#501) | [5.0.2](#502) | [5.0.3](#503) | [5.0.4](#504) 13 | - `4.3.x` Releases - [4.3.0](#430) | [4.3.1](#431) 14 | - `4.2.x` Releases - [4.2.0](#420) | [4.2.1](#421) | [4.2.2](#422) | [4.2.3](#423) | [4.2.4](#424) 15 | - `4.1.x` Releases - [4.1.0](#410) 16 | - `4.0.x` Releases - [4.0.0](#400) | [4.0.1](#401) | [4.0.2](#402) | [4.0.3](#403) | [4.0.4](#404) | [4.0.5](#405) 17 | - `3.4.x` Releases - [3.4.0](#340) | [3.4.1](#341) 18 | - `3.3.x` Releases - [3.3.0](#330) | [3.3.1](#331) | [3.3.2](#332) | [3.3.3](#333) | [3.3.4](#334) 19 | - `3.2.x` Releases - [3.2.0](#320) 20 | - `3.1.x` Releases - [3.1.0](#310) 21 | - `3.0.x` Releases - [3.0.0](#300) 22 | - `2.1.x` Releases - [2.1.0](#210) | [2.1.1](#211) | [2.1.2](#212) 23 | - `2.0.x` Releases - [2.0.0](#200) | [2.0.1](#201) | [2.0.2](#202) | [2.0.3](#203) | [2.0.4](#204) | [2.0.5](#205) | [2.0.6](#206) | [2.0.7](#207) | [2.0.8](#208) | [2.0.9](#209) | [2.0.10](#2010) | [2.0.11](#2011) | [2.0.12](#2012) | [2.0.13](#2013) | [2.0.14](#2014) 24 | - `2.0.x` Beta Releases - [2.0.0-beta1](#200-beta1) | [2.0.0-beta2](#200-beta2) | [2.0.0-beta3](#200-beta3) | [2.0.0-beta4](#200-beta4) | [2.0.0-beta5](#200-beta5) | [2.0.0-beta6](#200-beta6) | [2.0.0-beta7](#200-beta7) 25 | - `1.5.x` Releases - [1.5](#15) | [1.5.1](#151) 26 | 27 | --- 28 | 29 | ## [5.7.3](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.7.3) 30 | 31 | - Fix issue introduced in #399 32 | 33 | ## [5.7.2](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.7.2) 34 | 35 | - Merged #401 (Thanks to [@feef](https://github.com/feef)) 36 | 37 | ## [5.7.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.7.1) 38 | 39 | - Merged #398 (Thanks to [@mark-dlc](https://github.com/mark-dlc)) 40 | 41 | ## [5.7.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.7.0) 42 | 43 | - Merged #392 44 | 45 | ## [5.6.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.6.0) 46 | 47 | - Merged #386 48 | - Added `Package.swift` 49 | 50 | ## [5.5.2](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.5.2) 51 | 52 | - Merged #378 53 | 54 | ## [5.5.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.5.1) 55 | 56 | - Fixed `scrollToTop` implementation 57 | 58 | ## [5.5.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.5.0) 59 | 60 | - Added `scrollToTop` optional parameter to the `showNavbar` call 61 | - Fixed #377 62 | - Fixed #363 63 | - Fixed #302 64 | 65 | ## [5.4.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.4.1) 66 | 67 | - Merged #374 68 | 69 | ## [5.4.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.4.0) 70 | 71 | #### Breaking change: 72 | - Remove deprecated `UIWebView` reference 73 | 74 | ## [5.3.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.3.0) 75 | 76 | - Merge #365 77 | 78 | ## [5.2.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.2.0) 79 | 80 | - Merge #352 81 | 82 | ## [5.1.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.1.1) 83 | 84 | - Fix Objective-C compatibility 85 | 86 | ## [5.1.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.1.0) 87 | 88 | - Swift version 4.2 89 | 90 | ## [5.0.4](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.0.4) 91 | 92 | - Merge #316 93 | 94 | ## [5.0.3](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.0.3) 95 | 96 | - Fix #321 97 | 98 | ## [5.0.2](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.0.2) 99 | 100 | - Fixed the `followers` movement 101 | 102 | ## [5.0.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.0.1) 103 | 104 | - Fixed #313 105 | 106 | ## [5.0.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/5.0.0) 107 | 108 | ### Breaking changes 109 | 110 | The followers are no longer plain `UIView`s, but need to be wrapped in a `NavigationBarFollower` object, that provides the direction of the scroll. 111 | 112 | ## [4.3.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.3.1) 113 | 114 | - Merge #310 115 | 116 | ## [4.3.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.3.0) 117 | 118 | - Fix orientation change issues 119 | - Fix #303 120 | 121 | ## [4.2.4](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.2.4) 122 | 123 | - Fixed #303 124 | 125 | ## [4.2.3](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.2.3) 126 | 127 | - Fixed #304 128 | 129 | ## [4.2.2](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.2.2) 130 | 131 | - Merged #301 132 | 133 | ## [4.2.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.2.1) 134 | 135 | - Fixed an issue with `UITableView`'s floating headers 136 | 137 | ## [4.2.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.2.0) 138 | 139 | Account for the notch when the status bar is hidden on iPhone X. See #295 140 | 141 | ## [4.1.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.1.0) 142 | 143 | Merged #292, #293 144 | 145 | ## [4.0.5](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.0.5) 146 | 147 | Handle large titles in iOS11 148 | 149 | ## [4.0.4](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.0.4) 150 | 151 | Expose all properties to Objective-C 152 | 153 | ## [4.0.3](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.0.3) 154 | 155 | - Merged #274 156 | - Merged #278 157 | - Merged #269 158 | 159 | ## [4.0.2](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.0.2) 160 | 161 | - Merged #272 162 | 163 | ## [4.0.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.0.1) 164 | 165 | - Fix #266 166 | 167 | ## [4.0.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/4.0.0) 168 | 169 | - Swift 4 support 170 | 171 | ## [3.4.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/3.4.1) 172 | 173 | - Merged #263 174 | 175 | ## [3.4.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/3.4.0) 176 | 177 | - Add ability to move the TabBar (#258) 178 | 179 | ## [3.3.4](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/3.3.4) 180 | 181 | - Fix #253 182 | 183 | ## [3.3.3](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/3.3.3) 184 | 185 | - Changed access control from public to open 186 | 187 | ## [3.3.2](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/3.3.2) 188 | 189 | - Fixed issues with sizing and the scroll speed factor 190 | 191 | ## [3.3.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/3.3.1) 192 | 193 | - Added support for `WKWebView`. See #239 194 | 195 | ## [3.3.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/3.3.0) 196 | 197 | - Fixed `expandOnActive` 198 | - Added `showingNavbar` optional parameter to `stopFollowingScrollView` 199 | - Fixed #237 200 | 201 | ## [3.2.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/3.2.0) 202 | 203 | Added optional `followers` parameter to `followScrollView`. See [Readme section](https://github.com/andreamazz/AMScrollingNavbar#followers) 204 | 205 | ## [3.1.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/3.1.0) 206 | 207 | Added optional `scrollSpeedFactor` parameter to `followScrollView`. See #224 208 | 209 | ## [3.0.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/3.0.0) 210 | 211 | Updated to Swift 3 syntax 212 | 213 | ## [2.1.2](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.1.2) 214 | 215 | - Fix status bar handling when in-call 216 | 217 | ## [2.1.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.1.1) 218 | 219 | - Merged #197 220 | 221 | ## [2.1.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.1.0) 222 | 223 | Updated to Swift 2.2 syntax 224 | 225 | ## [2.0.14](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.14) 226 | 227 | ### Fixed 228 | 229 | - Expose the gesture recognizer #194 230 | 231 | ## [2.0.13](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.13) 232 | 233 | ### Fixed 234 | 235 | - Fix Carthage build by setting the demo pod target to 8.0 236 | 237 | ## [2.0.12](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.12) 238 | 239 | ### Fixed 240 | 241 | - Fix Carthage build for 8.0 targets 242 | 243 | ## [2.0.11](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.11) 244 | 245 | ### Fixed 246 | 247 | - Issue #183 248 | 249 | ## [2.0.10](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.10) 250 | 251 | ### Fixed 252 | 253 | - Issue #172 254 | 255 | ## [2.0.9](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.9) 256 | 257 | Merged #166 258 | 259 | ## [2.0.8](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.8) 260 | 261 | Updated documentation. 262 | Minor refactoring. 263 | 264 | ## [2.0.7](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.7) 265 | 266 | ### Fixed 267 | 268 | - Issue #135 269 | - Issue #165 270 | 271 | ## [2.0.6](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.6) 272 | 273 | ### Fixed 274 | 275 | - Refactoring. Removed screen rotation observer when appropriate. [@ikesyo](https://github.com/ikesyo) 276 | 277 | ## [2.0.5](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.5) 278 | 279 | ### Fixed 280 | 281 | - Issue #156 282 | 283 | Code refactoring. Thanks to [Syo Ikeda](https://github.com/ikesyo) 284 | 285 | ## [2.0.4](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.4) 286 | 287 | ### Fixed 288 | 289 | - Fix navbar fadeout. Thanks to [Syo Ikeda](https://github.com/ikesyo) 290 | 291 | ## [2.0.3](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.3) 292 | 293 | ### Fixed 294 | 295 | - Issue #159 296 | 297 | ## [2.0.2](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.2) 298 | 299 | ### Fixed 300 | 301 | - Fix bug causing titleView alpha property to not update when navbar alpha changes. Thanks to [Erik Ackermann](https://github.com/erikackermann) 302 | 303 | ## [2.0.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.1) 304 | 305 | ### Fixed 306 | 307 | - Issue #153 308 | 309 | ## [2.0.0](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.0) 310 | 311 | ### Added 312 | 313 | - Support for Swift 2.0 syntax 314 | 315 | ## [2.0.0-beta7](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.0-beta7) 316 | 317 | ### Fixed 318 | - Fix the fading of all possible navigation items and buttons. Thanks to [Yunus Eren Guzel](https://github.com/yunuserenguzel) 319 | 320 | ## [2.0.0-beta6](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.0-beta6) 321 | 322 | ### Fixed 323 | - Delegate function gets called after `hideNavbar` and `showNavbar` finish. 324 | - Fixes title attributes being overridden. Thanks to [Jianghua Kuai](https://github.com/joshuakuai) 325 | 326 | ## [2.0.0-beta5](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.0-beta5) 327 | 328 | ### Added 329 | - ScrollingNavigationControllerDelegate protocol 330 | 331 | ### Fixed 332 | - Issue with the scroll offset 333 | 334 | ## [2.0.0-beta4](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.0-beta4) 335 | 336 | ### Fixed 337 | - Minor refactoring 338 | - Changed filename for `ScrollingNavigationController` 339 | - Fixed Carthage build. Thanks to [Nicholas T.](https://github.com/NicholasTD07) 340 | 341 | ## [2.0.0-beta3](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.0-beta3) 342 | 343 | ### Fixed 344 | - Carthage support restored 345 | 346 | ### Added 347 | - Utility class `ScrollingNavigationViewController´ 348 | 349 | ## [2.0.0-beta2](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.0-beta2) 350 | 351 | ### Fixed 352 | - Issue with interactive gesture 353 | 354 | ## [2.0.0-beta1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/2.0.0-beta1) 355 | 356 | The library was rewritten in Swift, as a subclass of `UINavigationController`. This version contains breaking changes. 357 | Moving from a category to a subclass cleaned up the code quite a bit, making it more maintainable and hopefully less fragile. 358 | It also fully supports translucent navbars now. 359 | 360 | ## [1.5.1](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/1.5.1) 361 | 362 | #### Added 363 | - Support to Carthage 364 | 365 | ## [1.5](https://github.com/andreamazz/AMScrollingNavbar/releases/tag/1.5) 366 | -------------------------------------------------------------------------------- /Demo/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | platform :ios, '8.0' 3 | 4 | target 'ScrollingNavbarDemo' do 5 | pod 'AMScrollingNavbar', path: '../' 6 | end 7 | 8 | target 'ScrollingNavbarDemoTests' do 9 | pod 'AMScrollingNavbar', path: '../' 10 | # pod 'Nimble', '~> 4.0.1' 11 | # pod 'Quick', '~> 0.9.2' 12 | # pod 'Nimble-Snapshots' 13 | end 14 | 15 | -------------------------------------------------------------------------------- /Demo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AMScrollingNavbar (5.0.4) 3 | 4 | DEPENDENCIES: 5 | - AMScrollingNavbar (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | AMScrollingNavbar: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | AMScrollingNavbar: 85f694557595138626cdcf4a2103411d1928bb2a 13 | 14 | PODFILE CHECKSUM: 0f0a96dab8d2652fa45ba1e24893191416c0d5a7 15 | 16 | COCOAPODS: 1.5.0 17 | -------------------------------------------------------------------------------- /Demo/Pods/AMScrollingNavbar/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Andrea Mazzini 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Demo/Pods/AMScrollingNavbar/README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | [![CocoaPods](https://cocoapod-badges.herokuapp.com/v/AMScrollingNavbar/badge.svg)](http://www.cocoapods.org/?q=amscrollingnavbar) 6 | [![Build Status](https://travis-ci.org/andreamazz/AMScrollingNavbar.svg)](https://travis-ci.org/andreamazz/AMScrollingNavbar) 7 | [![codecov.io](https://codecov.io/github/andreamazz/AMScrollingNavbar/coverage.svg?branch=master)](https://codecov.io/github/andreamazz/AMScrollingNavbar?branch=master) 8 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 9 | ![Swift 4](https://img.shields.io/badge/swift-4-orange.svg) 10 | [![Join the chat at https://gitter.im/andreamazz/AMScrollingNavbar](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/andreamazz/AMScrollingNavbar?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 11 | [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=46FNZD4PDVNRU) 12 | 13 | A custom UINavigationController that enables the scrolling of the navigation bar alongside the 14 | scrolling of an observed content view 15 | 16 |

17 | 18 | 19 | 20 |

21 | 22 | ### Versioning notes 23 | 24 | - Version `2.x` is written as a subclass of `UINavigationController`, in Swift. 25 | - Version `2.0.0` introduce Swift 2.0 syntax. 26 | - Version `3.0.0` introduce Swift 3.0 syntax. 27 | - Version `4.0.0` introduce Swift 4.0 syntax. 28 | 29 | If you are looking for the category implementation in Objective-C, make sure to checkout version `1.x` and prior, although the `2.x` is recomended. 30 | 31 | # Screenshot 32 | 33 |

34 | 35 |

36 | 37 | # Setup with CocoaPods 38 | 39 | ``` 40 | pod 'AMScrollingNavbar' 41 | 42 | use_frameworks! 43 | ``` 44 | 45 | # Setup with Carthage 46 | 47 | ``` 48 | github "andreamazz/AMScrollingNavbar" 49 | ``` 50 | 51 | ## Usage 52 | 53 | Make sure to use a subclass of `ScrollingNavigationController` for your `UINavigationController`. Either set the class of your `UINavigationController` in your storyboard, or create programmatically a `ScrollingNavigationController` instance in your code. 54 | 55 | Use `followScrollView(_: delay:)` to start following the scrolling of a scrollable view (e.g.: a `UIScrollView` or `UITableView`). 56 | #### Swift 57 | ```swift 58 | override func viewWillAppear(_ animated: Bool) { 59 | super.viewWillAppear(animated) 60 | 61 | if let navigationController = navigationController as? ScrollingNavigationController { 62 | navigationController.followScrollView(tableView, delay: 50.0) 63 | } 64 | } 65 | ``` 66 | 67 | #### Objective-C 68 | ```objc 69 | - (void)viewWillAppear:(BOOL)animated { 70 | [super viewWillAppear:animated]; 71 | 72 | [(ScrollingNavigationController *)self.navigationController followScrollView:self.tableView delay:50.0f]; 73 | } 74 | ``` 75 | 76 | Use `stopFollowingScrollview()` to stop the behaviour. Remember to call this function on disappear: 77 | ```swift 78 | override func viewDidDisappear(_ animated: Bool) { 79 | super.viewDidDisappear(animated) 80 | 81 | if let navigationController = navigationController as? ScrollingNavigationController { 82 | navigationController.stopFollowingScrollView() 83 | } 84 | } 85 | ``` 86 | 87 | ## ScrollingNavigationViewController 88 | To DRY things up you can let your view controller subclass `ScrollingNavigationViewController`, which provides the base setup implementation. You will just need to call `followScrollView(_: delay:)`: 89 | ```swift 90 | override func viewWillAppear(_ animated: Bool) { 91 | super.viewWillAppear(animated) 92 | 93 | if let navigationController = navigationController as? ScrollingNavigationController { 94 | navigationController.followScrollView(tableView, delay: 50.0) 95 | } 96 | } 97 | ``` 98 | 99 | ## Followers 100 | To move another view, like a toolbar, alongside the navigation bar you can provide the view or multiple views as the `followers` parameter: 101 | ```swift 102 | if let navigationController = navigationController as? ScrollingNavigationController { 103 | navigationController.followScrollView(tableView, delay: 50.0, followers: [toolbar]) 104 | } 105 | ``` 106 | Note that when navigating away from the controller the followers might keep the scroll offset. Refer to [Handling navigation](https://github.com/andreamazz/AMScrollingNavbar#handling-navigation) for proper setup. 107 | 108 | ## Scrolling the TabBar 109 | You can also pass a `UITabBar` in the `followers` array: 110 | ```swift 111 | if let navigationController = navigationController as? ScrollingNavigationController { 112 | navigationController.followScrollView(tableView, delay: 50.0, followers: [tabBarController.tabBar]) 113 | } 114 | ``` 115 | 116 | 117 | ## ScrollingNavigationControllerDelegate 118 | You can set a delegate to receive a call when the state of the navigation bar changes: 119 | ```swift 120 | if let navigationController = navigationController as? ScrollingNavigationController { 121 | navigationController.scrollingNavbarDelegate = self 122 | } 123 | ``` 124 | 125 | Delegate function: 126 | ```swift 127 | func scrollingNavigationController(_ controller: ScrollingNavigationController, didChangeState state: NavigationBarState) { 128 | switch state { 129 | case .collapsed: 130 | print("navbar collapsed") 131 | case .expanded: 132 | print("navbar expanded") 133 | case .scrolling: 134 | print("navbar is moving") 135 | } 136 | } 137 | ``` 138 | 139 | ## Handling navigation 140 | If the view controller with the scroll view pushes new controllers, you should call `showNavbar(animated:)` in your `viewWillDisappear(animated:)`: 141 | ```swift 142 | override func viewWillDisappear(_ animated: Bool) { 143 | super.viewWillDisappear(animated) 144 | if let navigationController = navigationController as? ScrollingNavigationController { 145 | navigationController.showNavbar(animated: true) 146 | } 147 | } 148 | ``` 149 | 150 | ## Scrolling to top 151 | When the user taps the status bar, by default a scrollable view scrolls to the top of its content. If you want to also show the navigation bar, make sure to include this in your controller: 152 | 153 | ```swift 154 | func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool { 155 | if let navigationController = navigationController as? ScrollingNavigationController { 156 | navigationController.showNavbar(animated: true) 157 | } 158 | return true 159 | } 160 | ``` 161 | 162 | ## Scroll speed 163 | You can control the speed of the scrolling using the `scrollSpeedFactor` optional parameter: 164 | 165 | ```swift 166 | controller.followScrollView(view, delay: 0, scrollSpeedFactor: 2) 167 | ``` 168 | 169 | Check out the sample project for more details. 170 | 171 | # Author 172 | [Andrea Mazzini](https://twitter.com/theandreamazz). I'm available for freelance work, feel free to contact me. 173 | 174 | Want to support the development of [these free libraries](https://cocoapods.org/owners/734)? Buy me a coffee ☕️ via [Paypal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=46FNZD4PDVNRU). 175 | 176 | # Contributors 177 | [Syo Ikeda](https://github.com/ikesyo) and [everyone](https://github.com/andreamazz/AMScrollingNavbar/graphs/contributors) kind enough to submit a pull request. 178 | 179 | # MIT License 180 | The MIT License (MIT) 181 | 182 | Copyright (c) 2017 Andrea Mazzini 183 | 184 | Permission is hereby granted, free of charge, to any person obtaining a copy of 185 | this software and associated documentation files (the "Software"), to deal in 186 | the Software without restriction, including without limitation the rights to 187 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 188 | the Software, and to permit persons to whom the Software is furnished to do so, 189 | subject to the following conditions: 190 | 191 | The above copyright notice and this permission notice shall be included in all 192 | copies or substantial portions of the Software. 193 | 194 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 195 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 196 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 197 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 198 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 199 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 200 | -------------------------------------------------------------------------------- /Demo/Pods/AMScrollingNavbar/Source/ScrollingNavbar+Sizes.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import WebKit 3 | 4 | /** 5 | Implements the main functions providing constants values and computed ones 6 | */ 7 | extension ScrollingNavigationController { 8 | 9 | // MARK: - View sizing 10 | 11 | var fullNavbarHeight: CGFloat { 12 | return navbarHeight + statusBarHeight 13 | } 14 | 15 | var navbarHeight: CGFloat { 16 | return navigationBar.frame.size.height 17 | } 18 | 19 | var statusBarHeight: CGFloat { 20 | var statusBarHeight = UIApplication.shared.statusBarFrame.size.height 21 | if #available(iOS 11.0, *) { 22 | // Account for the notch when the status bar is hidden 23 | statusBarHeight = max(UIApplication.shared.statusBarFrame.size.height, UIApplication.shared.delegate?.window??.safeAreaInsets.top ?? 0) 24 | } 25 | return statusBarHeight - extendedStatusBarDifference 26 | } 27 | 28 | // Extended status call changes the bounds of the presented view 29 | var extendedStatusBarDifference: CGFloat { 30 | return abs(view.bounds.height - (UIApplication.shared.delegate?.window??.frame.size.height ?? UIScreen.main.bounds.height)) 31 | } 32 | 33 | var tabBarOffset: CGFloat { 34 | // Only account for the tab bar if a tab bar controller is present and the bar is not translucent 35 | if let tabBarController = tabBarController { 36 | return tabBarController.tabBar.isTranslucent ? 0 : tabBarController.tabBar.frame.height 37 | } 38 | return 0 39 | } 40 | 41 | func scrollView() -> UIScrollView? { 42 | if let webView = self.scrollableView as? UIWebView { 43 | return webView.scrollView 44 | } else if let wkWebView = self.scrollableView as? WKWebView { 45 | return wkWebView.scrollView 46 | } else { 47 | return scrollableView as? UIScrollView 48 | } 49 | } 50 | 51 | var contentOffset: CGPoint { 52 | return scrollView()?.contentOffset ?? CGPoint.zero 53 | } 54 | 55 | var contentSize: CGSize { 56 | guard let scrollView = scrollView() else { 57 | return CGSize.zero 58 | } 59 | 60 | let verticalInset = scrollView.contentInset.top + scrollView.contentInset.bottom 61 | return CGSize(width: scrollView.contentSize.width, height: scrollView.contentSize.height + verticalInset) 62 | } 63 | 64 | var deltaLimit: CGFloat { 65 | return navbarHeight - statusBarHeight 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Demo/Pods/AMScrollingNavbar/Source/ScrollingNavigationController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | /** 4 | Scrolling Navigation Bar delegate protocol 5 | */ 6 | @objc public protocol ScrollingNavigationControllerDelegate: NSObjectProtocol { 7 | /// Called when the state of the navigation bar changes 8 | /// 9 | /// - Parameters: 10 | /// - controller: the ScrollingNavigationController 11 | /// - state: the new state 12 | @objc optional func scrollingNavigationController(_ controller: ScrollingNavigationController, didChangeState state: NavigationBarState) 13 | 14 | /// Called when the state of the navigation bar is about to change 15 | /// 16 | /// - Parameters: 17 | /// - controller: the ScrollingNavigationController 18 | /// - state: the new state 19 | @objc optional func scrollingNavigationController(_ controller: ScrollingNavigationController, willChangeState state: NavigationBarState) 20 | } 21 | 22 | /** 23 | The state of the navigation bar 24 | 25 | - collapsed: the navigation bar is fully collapsed 26 | - expanded: the navigation bar is fully visible 27 | - scrolling: the navigation bar is transitioning to either `Collapsed` or `Scrolling` 28 | */ 29 | @objc public enum NavigationBarState: Int { 30 | case collapsed, expanded, scrolling 31 | } 32 | 33 | /** 34 | The direction of scrolling that the navigation bar should be collapsed. 35 | The raw value determines the sign of content offset depending of collapse direction. 36 | 37 | - scrollUp: scrolling up direction 38 | - scrollDown: scrolling down direction 39 | */ 40 | @objc public enum NavigationBarCollapseDirection: Int { 41 | case scrollUp = -1 42 | case scrollDown = 1 43 | } 44 | 45 | /** 46 | A custom `UINavigationController` that enables the scrolling of the navigation bar alongside the 47 | scrolling of an observed content view 48 | */ 49 | @objcMembers 50 | open class ScrollingNavigationController: UINavigationController, UIGestureRecognizerDelegate { 51 | 52 | /** 53 | Returns the `NavigationBarState` of the navigation bar 54 | */ 55 | open fileprivate(set) var state: NavigationBarState = .expanded { 56 | willSet { 57 | if state != newValue { 58 | scrollingNavbarDelegate?.scrollingNavigationController?(self, willChangeState: newValue) 59 | } 60 | } 61 | didSet { 62 | navigationBar.isUserInteractionEnabled = (state == .expanded) 63 | if state != oldValue { 64 | scrollingNavbarDelegate?.scrollingNavigationController?(self, didChangeState: state) 65 | } 66 | } 67 | } 68 | 69 | /** 70 | Determines whether the navbar should scroll when the content inside the scrollview fits 71 | the view's size. Defaults to `false` 72 | */ 73 | open var shouldScrollWhenContentFits = false 74 | 75 | /** 76 | Determines if the navbar should expand once the application becomes active after entering background 77 | Defaults to `true` 78 | */ 79 | open var expandOnActive = true 80 | 81 | /** 82 | Determines if the navbar scrolling is enabled. 83 | Defaults to `true` 84 | */ 85 | open var scrollingEnabled = true 86 | 87 | /** 88 | The delegate for the scrolling navbar controller 89 | */ 90 | open weak var scrollingNavbarDelegate: ScrollingNavigationControllerDelegate? 91 | 92 | /** 93 | An array of `UIView`s that will follow the navbar 94 | */ 95 | open var followers: [UIView] = [] 96 | 97 | open fileprivate(set) var gestureRecognizer: UIPanGestureRecognizer? 98 | fileprivate var sourceTabBar: UITabBar? 99 | var delayDistance: CGFloat = 0 100 | var maxDelay: CGFloat = 0 101 | var scrollableView: UIView? 102 | var lastContentOffset = CGFloat(0.0) 103 | var scrollSpeedFactor: CGFloat = 1 104 | var collapseDirectionFactor: CGFloat = 1 // Used to determine the sign of content offset depending of collapse direction 105 | var previousState: NavigationBarState = .expanded // Used to mark the state before the app goes in background 106 | 107 | /** 108 | Start scrolling 109 | 110 | Enables the scrolling by observing a view 111 | 112 | - parameter scrollableView: The view with the scrolling content that will be observed 113 | - parameter delay: The delay expressed in points that determines the scrolling resistance. Defaults to `0` 114 | - parameter scrollSpeedFactor : This factor determines the speed of the scrolling content toward the navigation bar animation 115 | - parameter collapseDirection : The direction of scrolling that the navigation bar should be collapsed 116 | - parameter followers: An array of `UIView`s that will follow the navbar 117 | */ 118 | open func followScrollView(_ scrollableView: UIView, delay: Double = 0, scrollSpeedFactor: Double = 1, collapseDirection: NavigationBarCollapseDirection = .scrollDown, followers: [UIView] = []) { 119 | self.scrollableView = scrollableView 120 | 121 | gestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(ScrollingNavigationController.handlePan(_:))) 122 | gestureRecognizer?.maximumNumberOfTouches = 1 123 | gestureRecognizer?.delegate = self 124 | scrollableView.addGestureRecognizer(gestureRecognizer!) 125 | 126 | NotificationCenter.default.addObserver(self, selector: #selector(ScrollingNavigationController.willResignActive(_:)), name: NSNotification.Name.UIApplicationWillResignActive, object: nil) 127 | NotificationCenter.default.addObserver(self, selector: #selector(ScrollingNavigationController.didBecomeActive(_:)), name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) 128 | NotificationCenter.default.addObserver(self, selector: #selector(ScrollingNavigationController.didRotate(_:)), name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil) 129 | 130 | maxDelay = CGFloat(delay) 131 | delayDistance = CGFloat(delay) 132 | scrollingEnabled = true 133 | 134 | // Save TabBar state (the state is changed during the transition and restored on compeltion) 135 | if let tab = followers.first(where: { $0 is UITabBar }) as? UITabBar { 136 | self.sourceTabBar = UITabBar(frame: tab.frame) 137 | self.sourceTabBar?.isTranslucent = tab.isTranslucent 138 | } 139 | self.followers = followers 140 | self.scrollSpeedFactor = CGFloat(scrollSpeedFactor) 141 | self.collapseDirectionFactor = CGFloat(collapseDirection.rawValue) 142 | } 143 | 144 | /** 145 | Hide the navigation bar 146 | 147 | - parameter animated: If true the scrolling is animated. Defaults to `true` 148 | - parameter duration: Optional animation duration. Defaults to 0.1 149 | */ 150 | open func hideNavbar(animated: Bool = true, duration: TimeInterval = 0.1) { 151 | guard let _ = self.scrollableView, let visibleViewController = self.visibleViewController else { return } 152 | 153 | if state == .expanded { 154 | self.state = .scrolling 155 | UIView.animate(withDuration: animated ? duration : 0, animations: { () -> Void in 156 | self.scrollWithDelta(self.fullNavbarHeight) 157 | visibleViewController.view.setNeedsLayout() 158 | if self.navigationBar.isTranslucent { 159 | let currentOffset = self.contentOffset 160 | self.scrollView()?.contentOffset = CGPoint(x: currentOffset.x, y: currentOffset.y + self.navbarHeight) 161 | } 162 | }) { _ in 163 | self.state = .collapsed 164 | } 165 | } else { 166 | updateNavbarAlpha() 167 | } 168 | } 169 | 170 | /** 171 | Show the navigation bar 172 | 173 | - parameter animated: If true the scrolling is animated. Defaults to `true` 174 | - parameter duration: Optional animation duration. Defaults to 0.1 175 | */ 176 | open func showNavbar(animated: Bool = true, duration: TimeInterval = 0.1) { 177 | guard let _ = self.scrollableView, let visibleViewController = self.visibleViewController else { return } 178 | 179 | if state == .collapsed { 180 | gestureRecognizer?.isEnabled = false 181 | let animations = { 182 | self.lastContentOffset = 0; 183 | self.scrollWithDelta(-self.fullNavbarHeight, ignoreDelay: true) 184 | visibleViewController.view.setNeedsLayout() 185 | if self.navigationBar.isTranslucent { 186 | let currentOffset = self.contentOffset 187 | self.scrollView()?.contentOffset = CGPoint(x: currentOffset.x, y: currentOffset.y - self.navbarHeight) 188 | } 189 | } 190 | if animated { 191 | self.state = .scrolling 192 | UIView.animate(withDuration: duration, animations: animations) { _ in 193 | self.state = .expanded 194 | self.gestureRecognizer?.isEnabled = true 195 | } 196 | } else { 197 | animations() 198 | self.state = .expanded 199 | self.gestureRecognizer?.isEnabled = true 200 | } 201 | } else { 202 | updateNavbarAlpha() 203 | } 204 | } 205 | 206 | /** 207 | Stop observing the view and reset the navigation bar 208 | 209 | - parameter showingNavbar: If true the navbar is show, otherwise it remains in its current state. Defaults to `true` 210 | */ 211 | open func stopFollowingScrollView(showingNavbar: Bool = true) { 212 | if showingNavbar { 213 | showNavbar(animated: true) 214 | } 215 | if let gesture = gestureRecognizer { 216 | scrollableView?.removeGestureRecognizer(gesture) 217 | } 218 | scrollableView = .none 219 | gestureRecognizer = .none 220 | scrollingNavbarDelegate = .none 221 | scrollingEnabled = false 222 | 223 | let center = NotificationCenter.default 224 | center.removeObserver(self, name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) 225 | center.removeObserver(self, name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil) 226 | } 227 | 228 | // MARK: - Gesture recognizer 229 | 230 | func handlePan(_ gesture: UIPanGestureRecognizer) { 231 | if gesture.state != .failed { 232 | if let superview = scrollableView?.superview { 233 | let translation = gesture.translation(in: superview) 234 | let delta = collapseDirectionFactor * (lastContentOffset - translation.y) / scrollSpeedFactor 235 | lastContentOffset = translation.y 236 | 237 | if shouldScrollWithDelta(delta) { 238 | scrollWithDelta(delta) 239 | } 240 | } 241 | } 242 | 243 | if gesture.state == .ended || gesture.state == .cancelled || gesture.state == .failed { 244 | checkForPartialScroll() 245 | lastContentOffset = 0 246 | } 247 | } 248 | 249 | // MARK: - Rotation handler 250 | 251 | func didRotate(_ notification: Notification) { 252 | showNavbar() 253 | } 254 | 255 | /** 256 | UIContentContainer protocol method. 257 | Will show the navigation bar upon rotation or changes in the trait sizes. 258 | */ 259 | open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { 260 | super.viewWillTransition(to: size, with: coordinator) 261 | showNavbar() 262 | } 263 | 264 | // MARK: - Notification handler 265 | 266 | func didBecomeActive(_ notification: Notification) { 267 | if expandOnActive { 268 | showNavbar(animated: false) 269 | } else { 270 | if previousState == .collapsed { 271 | hideNavbar(animated: false) 272 | } 273 | } 274 | } 275 | 276 | func willResignActive(_ notification: Notification) { 277 | previousState = state 278 | } 279 | 280 | /// Handles when the status bar changes 281 | func willChangeStatusBar() { 282 | showNavbar(animated: true) 283 | } 284 | 285 | // MARK: - Scrolling functions 286 | 287 | private func shouldScrollWithDelta(_ delta: CGFloat) -> Bool { 288 | let scrollDelta = delta 289 | // Check for rubberbanding 290 | if scrollDelta < 0 { 291 | if let scrollableView = scrollableView , contentOffset.y + scrollableView.frame.size.height > contentSize.height && scrollableView.frame.size.height < contentSize.height { 292 | // Only if the content is big enough 293 | return false 294 | } 295 | } 296 | return true 297 | } 298 | 299 | private func scrollWithDelta(_ delta: CGFloat, ignoreDelay: Bool = false) { 300 | var scrollDelta = delta 301 | let frame = navigationBar.frame 302 | 303 | // View scrolling up, hide the navbar 304 | if scrollDelta > 0 { 305 | // Update the delay 306 | if !ignoreDelay { 307 | delayDistance -= scrollDelta 308 | 309 | // Skip if the delay is not over yet 310 | if delayDistance > 0 { 311 | return 312 | } 313 | } 314 | 315 | // No need to scroll if the content fits 316 | if !shouldScrollWhenContentFits && state != .collapsed && 317 | (scrollableView?.frame.size.height)! >= contentSize.height { 318 | return 319 | } 320 | 321 | // Compute the bar position 322 | if frame.origin.y - scrollDelta < -deltaLimit { 323 | scrollDelta = frame.origin.y + deltaLimit 324 | } 325 | 326 | // Detect when the bar is completely collapsed 327 | if frame.origin.y <= -deltaLimit { 328 | state = .collapsed 329 | delayDistance = maxDelay 330 | } else { 331 | state = .scrolling 332 | } 333 | } 334 | 335 | if scrollDelta < 0 { 336 | // Update the delay 337 | if !ignoreDelay { 338 | delayDistance += scrollDelta 339 | 340 | // Skip if the delay is not over yet 341 | if delayDistance > 0 && maxDelay < contentOffset.y { 342 | return 343 | } 344 | } 345 | 346 | // Compute the bar position 347 | if frame.origin.y - scrollDelta > statusBarHeight { 348 | scrollDelta = frame.origin.y - statusBarHeight 349 | } 350 | 351 | // Detect when the bar is completely expanded 352 | if frame.origin.y >= statusBarHeight { 353 | state = .expanded 354 | delayDistance = maxDelay 355 | } else { 356 | state = .scrolling 357 | } 358 | } 359 | 360 | updateSizing(scrollDelta) 361 | updateNavbarAlpha() 362 | restoreContentOffset(scrollDelta) 363 | updateFollowers(scrollDelta) 364 | updateContentInset(scrollDelta) 365 | } 366 | 367 | /// Adjust the top inset (useful when a table view has floating headers, see issue #219 368 | private func updateContentInset(_ delta: CGFloat) { 369 | if let contentInset = scrollView()?.contentInset, let scrollInset = scrollView()?.scrollIndicatorInsets { 370 | scrollView()?.contentInset = UIEdgeInsets(top: contentInset.top - delta, left: contentInset.left, bottom: contentInset.bottom, right: contentInset.right) 371 | scrollView()?.scrollIndicatorInsets = UIEdgeInsets(top: scrollInset.top - delta, left: scrollInset.left, bottom: scrollInset.bottom, right: scrollInset.right) 372 | } 373 | } 374 | 375 | private func updateFollowers(_ delta: CGFloat) { 376 | followers.forEach { 377 | guard let tabBar = $0 as? UITabBar else { 378 | $0.transform = $0.transform.translatedBy(x: 0, y: -delta) 379 | return 380 | } 381 | tabBar.isTranslucent = true 382 | tabBar.frame.origin.y += delta * 1.5 383 | 384 | // Set the bar to its original state if it's in its original position 385 | if let originalTabBar = sourceTabBar, originalTabBar.frame.origin.y == tabBar.frame.origin.y { 386 | tabBar.isTranslucent = originalTabBar.isTranslucent 387 | } 388 | } 389 | } 390 | 391 | private func updateSizing(_ delta: CGFloat) { 392 | guard let topViewController = self.topViewController else { return } 393 | 394 | var frame = navigationBar.frame 395 | 396 | // Move the navigation bar 397 | frame.origin = CGPoint(x: frame.origin.x, y: frame.origin.y - delta) 398 | navigationBar.frame = frame 399 | 400 | // Resize the view if the navigation bar is not translucent 401 | if !navigationBar.isTranslucent { 402 | let navBarY = navigationBar.frame.origin.y + navigationBar.frame.size.height 403 | frame = topViewController.view.frame 404 | frame.origin = CGPoint(x: frame.origin.x, y: navBarY) 405 | frame.size = CGSize(width: frame.size.width, height: view.frame.size.height - (navBarY) - tabBarOffset) 406 | topViewController.view.frame = frame 407 | } 408 | } 409 | 410 | private func restoreContentOffset(_ delta: CGFloat) { 411 | if navigationBar.isTranslucent || delta == 0 { 412 | return 413 | } 414 | 415 | // Hold the scroll steady until the navbar appears/disappears 416 | if let scrollView = scrollView() { 417 | scrollView.setContentOffset(CGPoint(x: contentOffset.x, y: contentOffset.y - delta), animated: false) 418 | } 419 | } 420 | 421 | private func checkForPartialScroll() { 422 | let frame = navigationBar.frame 423 | var duration = TimeInterval(0) 424 | var delta = CGFloat(0.0) 425 | 426 | // Scroll back down 427 | let threshold = statusBarHeight - (frame.size.height / 2) 428 | if navigationBar.frame.origin.y >= threshold { 429 | delta = frame.origin.y - statusBarHeight 430 | let distance = delta / (frame.size.height / 2) 431 | duration = TimeInterval(abs(distance * 0.2)) 432 | state = .expanded 433 | } else { 434 | // Scroll up 435 | delta = frame.origin.y + deltaLimit 436 | let distance = delta / (frame.size.height / 2) 437 | duration = TimeInterval(abs(distance * 0.2)) 438 | state = .collapsed 439 | } 440 | 441 | delayDistance = maxDelay 442 | 443 | UIView.animate(withDuration: duration, delay: 0, options: UIViewAnimationOptions.beginFromCurrentState, animations: { 444 | self.updateSizing(delta) 445 | self.updateFollowers(delta) 446 | self.updateNavbarAlpha() 447 | self.updateContentInset(delta) 448 | }, completion: nil) 449 | } 450 | 451 | private func updateNavbarAlpha() { 452 | guard let navigationItem = topViewController?.navigationItem else { return } 453 | 454 | let frame = navigationBar.frame 455 | 456 | // Change the alpha channel of every item on the navbr 457 | let alpha = (frame.origin.y + deltaLimit) / frame.size.height 458 | 459 | // Hide all the possible titles 460 | navigationItem.titleView?.alpha = alpha 461 | navigationBar.tintColor = navigationBar.tintColor.withAlphaComponent(alpha) 462 | if let titleColor = navigationBar.titleTextAttributes?[NSAttributedStringKey.foregroundColor] as? UIColor { 463 | navigationBar.titleTextAttributes?[NSAttributedStringKey.foregroundColor] = titleColor.withAlphaComponent(alpha) 464 | } else { 465 | navigationBar.titleTextAttributes?[NSAttributedStringKey.foregroundColor] = UIColor.black.withAlphaComponent(alpha) 466 | } 467 | 468 | // Hide all possible button items and navigation items 469 | func shouldHideView(_ view: UIView) -> Bool { 470 | let className = view.classForCoder.description().replacingOccurrences(of: "_", with: "") 471 | var viewNames = ["UINavigationButton", "UINavigationItemView", "UIImageView", "UISegmentedControl"] 472 | if #available(iOS 11.0, *) { 473 | viewNames.append(navigationBar.prefersLargeTitles ? "UINavigationBarLargeTitleView" : "UINavigationBarContentView") 474 | } else { 475 | viewNames.append("UINavigationBarContentView") 476 | } 477 | return viewNames.contains(className) 478 | } 479 | 480 | func setAlphaOfSubviews(view: UIView, alpha: CGFloat) { 481 | view.alpha = alpha 482 | view.subviews.forEach { setAlphaOfSubviews(view: $0, alpha: alpha) } 483 | } 484 | 485 | navigationBar.subviews 486 | .filter(shouldHideView) 487 | .forEach { setAlphaOfSubviews(view: $0, alpha: alpha) } 488 | 489 | // Hide the left items 490 | navigationItem.leftBarButtonItem?.customView?.alpha = alpha 491 | navigationItem.leftBarButtonItems?.forEach { $0.customView?.alpha = alpha } 492 | 493 | // Hide the right items 494 | navigationItem.rightBarButtonItem?.customView?.alpha = alpha 495 | navigationItem.rightBarButtonItems?.forEach { $0.customView?.alpha = alpha } 496 | } 497 | 498 | // MARK: - UIGestureRecognizerDelegate 499 | 500 | /** 501 | UIGestureRecognizerDelegate function. Begin scrolling only if the direction is vertical (prevents conflicts with horizontal scroll views) 502 | */ 503 | open func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { 504 | guard let gestureRecognizer = gestureRecognizer as? UIPanGestureRecognizer else { return true } 505 | let velocity = gestureRecognizer.velocity(in: gestureRecognizer.view) 506 | return fabs(velocity.y) > fabs(velocity.x) 507 | } 508 | 509 | /** 510 | UIGestureRecognizerDelegate function. Enables the scrolling of both the content and the navigation bar 511 | */ 512 | open func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { 513 | return true 514 | } 515 | 516 | /** 517 | UIGestureRecognizerDelegate function. Only scrolls the navigation bar with the content when `scrollingEnabled` is true 518 | */ 519 | open func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { 520 | return scrollingEnabled 521 | } 522 | 523 | deinit { 524 | NotificationCenter.default.removeObserver(self) 525 | } 526 | 527 | } 528 | -------------------------------------------------------------------------------- /Demo/Pods/AMScrollingNavbar/Source/ScrollingNavigationViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | /** 4 | A custom `UIViewController` that implements the base configuration. 5 | */ 6 | open class ScrollingNavigationViewController: UIViewController, UIScrollViewDelegate, UINavigationControllerDelegate { 7 | 8 | // MARK: - ScrollView config 9 | 10 | /** 11 | On appear calls `showNavbar()` by default 12 | */ 13 | override open func viewWillAppear(_ animated: Bool) { 14 | super.viewWillAppear(animated) 15 | 16 | if let navigationController = self.navigationController as? ScrollingNavigationController { 17 | navigationController.showNavbar(animated: true) 18 | } 19 | } 20 | 21 | /** 22 | On disappear calls `stopFollowingScrollView()` to stop observing the current scroll view, and perform the tear down 23 | */ 24 | override open func viewWillDisappear(_ animated: Bool) { 25 | super.viewWillDisappear(animated) 26 | 27 | if let navigationController = self.navigationController as? ScrollingNavigationController { 28 | navigationController.stopFollowingScrollView() 29 | } 30 | } 31 | 32 | /** 33 | Calls `showNavbar()` when a `scrollToTop` is requested 34 | */ 35 | open func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool { 36 | if let navigationController = self.navigationController as? ScrollingNavigationController { 37 | navigationController.showNavbar(animated: true) 38 | } 39 | return true 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /Demo/Pods/Local Podspecs/AMScrollingNavbar.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AMScrollingNavbar", 3 | "version": "5.0.4", 4 | "summary": "A custom UINavigationController that enables the scrolling of the navigation bar alongside the scrolling of an observed content view", 5 | "description": "A custom UINavigationController that enables the scrolling of the\nnavigation bar alongisde the scrolling of the observed view's content.", 6 | "homepage": "https://github.com/andreamazz/AMScrollingNavbar", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "Andrea Mazzini": "andrea.mazzini@gmail.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/andreamazz/AMScrollingNavbar.git", 16 | "tag": "5.0.4" 17 | }, 18 | "platforms": { 19 | "ios": "8.0" 20 | }, 21 | "source_files": [ 22 | "Source", 23 | "*.{swift}" 24 | ], 25 | "requires_arc": true, 26 | "swift_version": "4.2", 27 | "social_media_url": "https://twitter.com/theandreamazz" 28 | } 29 | -------------------------------------------------------------------------------- /Demo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AMScrollingNavbar (5.0.4) 3 | 4 | DEPENDENCIES: 5 | - AMScrollingNavbar (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | AMScrollingNavbar: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | AMScrollingNavbar: 85f694557595138626cdcf4a2103411d1928bb2a 13 | 14 | PODFILE CHECKSUM: 0f0a96dab8d2652fa45ba1e24893191416c0d5a7 15 | 16 | COCOAPODS: 1.5.0 17 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/AMScrollingNavbar/AMScrollingNavbar-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AMScrollingNavbar : NSObject 3 | @end 4 | @implementation PodsDummy_AMScrollingNavbar 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/AMScrollingNavbar/AMScrollingNavbar-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/AMScrollingNavbar/AMScrollingNavbar-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double AMScrollingNavbarVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char AMScrollingNavbarVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/AMScrollingNavbar/AMScrollingNavbar.modulemap: -------------------------------------------------------------------------------- 1 | framework module AMScrollingNavbar { 2 | umbrella header "AMScrollingNavbar-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/AMScrollingNavbar/AMScrollingNavbar.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AMScrollingNavbar 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/AMScrollingNavbar/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 5.0.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AMScrollingNavbar 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2013 Andrea Mazzini 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | this software and associated documentation files (the "Software"), to deal in 12 | the Software without restriction, including without limitation the rights to 13 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | the Software, and to permit persons to whom the Software is furnished to do so, 15 | subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | Generated by CocoaPods - https://cocoapods.org 28 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2013 Andrea Mazzini 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy of 22 | this software and associated documentation files (the "Software"), to deal in 23 | the Software without restriction, including without limitation the rights to 24 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 25 | the Software, and to permit persons to whom the Software is furnished to do so, 26 | subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 33 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 34 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 35 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 36 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | 38 | License 39 | MIT 40 | Title 41 | AMScrollingNavbar 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | FooterText 47 | Generated by CocoaPods - https://cocoapods.org 48 | Title 49 | 50 | Type 51 | PSGroupSpecifier 52 | 53 | 54 | StringsTable 55 | Acknowledgements 56 | Title 57 | Acknowledgements 58 | 59 | 60 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ScrollingNavbarDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ScrollingNavbarDemo 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | 145 | if [[ "$CONFIGURATION" == "Debug" ]]; then 146 | install_framework "${BUILT_PRODUCTS_DIR}/AMScrollingNavbar/AMScrollingNavbar.framework" 147 | fi 148 | if [[ "$CONFIGURATION" == "Release" ]]; then 149 | install_framework "${BUILT_PRODUCTS_DIR}/AMScrollingNavbar/AMScrollingNavbar.framework" 150 | fi 151 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 152 | wait 153 | fi 154 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_BUILD_DIR}/assetcatalog_generated_info.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ScrollingNavbarDemoVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ScrollingNavbarDemoVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AMScrollingNavbar" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AMScrollingNavbar/AMScrollingNavbar.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "AMScrollingNavbar" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ScrollingNavbarDemo { 2 | umbrella header "Pods-ScrollingNavbarDemo-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AMScrollingNavbar" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AMScrollingNavbar/AMScrollingNavbar.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "AMScrollingNavbar" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AMScrollingNavbar 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2013 Andrea Mazzini 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | this software and associated documentation files (the "Software"), to deal in 12 | the Software without restriction, including without limitation the rights to 13 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | the Software, and to permit persons to whom the Software is furnished to do so, 15 | subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | Generated by CocoaPods - https://cocoapods.org 28 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2013 Andrea Mazzini 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy of 22 | this software and associated documentation files (the "Software"), to deal in 23 | the Software without restriction, including without limitation the rights to 24 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 25 | the Software, and to permit persons to whom the Software is furnished to do so, 26 | subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 33 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 34 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 35 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 36 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | 38 | License 39 | MIT 40 | Title 41 | AMScrollingNavbar 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | FooterText 47 | Generated by CocoaPods - https://cocoapods.org 48 | Title 49 | 50 | Type 51 | PSGroupSpecifier 52 | 53 | 54 | StringsTable 55 | Acknowledgements 56 | Title 57 | Acknowledgements 58 | 59 | 60 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ScrollingNavbarDemoTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ScrollingNavbarDemoTests 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | 145 | if [[ "$CONFIGURATION" == "Debug" ]]; then 146 | install_framework "${BUILT_PRODUCTS_DIR}/AMScrollingNavbar/AMScrollingNavbar.framework" 147 | fi 148 | if [[ "$CONFIGURATION" == "Release" ]]; then 149 | install_framework "${BUILT_PRODUCTS_DIR}/AMScrollingNavbar/AMScrollingNavbar.framework" 150 | fi 151 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 152 | wait 153 | fi 154 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_BUILD_DIR}/assetcatalog_generated_info.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ScrollingNavbarDemoTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ScrollingNavbarDemoTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AMScrollingNavbar" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AMScrollingNavbar/AMScrollingNavbar.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "AMScrollingNavbar" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ScrollingNavbarDemoTests { 2 | umbrella header "Pods-ScrollingNavbarDemoTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AMScrollingNavbar" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AMScrollingNavbar/AMScrollingNavbar.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "AMScrollingNavbar" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3EAC714EF2EE931D67218238 /* Pods_ScrollingNavbarDemoTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB6FF01647A43FEABE04BE8C /* Pods_ScrollingNavbarDemoTests.framework */; }; 11 | 65299CB120EBB0F40034C209 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 65299CB020EBB0F40034C209 /* index.html */; }; 12 | 652AA8411C80460400FDC96F /* CollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 652AA8401C80460400FDC96F /* CollectionViewCell.swift */; }; 13 | 652AA8431C80468A00FDC96F /* CollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 652AA8421C80468A00FDC96F /* CollectionViewController.swift */; }; 14 | 652BE2D41B62805C00DE75C7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 652BE2D31B62805C00DE75C7 /* AppDelegate.swift */; }; 15 | 652BE2D61B62805C00DE75C7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 652BE2D51B62805C00DE75C7 /* ViewController.swift */; }; 16 | 652BE2D91B62805C00DE75C7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 652BE2D71B62805C00DE75C7 /* Main.storyboard */; }; 17 | 652BE2DB1B62805C00DE75C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 652BE2DA1B62805C00DE75C7 /* Images.xcassets */; }; 18 | 652BE2DE1B62805C00DE75C7 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 652BE2DC1B62805C00DE75C7 /* LaunchScreen.xib */; }; 19 | 652BE2EA1B62805D00DE75C7 /* ScrollingNavbarDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 652BE2E91B62805D00DE75C7 /* ScrollingNavbarDemoTests.swift */; }; 20 | 658AE0C71FAC7C2500A9B188 /* LargeTitleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658AE0C61FAC7C2500A9B188 /* LargeTitleViewController.swift */; }; 21 | 658FA1721B836D9C00EB32A4 /* ScrollViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658FA1711B836D9C00EB32A4 /* ScrollViewController.swift */; }; 22 | 658FA1781B837C6100EB32A4 /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658FA1771B837C6100EB32A4 /* TableViewController.swift */; }; 23 | 658FA17A1B8386EB00EB32A4 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658FA1791B8386EB00EB32A4 /* WebViewController.swift */; }; 24 | 65E5DFE821490DD7008BF7ED /* TestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65E5DFE721490DD7008BF7ED /* TestViewController.swift */; }; 25 | D9240E5EF587B34FF333320F /* Pods_ScrollingNavbarDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F99C3A504E979DBB401763E0 /* Pods_ScrollingNavbarDemo.framework */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 652BE2E41B62805D00DE75C7 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 652BE2C61B62805C00DE75C7 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 652BE2CD1B62805C00DE75C7; 34 | remoteInfo = ScrollingNavbarDemo; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 1E6B1D01D640F0DDFA6A7BC6 /* Pods-ScrollingNavbarDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ScrollingNavbarDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo.release.xcconfig"; sourceTree = ""; }; 40 | 2E73B5E68EC0D0B60A270B2B /* Pods-ScrollingNavbarDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ScrollingNavbarDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo.debug.xcconfig"; sourceTree = ""; }; 41 | 419E4C1BCB2040931AB9295F /* Pods-ScrollingNavbarDemoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ScrollingNavbarDemoTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests.debug.xcconfig"; sourceTree = ""; }; 42 | 65299CB020EBB0F40034C209 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; 43 | 652AA8401C80460400FDC96F /* CollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewCell.swift; sourceTree = ""; }; 44 | 652AA8421C80468A00FDC96F /* CollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewController.swift; sourceTree = ""; }; 45 | 652BE2CE1B62805C00DE75C7 /* ScrollingNavbarDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScrollingNavbarDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 652BE2D21B62805C00DE75C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 652BE2D31B62805C00DE75C7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 48 | 652BE2D51B62805C00DE75C7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ViewController.swift; path = ../ViewController.swift; sourceTree = ""; }; 49 | 652BE2D81B62805C00DE75C7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 652BE2DA1B62805C00DE75C7 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 51 | 652BE2DD1B62805C00DE75C7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 52 | 652BE2E31B62805D00DE75C7 /* ScrollingNavbarDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ScrollingNavbarDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 652BE2E81B62805D00DE75C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 652BE2E91B62805D00DE75C7 /* ScrollingNavbarDemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollingNavbarDemoTests.swift; sourceTree = ""; }; 55 | 658AE0C61FAC7C2500A9B188 /* LargeTitleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LargeTitleViewController.swift; sourceTree = ""; }; 56 | 658FA1711B836D9C00EB32A4 /* ScrollViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScrollViewController.swift; sourceTree = ""; }; 57 | 658FA1771B837C6100EB32A4 /* TableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = ""; }; 58 | 658FA1791B8386EB00EB32A4 /* WebViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = ""; }; 59 | 65E5DFE721490DD7008BF7ED /* TestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestViewController.swift; sourceTree = ""; }; 60 | 77FCB6AA06C22CA3F9E35B04 /* Pods-ScrollingNavbarDemoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ScrollingNavbarDemoTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests.release.xcconfig"; sourceTree = ""; }; 61 | CB6FF01647A43FEABE04BE8C /* Pods_ScrollingNavbarDemoTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ScrollingNavbarDemoTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | F99C3A504E979DBB401763E0 /* Pods_ScrollingNavbarDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ScrollingNavbarDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 652BE2CB1B62805C00DE75C7 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | D9240E5EF587B34FF333320F /* Pods_ScrollingNavbarDemo.framework in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | 652BE2E01B62805D00DE75C7 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | 3EAC714EF2EE931D67218238 /* Pods_ScrollingNavbarDemoTests.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 652BE2C51B62805C00DE75C7 = { 86 | isa = PBXGroup; 87 | children = ( 88 | 652BE2D01B62805C00DE75C7 /* ScrollingNavbarDemo */, 89 | 652BE2E61B62805D00DE75C7 /* ScrollingNavbarDemoTests */, 90 | 652BE2CF1B62805C00DE75C7 /* Products */, 91 | FA66D4CC6DCE1684FB61866F /* Pods */, 92 | B1539338F9A059FBFFC260EC /* Frameworks */, 93 | ); 94 | indentWidth = 2; 95 | sourceTree = ""; 96 | tabWidth = 2; 97 | }; 98 | 652BE2CF1B62805C00DE75C7 /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 652BE2CE1B62805C00DE75C7 /* ScrollingNavbarDemo.app */, 102 | 652BE2E31B62805D00DE75C7 /* ScrollingNavbarDemoTests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 652BE2D01B62805C00DE75C7 /* ScrollingNavbarDemo */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 65A2F2121BE500AF00CC2490 /* Resources */, 111 | 658FA1701B836D9100EB32A4 /* ViewControllers */, 112 | 652BE2D31B62805C00DE75C7 /* AppDelegate.swift */, 113 | 652BE2D11B62805C00DE75C7 /* Supporting Files */, 114 | ); 115 | path = ScrollingNavbarDemo; 116 | sourceTree = ""; 117 | }; 118 | 652BE2D11B62805C00DE75C7 /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 652BE2D21B62805C00DE75C7 /* Info.plist */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | 652BE2E61B62805D00DE75C7 /* ScrollingNavbarDemoTests */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 652BE2E91B62805D00DE75C7 /* ScrollingNavbarDemoTests.swift */, 130 | 652BE2E71B62805D00DE75C7 /* Supporting Files */, 131 | ); 132 | path = ScrollingNavbarDemoTests; 133 | sourceTree = ""; 134 | }; 135 | 652BE2E71B62805D00DE75C7 /* Supporting Files */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 652BE2E81B62805D00DE75C7 /* Info.plist */, 139 | ); 140 | name = "Supporting Files"; 141 | sourceTree = ""; 142 | }; 143 | 658FA1701B836D9100EB32A4 /* ViewControllers */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 652BE2D51B62805C00DE75C7 /* ViewController.swift */, 147 | 658FA1711B836D9C00EB32A4 /* ScrollViewController.swift */, 148 | 658FA1771B837C6100EB32A4 /* TableViewController.swift */, 149 | 658FA1791B8386EB00EB32A4 /* WebViewController.swift */, 150 | 652AA8421C80468A00FDC96F /* CollectionViewController.swift */, 151 | 658AE0C61FAC7C2500A9B188 /* LargeTitleViewController.swift */, 152 | 65E5DFE721490DD7008BF7ED /* TestViewController.swift */, 153 | ); 154 | path = ViewControllers; 155 | sourceTree = ""; 156 | }; 157 | 65A2F2121BE500AF00CC2490 /* Resources */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | 65299CB020EBB0F40034C209 /* index.html */, 161 | 652BE2D71B62805C00DE75C7 /* Main.storyboard */, 162 | 652BE2DA1B62805C00DE75C7 /* Images.xcassets */, 163 | 652BE2DC1B62805C00DE75C7 /* LaunchScreen.xib */, 164 | 652AA8401C80460400FDC96F /* CollectionViewCell.swift */, 165 | ); 166 | name = Resources; 167 | sourceTree = ""; 168 | }; 169 | B1539338F9A059FBFFC260EC /* Frameworks */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | F99C3A504E979DBB401763E0 /* Pods_ScrollingNavbarDemo.framework */, 173 | CB6FF01647A43FEABE04BE8C /* Pods_ScrollingNavbarDemoTests.framework */, 174 | ); 175 | name = Frameworks; 176 | sourceTree = ""; 177 | }; 178 | FA66D4CC6DCE1684FB61866F /* Pods */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | 2E73B5E68EC0D0B60A270B2B /* Pods-ScrollingNavbarDemo.debug.xcconfig */, 182 | 1E6B1D01D640F0DDFA6A7BC6 /* Pods-ScrollingNavbarDemo.release.xcconfig */, 183 | 419E4C1BCB2040931AB9295F /* Pods-ScrollingNavbarDemoTests.debug.xcconfig */, 184 | 77FCB6AA06C22CA3F9E35B04 /* Pods-ScrollingNavbarDemoTests.release.xcconfig */, 185 | ); 186 | name = Pods; 187 | sourceTree = ""; 188 | }; 189 | /* End PBXGroup section */ 190 | 191 | /* Begin PBXNativeTarget section */ 192 | 652BE2CD1B62805C00DE75C7 /* ScrollingNavbarDemo */ = { 193 | isa = PBXNativeTarget; 194 | buildConfigurationList = 652BE2ED1B62805D00DE75C7 /* Build configuration list for PBXNativeTarget "ScrollingNavbarDemo" */; 195 | buildPhases = ( 196 | D88DF1C3B9382ADAF4250414 /* [CP] Check Pods Manifest.lock */, 197 | 652BE2CA1B62805C00DE75C7 /* Sources */, 198 | 652BE2CB1B62805C00DE75C7 /* Frameworks */, 199 | 652BE2CC1B62805C00DE75C7 /* Resources */, 200 | 2FB89EADB8F37D81E7A9CAFE /* [CP] Embed Pods Frameworks */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | ); 206 | name = ScrollingNavbarDemo; 207 | productName = ScrollingNavbarDemo; 208 | productReference = 652BE2CE1B62805C00DE75C7 /* ScrollingNavbarDemo.app */; 209 | productType = "com.apple.product-type.application"; 210 | }; 211 | 652BE2E21B62805D00DE75C7 /* ScrollingNavbarDemoTests */ = { 212 | isa = PBXNativeTarget; 213 | buildConfigurationList = 652BE2F01B62805D00DE75C7 /* Build configuration list for PBXNativeTarget "ScrollingNavbarDemoTests" */; 214 | buildPhases = ( 215 | EBBC386EEC066547B2F600C8 /* [CP] Check Pods Manifest.lock */, 216 | 652BE2DF1B62805D00DE75C7 /* Sources */, 217 | 652BE2E01B62805D00DE75C7 /* Frameworks */, 218 | 652BE2E11B62805D00DE75C7 /* Resources */, 219 | D8E41765AAB1AFA3B907BFFE /* [CP] Embed Pods Frameworks */, 220 | ); 221 | buildRules = ( 222 | ); 223 | dependencies = ( 224 | 652BE2E51B62805D00DE75C7 /* PBXTargetDependency */, 225 | ); 226 | name = ScrollingNavbarDemoTests; 227 | productName = ScrollingNavbarDemoTests; 228 | productReference = 652BE2E31B62805D00DE75C7 /* ScrollingNavbarDemoTests.xctest */; 229 | productType = "com.apple.product-type.bundle.unit-test"; 230 | }; 231 | /* End PBXNativeTarget section */ 232 | 233 | /* Begin PBXProject section */ 234 | 652BE2C61B62805C00DE75C7 /* Project object */ = { 235 | isa = PBXProject; 236 | attributes = { 237 | LastSwiftUpdateCheck = 0700; 238 | LastUpgradeCheck = 0930; 239 | ORGANIZATIONNAME = "Fancy Pixel"; 240 | TargetAttributes = { 241 | 652BE2CD1B62805C00DE75C7 = { 242 | CreatedOnToolsVersion = 6.4; 243 | DevelopmentTeam = H72GR44F4M; 244 | LastSwiftMigration = 0900; 245 | ProvisioningStyle = Automatic; 246 | }; 247 | 652BE2E21B62805D00DE75C7 = { 248 | CreatedOnToolsVersion = 6.4; 249 | LastSwiftMigration = 0900; 250 | TestTargetID = 652BE2CD1B62805C00DE75C7; 251 | }; 252 | }; 253 | }; 254 | buildConfigurationList = 652BE2C91B62805C00DE75C7 /* Build configuration list for PBXProject "ScrollingNavbarDemo" */; 255 | compatibilityVersion = "Xcode 3.2"; 256 | developmentRegion = English; 257 | hasScannedForEncodings = 0; 258 | knownRegions = ( 259 | English, 260 | en, 261 | Base, 262 | ); 263 | mainGroup = 652BE2C51B62805C00DE75C7; 264 | productRefGroup = 652BE2CF1B62805C00DE75C7 /* Products */; 265 | projectDirPath = ""; 266 | projectRoot = ""; 267 | targets = ( 268 | 652BE2CD1B62805C00DE75C7 /* ScrollingNavbarDemo */, 269 | 652BE2E21B62805D00DE75C7 /* ScrollingNavbarDemoTests */, 270 | ); 271 | }; 272 | /* End PBXProject section */ 273 | 274 | /* Begin PBXResourcesBuildPhase section */ 275 | 652BE2CC1B62805C00DE75C7 /* Resources */ = { 276 | isa = PBXResourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 652BE2D91B62805C00DE75C7 /* Main.storyboard in Resources */, 280 | 65299CB120EBB0F40034C209 /* index.html in Resources */, 281 | 652BE2DE1B62805C00DE75C7 /* LaunchScreen.xib in Resources */, 282 | 652BE2DB1B62805C00DE75C7 /* Images.xcassets in Resources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | 652BE2E11B62805D00DE75C7 /* Resources */ = { 287 | isa = PBXResourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | /* End PBXResourcesBuildPhase section */ 294 | 295 | /* Begin PBXShellScriptBuildPhase section */ 296 | 2FB89EADB8F37D81E7A9CAFE /* [CP] Embed Pods Frameworks */ = { 297 | isa = PBXShellScriptBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | ); 301 | inputPaths = ( 302 | "${SRCROOT}/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo-frameworks.sh", 303 | "${BUILT_PRODUCTS_DIR}/AMScrollingNavbar/AMScrollingNavbar.framework", 304 | ); 305 | name = "[CP] Embed Pods Frameworks"; 306 | outputPaths = ( 307 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AMScrollingNavbar.framework", 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | shellPath = /bin/sh; 311 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ScrollingNavbarDemo/Pods-ScrollingNavbarDemo-frameworks.sh\"\n"; 312 | showEnvVarsInLog = 0; 313 | }; 314 | D88DF1C3B9382ADAF4250414 /* [CP] Check Pods Manifest.lock */ = { 315 | isa = PBXShellScriptBuildPhase; 316 | buildActionMask = 2147483647; 317 | files = ( 318 | ); 319 | inputPaths = ( 320 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 321 | "${PODS_ROOT}/Manifest.lock", 322 | ); 323 | name = "[CP] Check Pods Manifest.lock"; 324 | outputPaths = ( 325 | "$(DERIVED_FILE_DIR)/Pods-ScrollingNavbarDemo-checkManifestLockResult.txt", 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | shellPath = /bin/sh; 329 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 330 | showEnvVarsInLog = 0; 331 | }; 332 | D8E41765AAB1AFA3B907BFFE /* [CP] Embed Pods Frameworks */ = { 333 | isa = PBXShellScriptBuildPhase; 334 | buildActionMask = 2147483647; 335 | files = ( 336 | ); 337 | inputPaths = ( 338 | "${SRCROOT}/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests-frameworks.sh", 339 | "${BUILT_PRODUCTS_DIR}/AMScrollingNavbar/AMScrollingNavbar.framework", 340 | ); 341 | name = "[CP] Embed Pods Frameworks"; 342 | outputPaths = ( 343 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AMScrollingNavbar.framework", 344 | ); 345 | runOnlyForDeploymentPostprocessing = 0; 346 | shellPath = /bin/sh; 347 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ScrollingNavbarDemoTests/Pods-ScrollingNavbarDemoTests-frameworks.sh\"\n"; 348 | showEnvVarsInLog = 0; 349 | }; 350 | EBBC386EEC066547B2F600C8 /* [CP] Check Pods Manifest.lock */ = { 351 | isa = PBXShellScriptBuildPhase; 352 | buildActionMask = 2147483647; 353 | files = ( 354 | ); 355 | inputPaths = ( 356 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 357 | "${PODS_ROOT}/Manifest.lock", 358 | ); 359 | name = "[CP] Check Pods Manifest.lock"; 360 | outputPaths = ( 361 | "$(DERIVED_FILE_DIR)/Pods-ScrollingNavbarDemoTests-checkManifestLockResult.txt", 362 | ); 363 | runOnlyForDeploymentPostprocessing = 0; 364 | shellPath = /bin/sh; 365 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 366 | showEnvVarsInLog = 0; 367 | }; 368 | /* End PBXShellScriptBuildPhase section */ 369 | 370 | /* Begin PBXSourcesBuildPhase section */ 371 | 652BE2CA1B62805C00DE75C7 /* Sources */ = { 372 | isa = PBXSourcesBuildPhase; 373 | buildActionMask = 2147483647; 374 | files = ( 375 | 652BE2D61B62805C00DE75C7 /* ViewController.swift in Sources */, 376 | 658FA1721B836D9C00EB32A4 /* ScrollViewController.swift in Sources */, 377 | 652AA8411C80460400FDC96F /* CollectionViewCell.swift in Sources */, 378 | 652BE2D41B62805C00DE75C7 /* AppDelegate.swift in Sources */, 379 | 652AA8431C80468A00FDC96F /* CollectionViewController.swift in Sources */, 380 | 658AE0C71FAC7C2500A9B188 /* LargeTitleViewController.swift in Sources */, 381 | 658FA17A1B8386EB00EB32A4 /* WebViewController.swift in Sources */, 382 | 65E5DFE821490DD7008BF7ED /* TestViewController.swift in Sources */, 383 | 658FA1781B837C6100EB32A4 /* TableViewController.swift in Sources */, 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | }; 387 | 652BE2DF1B62805D00DE75C7 /* Sources */ = { 388 | isa = PBXSourcesBuildPhase; 389 | buildActionMask = 2147483647; 390 | files = ( 391 | 652BE2EA1B62805D00DE75C7 /* ScrollingNavbarDemoTests.swift in Sources */, 392 | ); 393 | runOnlyForDeploymentPostprocessing = 0; 394 | }; 395 | /* End PBXSourcesBuildPhase section */ 396 | 397 | /* Begin PBXTargetDependency section */ 398 | 652BE2E51B62805D00DE75C7 /* PBXTargetDependency */ = { 399 | isa = PBXTargetDependency; 400 | target = 652BE2CD1B62805C00DE75C7 /* ScrollingNavbarDemo */; 401 | targetProxy = 652BE2E41B62805D00DE75C7 /* PBXContainerItemProxy */; 402 | }; 403 | /* End PBXTargetDependency section */ 404 | 405 | /* Begin PBXVariantGroup section */ 406 | 652BE2D71B62805C00DE75C7 /* Main.storyboard */ = { 407 | isa = PBXVariantGroup; 408 | children = ( 409 | 652BE2D81B62805C00DE75C7 /* Base */, 410 | ); 411 | name = Main.storyboard; 412 | sourceTree = ""; 413 | }; 414 | 652BE2DC1B62805C00DE75C7 /* LaunchScreen.xib */ = { 415 | isa = PBXVariantGroup; 416 | children = ( 417 | 652BE2DD1B62805C00DE75C7 /* Base */, 418 | ); 419 | name = LaunchScreen.xib; 420 | sourceTree = ""; 421 | }; 422 | /* End PBXVariantGroup section */ 423 | 424 | /* Begin XCBuildConfiguration section */ 425 | 652BE2EB1B62805D00DE75C7 /* Debug */ = { 426 | isa = XCBuildConfiguration; 427 | buildSettings = { 428 | ALWAYS_SEARCH_USER_PATHS = NO; 429 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 430 | CLANG_CXX_LIBRARY = "libc++"; 431 | CLANG_ENABLE_MODULES = YES; 432 | CLANG_ENABLE_OBJC_ARC = YES; 433 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 434 | CLANG_WARN_BOOL_CONVERSION = YES; 435 | CLANG_WARN_COMMA = YES; 436 | CLANG_WARN_CONSTANT_CONVERSION = YES; 437 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 438 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 439 | CLANG_WARN_EMPTY_BODY = YES; 440 | CLANG_WARN_ENUM_CONVERSION = YES; 441 | CLANG_WARN_INFINITE_RECURSION = YES; 442 | CLANG_WARN_INT_CONVERSION = YES; 443 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 444 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 445 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 446 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 447 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 448 | CLANG_WARN_STRICT_PROTOTYPES = YES; 449 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 450 | CLANG_WARN_UNREACHABLE_CODE = YES; 451 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 452 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 453 | COPY_PHASE_STRIP = NO; 454 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 455 | ENABLE_STRICT_OBJC_MSGSEND = YES; 456 | ENABLE_TESTABILITY = YES; 457 | GCC_C_LANGUAGE_STANDARD = gnu99; 458 | GCC_DYNAMIC_NO_PIC = NO; 459 | GCC_NO_COMMON_BLOCKS = YES; 460 | GCC_OPTIMIZATION_LEVEL = 0; 461 | GCC_PREPROCESSOR_DEFINITIONS = ( 462 | "DEBUG=1", 463 | "$(inherited)", 464 | ); 465 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 466 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 467 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 468 | GCC_WARN_UNDECLARED_SELECTOR = YES; 469 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 470 | GCC_WARN_UNUSED_FUNCTION = YES; 471 | GCC_WARN_UNUSED_VARIABLE = YES; 472 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 473 | MTL_ENABLE_DEBUG_INFO = YES; 474 | ONLY_ACTIVE_ARCH = YES; 475 | SDKROOT = iphoneos; 476 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 477 | SWIFT_VERSION = 4.0; 478 | }; 479 | name = Debug; 480 | }; 481 | 652BE2EC1B62805D00DE75C7 /* Release */ = { 482 | isa = XCBuildConfiguration; 483 | buildSettings = { 484 | ALWAYS_SEARCH_USER_PATHS = NO; 485 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 486 | CLANG_CXX_LIBRARY = "libc++"; 487 | CLANG_ENABLE_MODULES = YES; 488 | CLANG_ENABLE_OBJC_ARC = YES; 489 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 490 | CLANG_WARN_BOOL_CONVERSION = YES; 491 | CLANG_WARN_COMMA = YES; 492 | CLANG_WARN_CONSTANT_CONVERSION = YES; 493 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 494 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 495 | CLANG_WARN_EMPTY_BODY = YES; 496 | CLANG_WARN_ENUM_CONVERSION = YES; 497 | CLANG_WARN_INFINITE_RECURSION = YES; 498 | CLANG_WARN_INT_CONVERSION = YES; 499 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 500 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 501 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 502 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 503 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 504 | CLANG_WARN_STRICT_PROTOTYPES = YES; 505 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 506 | CLANG_WARN_UNREACHABLE_CODE = YES; 507 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 508 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 509 | COPY_PHASE_STRIP = NO; 510 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 511 | ENABLE_NS_ASSERTIONS = NO; 512 | ENABLE_STRICT_OBJC_MSGSEND = YES; 513 | GCC_C_LANGUAGE_STANDARD = gnu99; 514 | GCC_NO_COMMON_BLOCKS = YES; 515 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 516 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 517 | GCC_WARN_UNDECLARED_SELECTOR = YES; 518 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 519 | GCC_WARN_UNUSED_FUNCTION = YES; 520 | GCC_WARN_UNUSED_VARIABLE = YES; 521 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 522 | MTL_ENABLE_DEBUG_INFO = NO; 523 | SDKROOT = iphoneos; 524 | SWIFT_VERSION = 4.0; 525 | VALIDATE_PRODUCT = YES; 526 | }; 527 | name = Release; 528 | }; 529 | 652BE2EE1B62805D00DE75C7 /* Debug */ = { 530 | isa = XCBuildConfiguration; 531 | baseConfigurationReference = 2E73B5E68EC0D0B60A270B2B /* Pods-ScrollingNavbarDemo.debug.xcconfig */; 532 | buildSettings = { 533 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 534 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 535 | CODE_SIGN_IDENTITY = "Apple Development"; 536 | CODE_SIGN_STYLE = Automatic; 537 | DEVELOPMENT_TEAM = ""; 538 | INFOPLIST_FILE = ScrollingNavbarDemo/Info.plist; 539 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 540 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 541 | PRODUCT_BUNDLE_IDENTIFIER = "it.fancypixel.$(PRODUCT_NAME:rfc1034identifier)"; 542 | PRODUCT_NAME = "$(TARGET_NAME)"; 543 | PROVISIONING_PROFILE_SPECIFIER = ""; 544 | SWIFT_COMPILATION_MODE = wholemodule; 545 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 546 | SWIFT_VERSION = 4.0; 547 | TARGETED_DEVICE_FAMILY = "1,2"; 548 | }; 549 | name = Debug; 550 | }; 551 | 652BE2EF1B62805D00DE75C7 /* Release */ = { 552 | isa = XCBuildConfiguration; 553 | baseConfigurationReference = 1E6B1D01D640F0DDFA6A7BC6 /* Pods-ScrollingNavbarDemo.release.xcconfig */; 554 | buildSettings = { 555 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 556 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 557 | CODE_SIGN_IDENTITY = "Apple Development"; 558 | CODE_SIGN_STYLE = Automatic; 559 | DEVELOPMENT_TEAM = ""; 560 | INFOPLIST_FILE = ScrollingNavbarDemo/Info.plist; 561 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 562 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 563 | PRODUCT_BUNDLE_IDENTIFIER = "it.fancypixel.$(PRODUCT_NAME:rfc1034identifier)"; 564 | PRODUCT_NAME = "$(TARGET_NAME)"; 565 | PROVISIONING_PROFILE_SPECIFIER = ""; 566 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 567 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 568 | SWIFT_VERSION = 4.0; 569 | TARGETED_DEVICE_FAMILY = "1,2"; 570 | }; 571 | name = Release; 572 | }; 573 | 652BE2F11B62805D00DE75C7 /* Debug */ = { 574 | isa = XCBuildConfiguration; 575 | baseConfigurationReference = 419E4C1BCB2040931AB9295F /* Pods-ScrollingNavbarDemoTests.debug.xcconfig */; 576 | buildSettings = { 577 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 578 | BUNDLE_LOADER = "$(TEST_HOST)"; 579 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 580 | GCC_PREPROCESSOR_DEFINITIONS = ( 581 | "DEBUG=1", 582 | "$(inherited)", 583 | ); 584 | INFOPLIST_FILE = ScrollingNavbarDemoTests/Info.plist; 585 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 586 | PRODUCT_BUNDLE_IDENTIFIER = "it.fancypixel.$(PRODUCT_NAME:rfc1034identifier)"; 587 | PRODUCT_NAME = "$(TARGET_NAME)"; 588 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 589 | SWIFT_VERSION = 4.0; 590 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ScrollingNavbarDemo.app/ScrollingNavbarDemo"; 591 | }; 592 | name = Debug; 593 | }; 594 | 652BE2F21B62805D00DE75C7 /* Release */ = { 595 | isa = XCBuildConfiguration; 596 | baseConfigurationReference = 77FCB6AA06C22CA3F9E35B04 /* Pods-ScrollingNavbarDemoTests.release.xcconfig */; 597 | buildSettings = { 598 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 599 | BUNDLE_LOADER = "$(TEST_HOST)"; 600 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 601 | INFOPLIST_FILE = ScrollingNavbarDemoTests/Info.plist; 602 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 603 | PRODUCT_BUNDLE_IDENTIFIER = "it.fancypixel.$(PRODUCT_NAME:rfc1034identifier)"; 604 | PRODUCT_NAME = "$(TARGET_NAME)"; 605 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 606 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 607 | SWIFT_VERSION = 4.0; 608 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ScrollingNavbarDemo.app/ScrollingNavbarDemo"; 609 | }; 610 | name = Release; 611 | }; 612 | /* End XCBuildConfiguration section */ 613 | 614 | /* Begin XCConfigurationList section */ 615 | 652BE2C91B62805C00DE75C7 /* Build configuration list for PBXProject "ScrollingNavbarDemo" */ = { 616 | isa = XCConfigurationList; 617 | buildConfigurations = ( 618 | 652BE2EB1B62805D00DE75C7 /* Debug */, 619 | 652BE2EC1B62805D00DE75C7 /* Release */, 620 | ); 621 | defaultConfigurationIsVisible = 0; 622 | defaultConfigurationName = Release; 623 | }; 624 | 652BE2ED1B62805D00DE75C7 /* Build configuration list for PBXNativeTarget "ScrollingNavbarDemo" */ = { 625 | isa = XCConfigurationList; 626 | buildConfigurations = ( 627 | 652BE2EE1B62805D00DE75C7 /* Debug */, 628 | 652BE2EF1B62805D00DE75C7 /* Release */, 629 | ); 630 | defaultConfigurationIsVisible = 0; 631 | defaultConfigurationName = Release; 632 | }; 633 | 652BE2F01B62805D00DE75C7 /* Build configuration list for PBXNativeTarget "ScrollingNavbarDemoTests" */ = { 634 | isa = XCConfigurationList; 635 | buildConfigurations = ( 636 | 652BE2F11B62805D00DE75C7 /* Debug */, 637 | 652BE2F21B62805D00DE75C7 /* Release */, 638 | ); 639 | defaultConfigurationIsVisible = 0; 640 | defaultConfigurationName = Release; 641 | }; 642 | /* End XCConfigurationList section */ 643 | }; 644 | rootObject = 652BE2C61B62805C00DE75C7 /* Project object */; 645 | } 646 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo.xcodeproj/xcshareddata/xcschemes/ScrollingNavbarDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 79 | 81 | 87 | 88 | 89 | 90 | 91 | 92 | 98 | 100 | 106 | 107 | 108 | 109 | 111 | 112 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ScrollingNavbarDemo 4 | // 5 | // Created by Andrea Mazzini on 24/07/15. 6 | // Copyright (c) 2015 Fancy Pixel. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func applicationDidFinishLaunching(_ application: UIApplication) { 17 | if #available(iOS 13.0, *) { 18 | let appearance = UINavigationBarAppearance() 19 | appearance.buttonAppearance.normal.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white] 20 | appearance.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white] 21 | appearance.largeTitleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white] 22 | UINavigationBar.appearance().standardAppearance = appearance 23 | UINavigationBar.appearance().scrollEdgeAppearance = UINavigationBar.appearance().standardAppearance 24 | } else { 25 | UINavigationBar.appearance().tintColor = .white 26 | UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white] 27 | UINavigationBar.appearance().largeTitleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white] 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/CollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class CollectionViewCell: UICollectionViewCell { 4 | @IBOutlet var label: UILabel! 5 | } 6 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-120.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-121.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-152.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-167.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-180.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-20.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-29.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-40.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-41.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-42.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-58.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-59.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-60.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-76.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-80.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-81.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-81.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/AMScrollingNavbar-87.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "AMScrollingNavbar-40.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "AMScrollingNavbar-60.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "AMScrollingNavbar-58.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "AMScrollingNavbar-87.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "AMScrollingNavbar-80.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "AMScrollingNavbar-120.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "AMScrollingNavbar-121.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "AMScrollingNavbar-180.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "20x20", 53 | "idiom" : "ipad", 54 | "filename" : "AMScrollingNavbar-20.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "AMScrollingNavbar-41.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "AMScrollingNavbar-29.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "AMScrollingNavbar-59.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "AMScrollingNavbar-42.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "AMScrollingNavbar-81.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "AMScrollingNavbar-76.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "AMScrollingNavbar-152.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "83.5x83.5", 101 | "idiom" : "ipad", 102 | "filename" : "AMScrollingNavbar-167.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "idiom" : "ios-marketing", 107 | "size" : "1024x1024", 108 | "scale" : "1x" 109 | } 110 | ], 111 | "info" : { 112 | "version" : 1, 113 | "author" : "xcode" 114 | } 115 | } -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "logo.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Images.xcassets/logo.imageset/logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemo/Images.xcassets/logo.imageset/logo.pdf -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIMainStoryboardFile 33 | Main 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UIStatusBarHidden 39 | 40 | UIStatusBarStyle 41 | UIStatusBarStyleLightContent 42 | UISupportedInterfaceOrientations 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationLandscapeRight 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationPortraitUpsideDown 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ScrollingNavbarDemo 4 | // 5 | // Created by Andrea Mazzini on 24/07/15. 6 | // Copyright (c) 2015 Fancy Pixel. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AMScrollingNavbar 11 | 12 | class ViewController: UITableViewController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | title = "Sampler" 18 | 19 | tableView.tableFooterView = UIView() 20 | } 21 | 22 | override func viewWillAppear(_ animated: Bool) { 23 | super.viewWillAppear(animated) 24 | 25 | if #available(iOS 13.0, *) { 26 | navigationController?.navigationBar.standardAppearance.backgroundColor = UIColor(red:0.1, green:0.1, blue:0.1, alpha:1) 27 | navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance 28 | } else { 29 | navigationController?.navigationBar.barTintColor = UIColor(red:0.1, green:0.1, blue:0.1, alpha:1) 30 | } 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/ViewControllers/CollectionViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import AMScrollingNavbar 3 | 4 | class CollectionViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate { 5 | 6 | @IBOutlet var collectionView: UICollectionView! 7 | @IBOutlet var customFooter: UIView! 8 | 9 | override func viewDidLoad() { 10 | super.viewDidLoad() 11 | 12 | title = "CollectionView" 13 | navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: nil, action: nil) 14 | if #available(iOS 13.0, *) { 15 | navigationController?.navigationBar.standardAppearance.backgroundColor = UIColor(red:0.91, green:0.3, blue:0.24, alpha:1) 16 | navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance 17 | } else { 18 | navigationController?.navigationBar.barTintColor = UIColor(red:0.91, green:0.3, blue:0.24, alpha:1) 19 | } 20 | let flowLayout = UICollectionViewFlowLayout() 21 | flowLayout.minimumInteritemSpacing = 1; 22 | flowLayout.minimumLineSpacing = 1; 23 | let cellSize = (CGFloat.minimum(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height) - 2) / 3; 24 | flowLayout.itemSize = CGSize(width: cellSize, height: cellSize) 25 | flowLayout.scrollDirection = .vertical 26 | collectionView?.collectionViewLayout = flowLayout 27 | // collectionView?.contentInset = UIEdgeInsetsMake(44, 0, 0, 0) 28 | } 29 | 30 | // Enable the navbar scrolling 31 | override func viewDidAppear(_ animated: Bool) { 32 | super.viewDidAppear(animated) 33 | 34 | if let navigationController = self.navigationController as? ScrollingNavigationController { 35 | navigationController.followScrollView(collectionView, delay: 50.0, followers: [NavigationBarFollower(view: customFooter, direction: .scrollDown)]) 36 | } 37 | } 38 | 39 | override open func viewWillDisappear(_ animated: Bool) { 40 | super.viewWillDisappear(animated) 41 | 42 | if let navigationController = self.navigationController as? ScrollingNavigationController { 43 | navigationController.stopFollowingScrollView() 44 | } 45 | } 46 | 47 | // MARK: - Collection view data source 48 | 49 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { 50 | let storyBoard = UIStoryboard(name: "Main", bundle: nil) 51 | let mainViewController = storyBoard.instantiateViewController(withIdentifier: "TestViewController") 52 | self.present(mainViewController, animated: true, completion: nil) 53 | } 54 | 55 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 56 | return 100 57 | } 58 | 59 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 60 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CollectionViewCell", for: indexPath) 61 | cell.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1) 62 | if let label = cell.contentView.subviews.first as? UILabel { 63 | label.text = "\(indexPath.row + 1)" 64 | label.textColor = UIColor(red: 0.45, green: 0.35, blue: 0.35, alpha: 1) 65 | } 66 | return cell 67 | } 68 | 69 | open func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool { 70 | if let navigationController = self.navigationController as? ScrollingNavigationController { 71 | navigationController.showNavbar(animated: true) 72 | } 73 | return true 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/ViewControllers/LargeTitleViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import AMScrollingNavbar 3 | 4 | class LargeTitleViewController: ScrollingNavigationViewController, ScrollingNavigationControllerDelegate { 5 | @IBOutlet weak var scrollView: UIScrollView! 6 | 7 | override func viewDidLoad() { 8 | super.viewDidLoad() 9 | 10 | title = "ScrollView" 11 | 12 | if #available(iOS 13.0, *) { 13 | navigationController?.navigationBar.standardAppearance.backgroundColor = UIColor(red:0.17, green:0.59, blue:0.87, alpha:1) 14 | navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance 15 | } else { 16 | navigationController?.navigationBar.barTintColor = UIColor(red:0.17, green:0.59, blue:0.87, alpha:1) 17 | } 18 | tabBarController?.tabBar.barTintColor = UIColor(red:0.17, green:0.59, blue:0.87, alpha:1) 19 | tabBarController?.tabBar.tintColor = .white 20 | 21 | scrollView.backgroundColor = UIColor(red:0.13, green:0.5, blue:0.73, alpha:1) 22 | 23 | let label = UILabel(frame: CGRect(x: 10, y: 10, width: 0, height: 0)) 24 | if let font = UIFont(name: "STHeitiSC-Light", size: 20) { 25 | label.font = font 26 | } 27 | scrollView.addSubview(label) 28 | 29 | // Fake some content 30 | label.text = lyrics.first 31 | label.numberOfLines = 0 32 | label.textColor = .white 33 | label.sizeToFit() 34 | 35 | scrollView.contentSize = CGSize(width: self.view.frame.size.width, height: label.frame.size.height) 36 | scrollView.delegate = self 37 | 38 | navigationController?.navigationBar.prefersLargeTitles = true 39 | } 40 | 41 | // Enable the navbar scrolling 42 | override func viewDidAppear(_ animated: Bool) { 43 | super.viewDidAppear(animated) 44 | 45 | navigationController?.navigationBar.barTintColor = UIColor(red:0.17, green:0.59, blue:0.87, alpha:1) 46 | 47 | if let navigationController = self.navigationController as? ScrollingNavigationController { 48 | if let tabBarController = tabBarController { 49 | navigationController.followScrollView(scrollView, delay: 0, scrollSpeedFactor: 2, followers: [NavigationBarFollower(view: tabBarController.tabBar, direction: .scrollDown)]) 50 | } else { 51 | navigationController.followScrollView(scrollView, delay: 0.0, scrollSpeedFactor: 2) 52 | } 53 | navigationController.scrollingNavbarDelegate = self 54 | navigationController.expandOnActive = false 55 | } 56 | } 57 | 58 | let lyrics = [ 59 | "It's all in motion\nNo stoppin' now\nI've got nothin' to lose\nAnd only one way up\n\nI'm burning bridges\nI destroy the mirage\nOh, visions of collisions\nFuckin 'bon voyage\n\nIt's all smooth sailing\nFrom here on out\n\nI got bruises and hickies\nStitches and scars\nGot my own theme music\nIt plays wherever I are\n\nFear is the hand \nThat pulls your strings\nA useless toy\nPitiful plaything\n\nI'm inflagranti\nIn every way\n\nIt's all smooth sailing\nFrom here on out\nI'm gon' do the damage\nThat needs gettin' done\n\nGod only knows\nWhere love vacations\nIf reason is priceless\nThere's no reason to pay for it\n\nIt's so easy to see\nAnd so hard to find\nMake a mountain of a mole hill\nIf the mole hill is mine\n\nI hypnotize you\nAnd no one can find you\nI blow my load\nOver the status quo\nHere we go\n\nI'm a little bit nonchalant \nBut I dance\nI'm risking it always\nNo second chance\n\nIt's gonna be smooth sailing\nFrom here on out\nI'm gon' do the damage\n'Til the damage is done yeah\n\nGod only knows\nSo mind your behavior\nFollow prescriptions\nOf your lord and savior\n\nEvery temple is gold\nEvery hook is designed\nHell is but the temple\nOf the closed mind\nClosed mind\nClosed mind\nClosed mind\n\nIt's all smooth sailing\nFrom here on out\n\nShut up\n" 60 | ] 61 | } 62 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/ViewControllers/ScrollViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollViewController.swift 3 | // ScrollingNavbarDemo 4 | // 5 | // Created by Andrea Mazzini on 18/08/15. 6 | // Copyright (c) 2015 Fancy Pixel. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AMScrollingNavbar 11 | 12 | class ScrollViewController: ScrollingNavigationViewController, ScrollingNavigationControllerDelegate { 13 | 14 | @IBOutlet weak var scrollView: UIScrollView! 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | 19 | title = "ScrollView" 20 | 21 | // navigationItem.prompt = "Prompt" 22 | 23 | if #available(iOS 13.0, *) { 24 | navigationController?.navigationBar.standardAppearance.backgroundColor = UIColor(red:0.17, green:0.59, blue:0.87, alpha:1) 25 | navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance 26 | } else { 27 | navigationController?.navigationBar.barTintColor = UIColor(red:0.17, green:0.59, blue:0.87, alpha:1) 28 | } 29 | 30 | tabBarController?.tabBar.barTintColor = UIColor(red:0.17, green:0.59, blue:0.87, alpha:1) 31 | tabBarController?.tabBar.tintColor = .white 32 | 33 | scrollView.backgroundColor = UIColor(red:0.13, green:0.5, blue:0.73, alpha:1) 34 | 35 | let label = UILabel(frame: CGRect(x: 10, y: 10, width: 0, height: 0)) 36 | if let font = UIFont(name: "STHeitiSC-Light", size: 20) { 37 | label.font = font 38 | } 39 | scrollView.addSubview(label) 40 | 41 | // Fake some content 42 | label.text = lyrics.first 43 | label.numberOfLines = 0 44 | label.textColor = .white 45 | label.sizeToFit() 46 | 47 | scrollView.contentSize = CGSize(width: self.view.frame.size.width, height: label.frame.size.height) 48 | scrollView.delegate = self 49 | } 50 | 51 | func scrollingNavigationController(_ controller: ScrollingNavigationController, didChangeState state: NavigationBarState) { 52 | switch state { 53 | case .collapsed: 54 | print("navbar collapsed") 55 | case .expanded: 56 | print("navbar expanded") 57 | case .scrolling: 58 | print("navbar is moving") 59 | } 60 | } 61 | 62 | // Enable the navbar scrolling 63 | override func viewDidAppear(_ animated: Bool) { 64 | super.viewDidAppear(animated) 65 | 66 | navigationController?.navigationBar.barTintColor = UIColor(red:0.17, green:0.59, blue:0.87, alpha:1) 67 | 68 | if let navigationController = self.navigationController as? ScrollingNavigationController { 69 | if let tabBarController = tabBarController { 70 | navigationController.followScrollView(scrollView, delay: 0, scrollSpeedFactor: 2, followers: [NavigationBarFollower(view: tabBarController.tabBar, direction: .scrollDown)]) 71 | } else { 72 | navigationController.followScrollView(scrollView, delay: 0.0, scrollSpeedFactor: 2) 73 | } 74 | navigationController.scrollingNavbarDelegate = self 75 | navigationController.expandOnActive = false 76 | } 77 | } 78 | 79 | let lyrics = [ 80 | "It's all in motion\nNo stoppin' now\nI've got nothin' to lose\nAnd only one way up\n\nI'm burning bridges\nI destroy the mirage\nOh, visions of collisions\nFuckin 'bon voyage\n\nIt's all smooth sailing\nFrom here on out\n\nI got bruises and hickies\nStitches and scars\nGot my own theme music\nIt plays wherever I are\n\nFear is the hand \nThat pulls your strings\nA useless toy\nPitiful plaything\n\nI'm inflagranti\nIn every way\n\nIt's all smooth sailing\nFrom here on out\nI'm gon' do the damage\nThat needs gettin' done\n\nGod only knows\nWhere love vacations\nIf reason is priceless\nThere's no reason to pay for it\n\nIt's so easy to see\nAnd so hard to find\nMake a mountain of a mole hill\nIf the mole hill is mine\n\nI hypnotize you\nAnd no one can find you\nI blow my load\nOver the status quo\nHere we go\n\nI'm a little bit nonchalant \nBut I dance\nI'm risking it always\nNo second chance\n\nIt's gonna be smooth sailing\nFrom here on out\nI'm gon' do the damage\n'Til the damage is done yeah\n\nGod only knows\nSo mind your behavior\nFollow prescriptions\nOf your lord and savior\n\nEvery temple is gold\nEvery hook is designed\nHell is but the temple\nOf the closed mind\nClosed mind\nClosed mind\nClosed mind\n\nIt's all smooth sailing\nFrom here on out\n\nShut up\n" 81 | ] 82 | } 83 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/ViewControllers/TableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewController.swift 3 | // ScrollingNavbarDemo 4 | // 5 | // Created by Andrea Mazzini on 18/08/15. 6 | // Copyright (c) 2015 Fancy Pixel. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AMScrollingNavbar 11 | 12 | class TableViewController: ScrollingNavigationViewController, UITableViewDelegate, UITableViewDataSource { 13 | 14 | @IBOutlet weak var tableView: UITableView! 15 | @IBOutlet weak var toolbar: UIToolbar! 16 | 17 | var data: [Int] = Array(0...100) 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | 22 | title = "TableView" 23 | tableView.contentInset = UIEdgeInsets(top: 44, left: 0, bottom: 100, right: 0) 24 | toolbar.barTintColor = UIColor(red:0.91, green:0.3, blue:0.24, alpha:1) 25 | toolbar.tintColor = .white 26 | navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: nil, action: nil) 27 | navigationItem.searchController = UISearchController(searchResultsController: nil) 28 | 29 | if #available(iOS 13.0, *) { 30 | navigationController?.navigationBar.standardAppearance.backgroundColor = UIColor(red:0.91, green:0.3, blue:0.24, alpha:1) 31 | navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance 32 | } else { 33 | navigationController?.navigationBar.barTintColor = UIColor(red:0.91, green:0.3, blue:0.24, alpha:1) 34 | } 35 | } 36 | 37 | // Enable the navbar scrolling 38 | override func viewDidAppear(_ animated: Bool) { 39 | super.viewDidAppear(animated) 40 | 41 | if let navigationController = self.navigationController as? ScrollingNavigationController { 42 | navigationController.followScrollView(tableView, delay: 0.0, followers: [NavigationBarFollower(view: toolbar, direction: .scrollUp)]) 43 | navigationController.scrollingNavbarDelegate = self 44 | } 45 | } 46 | 47 | @IBAction func segmentChange() { 48 | if let navigationController = self.navigationController as? ScrollingNavigationController { 49 | navigationController.showNavbar(animated: true, duration: 0.2, scrollToTop: true) { 50 | let last = self.data.last ?? 0 51 | self.data = Array(last...last + 100) 52 | self.tableView.reloadData() 53 | } 54 | } 55 | } 56 | 57 | // MARK: - UITableView data source 58 | 59 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 60 | return data.count 61 | } 62 | 63 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 64 | let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) 65 | cell.textLabel?.text = "Row \(data[indexPath.row])" 66 | return cell 67 | } 68 | 69 | func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { 70 | return "Header" 71 | } 72 | 73 | } 74 | 75 | extension TableViewController: ScrollingNavigationControllerDelegate { 76 | func scrollingNavigationController(_ controller: ScrollingNavigationController, willChangeState state: NavigationBarState) { 77 | view.needsUpdateConstraints() 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/ViewControllers/TestViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class TestViewController: UIViewController { 4 | @IBAction func dismiss() { 5 | self.dismiss(animated: true, completion: nil) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/ViewControllers/WebViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WebViewController.swift 3 | // ScrollingNavbarDemo 4 | // 5 | // Created by Andrea Mazzini on 18/08/15. 6 | // Copyright (c) 2015 Fancy Pixel. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import WebKit 11 | import AMScrollingNavbar 12 | 13 | class WebViewController: ScrollingNavigationViewController, UIWebViewDelegate { 14 | 15 | @IBOutlet weak var webView: WKWebView! 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | title = "WebView" 21 | 22 | view.backgroundColor = UIColor(red:0.17, green:0.24, blue:0.32, alpha:1) 23 | webView.backgroundColor = UIColor(red:0.17, green:0.24, blue:0.32, alpha:1) 24 | 25 | if #available(iOS 13.0, *) { 26 | navigationController?.navigationBar.standardAppearance.backgroundColor = UIColor(red:0.2, green:0.28, blue:0.37, alpha:1) 27 | navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance 28 | } else { 29 | navigationController?.navigationBar.barTintColor = UIColor(red:0.2, green:0.28, blue:0.37, alpha:1) 30 | } 31 | 32 | // Load some content 33 | webView.load(URLRequest(url: URL(string: "https://www.fancypixel.it")!)) 34 | 35 | // Or try with some local content: 36 | // let url = Bundle.main.url(forResource: "index", withExtension: "html")! 37 | // webView.loadFileURL(url, allowingReadAccessTo: url) 38 | 39 | // Enable the scrollToTop 40 | webView.scrollView.delegate = self 41 | } 42 | 43 | // Enable the navbar scrolling 44 | override func viewDidAppear(_ animated: Bool) { 45 | super.viewDidAppear(animated) 46 | 47 | if let navigationController = self.navigationController as? ScrollingNavigationController { 48 | navigationController.followScrollView(webView, delay: 50.0) 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Sample 9 | 10 | 11 | 12 |

Tied UP

13 |

Rival Sons

14 | 15 |

16 | Go to the dark side full moon 17 |
You shoot the apple off of my head 18 |
'Cause your love, sweet love, is all that you put me through 19 |
And honey without it you know I'd rather be dead 20 |

21 | 22 |

I'm tied up 23 |
I'm tangled up 24 |
And I'm all wrapped up 25 |
In you

26 |

I'm tied up 27 |
I'm tangled up 28 |
And I'm all wrapped up 29 |
In you

30 | 31 |

Now that I'm neck deep in this fire 32 |
And that's not the least of what I would do 33 |
'Cause your love, sweet love, is all but a burning desire 34 |
And sugar you know that I burn for you

35 | 36 |

I'm tied up 37 |
Tangled up 38 |
And I'm all wrapped up 39 |
In you

40 | 41 |

I'm tied up 42 |
Tangled up 43 |
I'm all wrapped up 44 |
In you

45 | 46 |

Tied up 47 |
I'm tangled up 48 |
And I'm all wrapped up 49 |
In you

50 | 51 |

I'm tied up 52 |
I'm tangled up 53 |
Wrapped up 54 |
In you, you, you

55 | 56 | 57 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemoTests/ReferenceImages/ScrollingNavbarDemoTests/hideNavbar__should_hide_the_navigation_bar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemoTests/ReferenceImages/ScrollingNavbarDemoTests/hideNavbar__should_hide_the_navigation_bar@2x.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemoTests/ReferenceImages/ScrollingNavbarDemoTests/hideNavbar__should_hide_the_navigation_bar@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemoTests/ReferenceImages/ScrollingNavbarDemoTests/hideNavbar__should_hide_the_navigation_bar@3x.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemoTests/ReferenceImages/ScrollingNavbarDemoTests/showNavbar__should_show_the_navigation_bar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemoTests/ReferenceImages/ScrollingNavbarDemoTests/showNavbar__should_show_the_navigation_bar@2x.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemoTests/ReferenceImages/ScrollingNavbarDemoTests/showNavbar__should_show_the_navigation_bar@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/Demo/ScrollingNavbarDemoTests/ReferenceImages/ScrollingNavbarDemoTests/showNavbar__should_show_the_navigation_bar@3x.png -------------------------------------------------------------------------------- /Demo/ScrollingNavbarDemoTests/ScrollingNavbarDemoTests.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | //import Quick 3 | //import Nimble 4 | //import Nimble_Snapshots 5 | 6 | import AMScrollingNavbar 7 | 8 | // NOTE: tests disabled until Quick and Nimble Swift 3 branch is complete 9 | 10 | //func isRecording() -> Bool { 11 | // return false 12 | //} 13 | // 14 | //extension UIViewController { 15 | // func preloadView() { 16 | // let _ = self.view 17 | // } 18 | //} 19 | // 20 | //class TableController: UITableViewController, ScrollingNavigationControllerDelegate { 21 | // var called = false 22 | // var status = NavigationBarState.expanded 23 | // 24 | // func scrollingNavigationController(_ controller: ScrollingNavigationController, didChangeState state: NavigationBarState) { 25 | // called = true 26 | // status = state 27 | // } 28 | //} 29 | // 30 | //class DataSource: NSObject, UITableViewDataSource { 31 | // func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 32 | // return 100 33 | // } 34 | // 35 | // func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 36 | // let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) 37 | // cell.textLabel?.text = "Row \((indexPath as NSIndexPath).row)" 38 | // if (indexPath as NSIndexPath).row % 2 == 0 { 39 | // cell.backgroundColor = UIColor(white: 0.8, alpha: 1) 40 | // } else { 41 | // cell.backgroundColor = UIColor(white: 0.9, alpha: 1) 42 | // } 43 | // return cell 44 | // } 45 | //} 46 | // 47 | //class ScrollingNavbarDemoTests: QuickSpec { 48 | // 49 | // override func spec() { 50 | // 51 | // var subject: ScrollingNavigationController! 52 | // let dataSource = DataSource() 53 | // var tableController: TableController? 54 | // 55 | // beforeEach { 56 | // tableController = TableController(style: .Plain) 57 | // tableController?.tableView.registerClass(UITableViewCell.classForCoder(), forCellReuseIdentifier: "Cell") 58 | // tableController?.tableView.dataSource = dataSource 59 | // subject = ScrollingNavigationController(rootViewController: tableController!) 60 | // subject.scrollingNavbarDelegate = tableController 61 | // UIApplication.sharedApplication().keyWindow!.rootViewController = subject 62 | // subject.preloadView() 63 | // tableController?.tableView.reloadData() 64 | // subject.followScrollView(tableController!.tableView, delay: 0) 65 | // } 66 | // 67 | // describe("hideNavbar") { 68 | // it("should hide the navigation bar") { 69 | // subject.hideNavbar(animated: false) 70 | // if isRecording() { 71 | // expect(subject.view).to(recordSnapshot()) 72 | // } else { 73 | // expect(subject.view).to(haveValidSnapshot()) 74 | // } 75 | // } 76 | // } 77 | // 78 | // describe("showNavbar") { 79 | // it("should show the navigation bar") { 80 | // subject.hideNavbar(animated: false) 81 | // subject.showNavbar(animated: false) 82 | // if isRecording() { 83 | // expect(subject.view).toEventually(recordSnapshot(), timeout: 2, pollInterval: 1) 84 | // } else { 85 | // expect(subject.view).toEventually(haveValidSnapshot(), timeout: 2, pollInterval: 1) 86 | // } 87 | // } 88 | // } 89 | // 90 | // describe("ScrollingNavigationControllerDelegate") { 91 | // it("should call the delegate with the new state of scroll") { 92 | // subject.hideNavbar(animated: false) 93 | // expect(tableController?.called).to(beTrue()) 94 | // expect(tableController?.status).to(equal(NavigationBarState.Scrolling)) 95 | // expect(tableController?.status).toEventually(equal(NavigationBarState.Collapsed), timeout: 2, pollInterval: 1) 96 | // } 97 | // } 98 | // } 99 | // 100 | //} 101 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Andrea Mazzini 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "AMScrollingNavbar", 6 | products: [ 7 | .library( 8 | name: "AMScrollingNavbar", 9 | targets: ["AMScrollingNavbar"]) 10 | ], 11 | targets: [ 12 | .target( 13 | name: "AMScrollingNavbar", 14 | path: "Source") 15 | ] 16 | ) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | [![CocoaPods](https://cocoapod-badges.herokuapp.com/v/AMScrollingNavbar/badge.svg)](http://www.cocoapods.org/?q=amscrollingnavbar) 6 | ![Build status](https://github.com/andreamazz/AMScrollingNavbar/workflows/Test%20suite/badge.svg) 7 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 8 | ![Swift 5](https://img.shields.io/badge/swift-5-orange.svg) 9 | [![Join the chat at https://gitter.im/andreamazz/AMScrollingNavbar](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/andreamazz/AMScrollingNavbar?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 10 | [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=46FNZD4PDVNRU) 11 | 12 | A custom UINavigationController that enables the scrolling of the navigation bar alongside the 13 | scrolling of an observed content view 14 | 15 |

16 | 17 | 18 | 19 |

20 | 21 | ### Versioning notes 22 | 23 | - Version `2.x` is written as a subclass of `UINavigationController`, in Swift. 24 | - Version `2.0.0` introduced Swift 2.0 syntax. 25 | - Version `3.0.0` introduced Swift 3.0 syntax. 26 | - Version `4.0.0` introduced Swift 4.0 syntax. 27 | - Version `5.1.0` introduced Swift 4.2 syntax. 28 | 29 | If you are looking for the category implementation in Objective-C, make sure to checkout version `1.x` and prior, although the `2.x` is recomended. 30 | 31 | # Screenshot 32 | 33 |

34 | 35 |

36 | 37 | # Setup with CocoaPods 38 | 39 | ``` 40 | pod 'AMScrollingNavbar' 41 | 42 | use_frameworks! 43 | ``` 44 | 45 | # Setup with Carthage 46 | 47 | ``` 48 | github "andreamazz/AMScrollingNavbar" 49 | ``` 50 | 51 | ## Usage 52 | 53 | Make sure to use `ScrollingNavigationController` instead of the standard `UINavigationController`. Either set the class of your `UINavigationController` in your storyboard, or create programmatically a `ScrollingNavigationController` instance in your code. 54 | 55 | Use `followScrollView(_: delay:)` to start following the scrolling of a scrollable view (e.g.: a `UIScrollView` or `UITableView`). 56 | #### Swift 57 | ```swift 58 | override func viewWillAppear(_ animated: Bool) { 59 | super.viewWillAppear(animated) 60 | 61 | if let navigationController = navigationController as? ScrollingNavigationController { 62 | navigationController.followScrollView(tableView, delay: 50.0) 63 | } 64 | } 65 | ``` 66 | 67 | #### Objective-C 68 | ```objc 69 | - (void)viewWillAppear:(BOOL)animated { 70 | [super viewWillAppear:animated]; 71 | 72 | [(ScrollingNavigationController *)self.navigationController followScrollView:self.tableView delay:0 scrollSpeedFactor:1 collapseDirection:NavigationBarCollapseDirectionScrollDown followers:nil]; 73 | } 74 | ``` 75 | 76 | Use `stopFollowingScrollview()` to stop the behaviour. Remember to call this function on disappear: 77 | ```swift 78 | override func viewDidDisappear(_ animated: Bool) { 79 | super.viewDidDisappear(animated) 80 | 81 | if let navigationController = navigationController as? ScrollingNavigationController { 82 | navigationController.stopFollowingScrollView() 83 | } 84 | } 85 | ``` 86 | 87 | ## ScrollingNavigationViewController 88 | To DRY things up you can let your view controller subclass `ScrollingNavigationViewController`, which provides the base setup implementation. You will just need to call `followScrollView(_: delay:)`: 89 | ```swift 90 | override func viewWillAppear(_ animated: Bool) { 91 | super.viewWillAppear(animated) 92 | 93 | if let navigationController = navigationController as? ScrollingNavigationController { 94 | navigationController.followScrollView(tableView, delay: 50.0) 95 | } 96 | } 97 | ``` 98 | 99 | ## Followers 100 | To move another view, like a toolbar, alongside the navigation bar you can provide the view or multiple views as the `followers` parameter. Since you might want to have the follower up or down, you'll have to specify the scroll direction of the view once it starts to follow the navigation bar: 101 | ```swift 102 | if let navigationController = navigationController as? ScrollingNavigationController { 103 | navigationController.followScrollView(tableView, delay: 50.0, followers: [NavigationBarFollower(view: customFooter, direction: .scrollDown)]) 104 | } 105 | ``` 106 | 107 | Note that when navigating away from the controller the followers might keep the scroll offset. Refer to [Handling navigation](https://github.com/andreamazz/AMScrollingNavbar#handling-navigation) for proper setup. 108 | 109 | ## Additional scroll 110 | 111 | If you want to furhter scroll the navigation bar out of the way, you can use the optional parameter `additionalOffset` in the `followScrollView` call. 112 | 113 | ## Scrolling the TabBar 114 | You can also pass a `UITabBar` in the `followers` array: 115 | ```swift 116 | if let navigationController = navigationController as? ScrollingNavigationController { 117 | navigationController.followScrollView(tableView, delay: 50.0, followers: [tabBarController.tabBar]) 118 | } 119 | ``` 120 | 121 | 122 | ## ScrollingNavigationControllerDelegate 123 | You can set a delegate to receive a call when the state of the navigation bar changes: 124 | ```swift 125 | if let navigationController = navigationController as? ScrollingNavigationController { 126 | navigationController.scrollingNavbarDelegate = self 127 | } 128 | ``` 129 | 130 | Delegate function: 131 | ```swift 132 | func scrollingNavigationController(_ controller: ScrollingNavigationController, didChangeState state: NavigationBarState) { 133 | switch state { 134 | case .collapsed: 135 | print("navbar collapsed") 136 | case .expanded: 137 | print("navbar expanded") 138 | case .scrolling: 139 | print("navbar is moving") 140 | } 141 | } 142 | ``` 143 | 144 | ## Handling navigation 145 | If the view controller with the scroll view pushes new controllers, you should call `showNavbar(animated:)` in your `viewWillDisappear(animated:)`: 146 | ```swift 147 | override func viewWillDisappear(_ animated: Bool) { 148 | super.viewWillDisappear(animated) 149 | if let navigationController = navigationController as? ScrollingNavigationController { 150 | navigationController.showNavbar(animated: true) 151 | } 152 | } 153 | ``` 154 | 155 | ## Scrolling to top 156 | When the user taps the status bar, by default a scrollable view scrolls to the top of its content. If you want to also show the navigation bar, make sure to include this in your controller: 157 | 158 | ```swift 159 | func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool { 160 | if let navigationController = navigationController as? ScrollingNavigationController { 161 | navigationController.showNavbar(animated: true, scrollToTop: true) 162 | } 163 | return true 164 | } 165 | ``` 166 | 167 | ## Scroll speed 168 | You can control the speed of the scrolling using the `scrollSpeedFactor` optional parameter: 169 | 170 | ```swift 171 | controller.followScrollView(view, delay: 0, scrollSpeedFactor: 2) 172 | ``` 173 | 174 | Check out the sample project for more details. 175 | 176 | ## Changing UINavigationBar.tintColor 177 | AMScrollingNavBar maintains its own copy of the UINavigationBar's `tintColor` property. You need to notify the AMScrollingNavBar of a tint change by calling `navBarTintUpdated()`: 178 | 179 | ```swift 180 | navigationBar.tintColor = UIColor.red 181 | controller.navBarTintUpdated() 182 | ``` 183 | 184 | Check out the sample project for more details. 185 | 186 | # Author 187 | [Andrea Mazzini](https://twitter.com/theandreamazz). I'm available for freelance work, feel free to contact me. 188 | 189 | Want to support the development of [these free libraries](https://cocoapods.org/owners/734)? Buy me a coffee ☕️ via [Paypal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=46FNZD4PDVNRU). 190 | 191 | # Contributors 192 | [Syo Ikeda](https://github.com/ikesyo) and [everyone](https://github.com/andreamazz/AMScrollingNavbar/graphs/contributors) kind enough to submit a pull request. 193 | 194 | # MIT License 195 | The MIT License (MIT) 196 | 197 | Copyright (c) 2014-2019 Andrea Mazzini 198 | 199 | Permission is hereby granted, free of charge, to any person obtaining a copy of 200 | this software and associated documentation files (the "Software"), to deal in 201 | the Software without restriction, including without limitation the rights to 202 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 203 | the Software, and to permit persons to whom the Software is furnished to do so, 204 | subject to the following conditions: 205 | 206 | The above copyright notice and this permission notice shall be included in all 207 | copies or substantial portions of the Software. 208 | 209 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 210 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 211 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 212 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 213 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 214 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 215 | -------------------------------------------------------------------------------- /Source/ScrollingNavbar+Sizes.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import WebKit 3 | 4 | /** 5 | Implements the main functions providing constants values and computed ones 6 | */ 7 | extension ScrollingNavigationController { 8 | 9 | // MARK: - View sizing 10 | 11 | var fullNavbarHeight: CGFloat { 12 | return navbarHeight + statusBarHeight 13 | } 14 | 15 | var navbarHeight: CGFloat { 16 | return navigationBar.frame.size.height 17 | } 18 | 19 | var statusBarHeight: CGFloat { 20 | var statusBarHeight = UIApplication.shared.statusBarFrame.size.height 21 | if #available(iOS 11.0, *) { 22 | // Account for the notch when the status bar is hidden 23 | statusBarHeight = max(UIApplication.shared.statusBarFrame.size.height, UIApplication.shared.delegate?.window??.safeAreaInsets.top ?? 0) 24 | } 25 | return max(statusBarHeight - extendedStatusBarDifference, 0) 26 | } 27 | 28 | // Extended status call changes the bounds of the presented view 29 | var extendedStatusBarDifference: CGFloat { 30 | var appHeight = view.bounds.height 31 | var nextView = view 32 | while let superView = nextView?.superview { 33 | appHeight = superView.bounds.height 34 | nextView = superView.superview 35 | } 36 | return abs(appHeight - (UIApplication.shared.delegate?.window??.frame.size.height ?? UIScreen.main.bounds.height)) 37 | } 38 | 39 | var tabBarOffset: CGFloat { 40 | // Only account for the tab bar if a tab bar controller is present and the bar is not translucent 41 | if let tabBarController = tabBarController, !(topViewController?.hidesBottomBarWhenPushed ?? false) { 42 | return tabBarController.tabBar.isTranslucent ? 0 : tabBarController.tabBar.frame.height 43 | } 44 | return 0 45 | } 46 | 47 | func scrollView() -> UIScrollView? { 48 | if let wkWebView = self.scrollableView as? WKWebView { 49 | return wkWebView.scrollView 50 | } else { 51 | return scrollableView as? UIScrollView 52 | } 53 | } 54 | 55 | var contentOffset: CGPoint { 56 | return scrollView()?.contentOffset ?? CGPoint.zero 57 | } 58 | 59 | var contentSize: CGSize { 60 | guard let scrollView = scrollView() else { 61 | return CGSize.zero 62 | } 63 | 64 | let verticalInset = scrollView.contentInset.top + scrollView.contentInset.bottom 65 | return CGSize(width: scrollView.contentSize.width, height: scrollView.contentSize.height + verticalInset) 66 | } 67 | 68 | var navbarFullHeight: CGFloat { 69 | return navbarHeight - statusBarHeight + additionalOffset 70 | } 71 | 72 | var followersHeight: CGFloat { 73 | return self.followers.filter { $0.direction == .scrollUp }.compactMap { $0.view?.frame.height }.reduce(0, +) 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Source/ScrollingNavigationViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | /** 4 | A custom `UIViewController` that implements the base configuration. 5 | */ 6 | open class ScrollingNavigationViewController: UIViewController, UIScrollViewDelegate, UINavigationControllerDelegate { 7 | 8 | // MARK: - ScrollView config 9 | 10 | /** 11 | On appear calls `showNavbar()` by default 12 | */ 13 | override open func viewWillAppear(_ animated: Bool) { 14 | super.viewWillAppear(animated) 15 | 16 | if let navigationController = self.navigationController as? ScrollingNavigationController { 17 | navigationController.showNavbar(animated: true) 18 | } 19 | } 20 | 21 | /** 22 | On disappear calls `stopFollowingScrollView()` to stop observing the current scroll view, and perform the tear down 23 | */ 24 | override open func viewWillDisappear(_ animated: Bool) { 25 | super.viewWillDisappear(animated) 26 | 27 | if let navigationController = self.navigationController as? ScrollingNavigationController { 28 | navigationController.stopFollowingScrollView() 29 | } 30 | } 31 | 32 | /** 33 | Calls `showNavbar()` with the `scrollToTop` parameter to `true` when a scroll to top is requested 34 | */ 35 | open func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool { 36 | if let navigationController = self.navigationController as? ScrollingNavigationController { 37 | navigationController.showNavbar(animated: true, scrollToTop: true) 38 | } 39 | return true 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /assets/demo-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/assets/demo-button.png -------------------------------------------------------------------------------- /assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/assets/logo.png -------------------------------------------------------------------------------- /assets/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreamazz/AMScrollingNavbar/5016bc166af5cd08676fed5d762e00e6333a88ac/assets/screenshot.gif --------------------------------------------------------------------------------