├── .gitignore
├── ACScrollNavBar.xcworkspace
└── contents.xcworkspacedata
├── ACScrollNavBar
├── ACScrollNavBar.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
├── ACScrollNavBar
│ ├── ACScrollNavBar.h
│ ├── Info.plist
│ ├── UINavigationBar+Scrollable.swift
│ └── UIViewController+ScrollingNavbar.swift
└── ACScrollNavBarTests
│ ├── ACScrollNavBarTests.swift
│ └── Info.plist
├── DemoApp
├── DemoApp.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
├── DemoApp
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ └── RootViewController.swift
└── DemoAppTests
│ ├── DemoAppTests.swift
│ └── Info.plist
├── LICENSE
├── README.md
└── demo.gif
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
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 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 |
20 | # CocoaPods
21 | #
22 | # We recommend against adding the Pods directory to your .gitignore. However
23 | # you should judge for yourself, the pros and cons are mentioned at:
24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25 | #
26 | # Pods/
27 |
--------------------------------------------------------------------------------
/ACScrollNavBar.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
12 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ACScrollNavBar/ACScrollNavBar.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | BD9A5AF319F1D41400C1F777 /* ACScrollNavBar.h in Headers */ = {isa = PBXBuildFile; fileRef = BD9A5AF219F1D41400C1F777 /* ACScrollNavBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
11 | BD9A5AFD19F1D41400C1F777 /* ACScrollNavBarTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9A5AFC19F1D41400C1F777 /* ACScrollNavBarTests.swift */; };
12 | BD9A5B0819F1D4E900C1F777 /* UINavigationBar+Scrollable.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9A5B0619F1D4E900C1F777 /* UINavigationBar+Scrollable.swift */; };
13 | BD9A5B0919F1D4E900C1F777 /* UIViewController+ScrollingNavbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9A5B0719F1D4E900C1F777 /* UIViewController+ScrollingNavbar.swift */; };
14 | BD9A5B5019F1DD6C00C1F777 /* UINavigationBar+Scrollable.swift in Resources */ = {isa = PBXBuildFile; fileRef = BD9A5B0619F1D4E900C1F777 /* UINavigationBar+Scrollable.swift */; };
15 | BD9A5B5119F1DD6C00C1F777 /* UIViewController+ScrollingNavbar.swift in Resources */ = {isa = PBXBuildFile; fileRef = BD9A5B0719F1D4E900C1F777 /* UIViewController+ScrollingNavbar.swift */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXFileReference section */
19 | BD9A5AED19F1D41400C1F777 /* ACScrollNavBar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ACScrollNavBar.framework; sourceTree = BUILT_PRODUCTS_DIR; };
20 | BD9A5AF119F1D41400C1F777 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
21 | BD9A5AF219F1D41400C1F777 /* ACScrollNavBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ACScrollNavBar.h; sourceTree = ""; };
22 | BD9A5AF819F1D41400C1F777 /* ACScrollNavBarTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ACScrollNavBarTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
23 | BD9A5AFB19F1D41400C1F777 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
24 | BD9A5AFC19F1D41400C1F777 /* ACScrollNavBarTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ACScrollNavBarTests.swift; sourceTree = ""; };
25 | BD9A5B0619F1D4E900C1F777 /* UINavigationBar+Scrollable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UINavigationBar+Scrollable.swift"; sourceTree = ""; };
26 | BD9A5B0719F1D4E900C1F777 /* UIViewController+ScrollingNavbar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+ScrollingNavbar.swift"; sourceTree = ""; };
27 | /* End PBXFileReference section */
28 |
29 | /* Begin PBXFrameworksBuildPhase section */
30 | BD9A5AE919F1D41400C1F777 /* Frameworks */ = {
31 | isa = PBXFrameworksBuildPhase;
32 | buildActionMask = 2147483647;
33 | files = (
34 | );
35 | runOnlyForDeploymentPostprocessing = 0;
36 | };
37 | BD9A5AF519F1D41400C1F777 /* Frameworks */ = {
38 | isa = PBXFrameworksBuildPhase;
39 | buildActionMask = 2147483647;
40 | files = (
41 | );
42 | runOnlyForDeploymentPostprocessing = 0;
43 | };
44 | /* End PBXFrameworksBuildPhase section */
45 |
46 | /* Begin PBXGroup section */
47 | BD9A5AE319F1D41400C1F777 = {
48 | isa = PBXGroup;
49 | children = (
50 | BD9A5AEF19F1D41400C1F777 /* ACScrollNavBar */,
51 | BD9A5AF919F1D41400C1F777 /* ACScrollNavBarTests */,
52 | BD9A5AEE19F1D41400C1F777 /* Products */,
53 | );
54 | sourceTree = "";
55 | };
56 | BD9A5AEE19F1D41400C1F777 /* Products */ = {
57 | isa = PBXGroup;
58 | children = (
59 | BD9A5AED19F1D41400C1F777 /* ACScrollNavBar.framework */,
60 | BD9A5AF819F1D41400C1F777 /* ACScrollNavBarTests.xctest */,
61 | );
62 | name = Products;
63 | sourceTree = "";
64 | };
65 | BD9A5AEF19F1D41400C1F777 /* ACScrollNavBar */ = {
66 | isa = PBXGroup;
67 | children = (
68 | BD9A5AF219F1D41400C1F777 /* ACScrollNavBar.h */,
69 | BD9A5B0619F1D4E900C1F777 /* UINavigationBar+Scrollable.swift */,
70 | BD9A5B0719F1D4E900C1F777 /* UIViewController+ScrollingNavbar.swift */,
71 | BD9A5AF019F1D41400C1F777 /* Supporting Files */,
72 | );
73 | path = ACScrollNavBar;
74 | sourceTree = "";
75 | };
76 | BD9A5AF019F1D41400C1F777 /* Supporting Files */ = {
77 | isa = PBXGroup;
78 | children = (
79 | BD9A5AF119F1D41400C1F777 /* Info.plist */,
80 | );
81 | name = "Supporting Files";
82 | sourceTree = "";
83 | };
84 | BD9A5AF919F1D41400C1F777 /* ACScrollNavBarTests */ = {
85 | isa = PBXGroup;
86 | children = (
87 | BD9A5AFC19F1D41400C1F777 /* ACScrollNavBarTests.swift */,
88 | BD9A5AFA19F1D41400C1F777 /* Supporting Files */,
89 | );
90 | path = ACScrollNavBarTests;
91 | sourceTree = "";
92 | };
93 | BD9A5AFA19F1D41400C1F777 /* Supporting Files */ = {
94 | isa = PBXGroup;
95 | children = (
96 | BD9A5AFB19F1D41400C1F777 /* Info.plist */,
97 | );
98 | name = "Supporting Files";
99 | sourceTree = "";
100 | };
101 | /* End PBXGroup section */
102 |
103 | /* Begin PBXHeadersBuildPhase section */
104 | BD9A5AEA19F1D41400C1F777 /* Headers */ = {
105 | isa = PBXHeadersBuildPhase;
106 | buildActionMask = 2147483647;
107 | files = (
108 | BD9A5AF319F1D41400C1F777 /* ACScrollNavBar.h in Headers */,
109 | );
110 | runOnlyForDeploymentPostprocessing = 0;
111 | };
112 | /* End PBXHeadersBuildPhase section */
113 |
114 | /* Begin PBXNativeTarget section */
115 | BD9A5AEC19F1D41400C1F777 /* ACScrollNavBar */ = {
116 | isa = PBXNativeTarget;
117 | buildConfigurationList = BD9A5B0019F1D41400C1F777 /* Build configuration list for PBXNativeTarget "ACScrollNavBar" */;
118 | buildPhases = (
119 | BD9A5AE819F1D41400C1F777 /* Sources */,
120 | BD9A5AE919F1D41400C1F777 /* Frameworks */,
121 | BD9A5AEA19F1D41400C1F777 /* Headers */,
122 | BD9A5AEB19F1D41400C1F777 /* Resources */,
123 | );
124 | buildRules = (
125 | );
126 | dependencies = (
127 | );
128 | name = ACScrollNavBar;
129 | productName = ACScrollNavBar;
130 | productReference = BD9A5AED19F1D41400C1F777 /* ACScrollNavBar.framework */;
131 | productType = "com.apple.product-type.framework";
132 | };
133 | BD9A5AF719F1D41400C1F777 /* ACScrollNavBarTests */ = {
134 | isa = PBXNativeTarget;
135 | buildConfigurationList = BD9A5B0319F1D41400C1F777 /* Build configuration list for PBXNativeTarget "ACScrollNavBarTests" */;
136 | buildPhases = (
137 | BD9A5AF419F1D41400C1F777 /* Sources */,
138 | BD9A5AF519F1D41400C1F777 /* Frameworks */,
139 | BD9A5AF619F1D41400C1F777 /* Resources */,
140 | );
141 | buildRules = (
142 | );
143 | dependencies = (
144 | );
145 | name = ACScrollNavBarTests;
146 | productName = ACScrollNavBarTests;
147 | productReference = BD9A5AF819F1D41400C1F777 /* ACScrollNavBarTests.xctest */;
148 | productType = "com.apple.product-type.bundle.unit-test";
149 | };
150 | /* End PBXNativeTarget section */
151 |
152 | /* Begin PBXProject section */
153 | BD9A5AE419F1D41400C1F777 /* Project object */ = {
154 | isa = PBXProject;
155 | attributes = {
156 | LastUpgradeCheck = 0600;
157 | ORGANIZATIONNAME = "Alex Corre";
158 | TargetAttributes = {
159 | BD9A5AEC19F1D41400C1F777 = {
160 | CreatedOnToolsVersion = 6.0.1;
161 | };
162 | BD9A5AF719F1D41400C1F777 = {
163 | CreatedOnToolsVersion = 6.0.1;
164 | };
165 | };
166 | };
167 | buildConfigurationList = BD9A5AE719F1D41400C1F777 /* Build configuration list for PBXProject "ACScrollNavBar" */;
168 | compatibilityVersion = "Xcode 3.2";
169 | developmentRegion = English;
170 | hasScannedForEncodings = 0;
171 | knownRegions = (
172 | en,
173 | );
174 | mainGroup = BD9A5AE319F1D41400C1F777;
175 | productRefGroup = BD9A5AEE19F1D41400C1F777 /* Products */;
176 | projectDirPath = "";
177 | projectRoot = "";
178 | targets = (
179 | BD9A5AEC19F1D41400C1F777 /* ACScrollNavBar */,
180 | BD9A5AF719F1D41400C1F777 /* ACScrollNavBarTests */,
181 | );
182 | };
183 | /* End PBXProject section */
184 |
185 | /* Begin PBXResourcesBuildPhase section */
186 | BD9A5AEB19F1D41400C1F777 /* Resources */ = {
187 | isa = PBXResourcesBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | BD9A5B5019F1DD6C00C1F777 /* UINavigationBar+Scrollable.swift in Resources */,
191 | BD9A5B5119F1DD6C00C1F777 /* UIViewController+ScrollingNavbar.swift in Resources */,
192 | );
193 | runOnlyForDeploymentPostprocessing = 0;
194 | };
195 | BD9A5AF619F1D41400C1F777 /* Resources */ = {
196 | isa = PBXResourcesBuildPhase;
197 | buildActionMask = 2147483647;
198 | files = (
199 | );
200 | runOnlyForDeploymentPostprocessing = 0;
201 | };
202 | /* End PBXResourcesBuildPhase section */
203 |
204 | /* Begin PBXSourcesBuildPhase section */
205 | BD9A5AE819F1D41400C1F777 /* Sources */ = {
206 | isa = PBXSourcesBuildPhase;
207 | buildActionMask = 2147483647;
208 | files = (
209 | BD9A5B0919F1D4E900C1F777 /* UIViewController+ScrollingNavbar.swift in Sources */,
210 | BD9A5B0819F1D4E900C1F777 /* UINavigationBar+Scrollable.swift in Sources */,
211 | );
212 | runOnlyForDeploymentPostprocessing = 0;
213 | };
214 | BD9A5AF419F1D41400C1F777 /* Sources */ = {
215 | isa = PBXSourcesBuildPhase;
216 | buildActionMask = 2147483647;
217 | files = (
218 | BD9A5AFD19F1D41400C1F777 /* ACScrollNavBarTests.swift in Sources */,
219 | );
220 | runOnlyForDeploymentPostprocessing = 0;
221 | };
222 | /* End PBXSourcesBuildPhase section */
223 |
224 | /* Begin XCBuildConfiguration section */
225 | BD9A5AFE19F1D41400C1F777 /* Debug */ = {
226 | isa = XCBuildConfiguration;
227 | buildSettings = {
228 | ALWAYS_SEARCH_USER_PATHS = NO;
229 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
230 | CLANG_CXX_LIBRARY = "libc++";
231 | CLANG_ENABLE_MODULES = YES;
232 | CLANG_ENABLE_OBJC_ARC = YES;
233 | CLANG_WARN_BOOL_CONVERSION = YES;
234 | CLANG_WARN_CONSTANT_CONVERSION = YES;
235 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
236 | CLANG_WARN_EMPTY_BODY = YES;
237 | CLANG_WARN_ENUM_CONVERSION = YES;
238 | CLANG_WARN_INT_CONVERSION = YES;
239 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
240 | CLANG_WARN_UNREACHABLE_CODE = YES;
241 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
242 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
243 | COPY_PHASE_STRIP = NO;
244 | CURRENT_PROJECT_VERSION = 1;
245 | ENABLE_STRICT_OBJC_MSGSEND = YES;
246 | GCC_C_LANGUAGE_STANDARD = gnu99;
247 | GCC_DYNAMIC_NO_PIC = NO;
248 | GCC_OPTIMIZATION_LEVEL = 0;
249 | GCC_PREPROCESSOR_DEFINITIONS = (
250 | "DEBUG=1",
251 | "$(inherited)",
252 | );
253 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
254 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
255 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
256 | GCC_WARN_UNDECLARED_SELECTOR = YES;
257 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
258 | GCC_WARN_UNUSED_FUNCTION = YES;
259 | GCC_WARN_UNUSED_VARIABLE = YES;
260 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
261 | MTL_ENABLE_DEBUG_INFO = YES;
262 | ONLY_ACTIVE_ARCH = YES;
263 | SDKROOT = iphoneos;
264 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
265 | TARGETED_DEVICE_FAMILY = "1,2";
266 | VERSIONING_SYSTEM = "apple-generic";
267 | VERSION_INFO_PREFIX = "";
268 | };
269 | name = Debug;
270 | };
271 | BD9A5AFF19F1D41400C1F777 /* Release */ = {
272 | isa = XCBuildConfiguration;
273 | buildSettings = {
274 | ALWAYS_SEARCH_USER_PATHS = NO;
275 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
276 | CLANG_CXX_LIBRARY = "libc++";
277 | CLANG_ENABLE_MODULES = YES;
278 | CLANG_ENABLE_OBJC_ARC = YES;
279 | CLANG_WARN_BOOL_CONVERSION = YES;
280 | CLANG_WARN_CONSTANT_CONVERSION = YES;
281 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
282 | CLANG_WARN_EMPTY_BODY = YES;
283 | CLANG_WARN_ENUM_CONVERSION = YES;
284 | CLANG_WARN_INT_CONVERSION = YES;
285 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
286 | CLANG_WARN_UNREACHABLE_CODE = YES;
287 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
288 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
289 | COPY_PHASE_STRIP = YES;
290 | CURRENT_PROJECT_VERSION = 1;
291 | ENABLE_NS_ASSERTIONS = NO;
292 | ENABLE_STRICT_OBJC_MSGSEND = YES;
293 | GCC_C_LANGUAGE_STANDARD = gnu99;
294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
296 | GCC_WARN_UNDECLARED_SELECTOR = YES;
297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
298 | GCC_WARN_UNUSED_FUNCTION = YES;
299 | GCC_WARN_UNUSED_VARIABLE = YES;
300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
301 | MTL_ENABLE_DEBUG_INFO = NO;
302 | SDKROOT = iphoneos;
303 | TARGETED_DEVICE_FAMILY = "1,2";
304 | VALIDATE_PRODUCT = YES;
305 | VERSIONING_SYSTEM = "apple-generic";
306 | VERSION_INFO_PREFIX = "";
307 | };
308 | name = Release;
309 | };
310 | BD9A5B0119F1D41400C1F777 /* Debug */ = {
311 | isa = XCBuildConfiguration;
312 | buildSettings = {
313 | CLANG_ENABLE_MODULES = YES;
314 | DEFINES_MODULE = YES;
315 | DYLIB_COMPATIBILITY_VERSION = 1;
316 | DYLIB_CURRENT_VERSION = 1;
317 | DYLIB_INSTALL_NAME_BASE = "@rpath";
318 | INFOPLIST_FILE = ACScrollNavBar/Info.plist;
319 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
320 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
321 | PRODUCT_NAME = "$(TARGET_NAME)";
322 | SKIP_INSTALL = YES;
323 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
324 | };
325 | name = Debug;
326 | };
327 | BD9A5B0219F1D41400C1F777 /* Release */ = {
328 | isa = XCBuildConfiguration;
329 | buildSettings = {
330 | CLANG_ENABLE_MODULES = YES;
331 | DEFINES_MODULE = YES;
332 | DYLIB_COMPATIBILITY_VERSION = 1;
333 | DYLIB_CURRENT_VERSION = 1;
334 | DYLIB_INSTALL_NAME_BASE = "@rpath";
335 | INFOPLIST_FILE = ACScrollNavBar/Info.plist;
336 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
337 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
338 | PRODUCT_NAME = "$(TARGET_NAME)";
339 | SKIP_INSTALL = YES;
340 | };
341 | name = Release;
342 | };
343 | BD9A5B0419F1D41400C1F777 /* Debug */ = {
344 | isa = XCBuildConfiguration;
345 | buildSettings = {
346 | FRAMEWORK_SEARCH_PATHS = (
347 | "$(SDKROOT)/Developer/Library/Frameworks",
348 | "$(inherited)",
349 | );
350 | GCC_PREPROCESSOR_DEFINITIONS = (
351 | "DEBUG=1",
352 | "$(inherited)",
353 | );
354 | INFOPLIST_FILE = ACScrollNavBarTests/Info.plist;
355 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
356 | PRODUCT_NAME = "$(TARGET_NAME)";
357 | };
358 | name = Debug;
359 | };
360 | BD9A5B0519F1D41400C1F777 /* Release */ = {
361 | isa = XCBuildConfiguration;
362 | buildSettings = {
363 | FRAMEWORK_SEARCH_PATHS = (
364 | "$(SDKROOT)/Developer/Library/Frameworks",
365 | "$(inherited)",
366 | );
367 | INFOPLIST_FILE = ACScrollNavBarTests/Info.plist;
368 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
369 | PRODUCT_NAME = "$(TARGET_NAME)";
370 | };
371 | name = Release;
372 | };
373 | /* End XCBuildConfiguration section */
374 |
375 | /* Begin XCConfigurationList section */
376 | BD9A5AE719F1D41400C1F777 /* Build configuration list for PBXProject "ACScrollNavBar" */ = {
377 | isa = XCConfigurationList;
378 | buildConfigurations = (
379 | BD9A5AFE19F1D41400C1F777 /* Debug */,
380 | BD9A5AFF19F1D41400C1F777 /* Release */,
381 | );
382 | defaultConfigurationIsVisible = 0;
383 | defaultConfigurationName = Release;
384 | };
385 | BD9A5B0019F1D41400C1F777 /* Build configuration list for PBXNativeTarget "ACScrollNavBar" */ = {
386 | isa = XCConfigurationList;
387 | buildConfigurations = (
388 | BD9A5B0119F1D41400C1F777 /* Debug */,
389 | BD9A5B0219F1D41400C1F777 /* Release */,
390 | );
391 | defaultConfigurationIsVisible = 0;
392 | defaultConfigurationName = Release;
393 | };
394 | BD9A5B0319F1D41400C1F777 /* Build configuration list for PBXNativeTarget "ACScrollNavBarTests" */ = {
395 | isa = XCConfigurationList;
396 | buildConfigurations = (
397 | BD9A5B0419F1D41400C1F777 /* Debug */,
398 | BD9A5B0519F1D41400C1F777 /* Release */,
399 | );
400 | defaultConfigurationIsVisible = 0;
401 | defaultConfigurationName = Release;
402 | };
403 | /* End XCConfigurationList section */
404 | };
405 | rootObject = BD9A5AE419F1D41400C1F777 /* Project object */;
406 | }
407 |
--------------------------------------------------------------------------------
/ACScrollNavBar/ACScrollNavBar.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ACScrollNavBar/ACScrollNavBar/ACScrollNavBar.h:
--------------------------------------------------------------------------------
1 | //
2 | // ACScrollNavBar.h
3 | // ACScrollNavBar
4 | //
5 | // Created by Alex Corre on 10/17/14.
6 | // Copyright (c) 2014 Alex Corre. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for ACScrollNavBar.
12 | FOUNDATION_EXPORT double ACScrollNavBarVersionNumber;
13 |
14 | //! Project version string for ACScrollNavBar.
15 | FOUNDATION_EXPORT const unsigned char ACScrollNavBarVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ACScrollNavBar/ACScrollNavBar/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.alexcorre.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ACScrollNavBar/ACScrollNavBar/UINavigationBar+Scrollable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UINavigationBar+Scrollable.swift
3 | // ACScrollNavigationBarExample
4 | //
5 | // Created by Alex Corre on 10/17/14.
6 | // Copyright (c) 2014 Alex Corre. All rights reserved.
7 | //
8 |
9 | extension UINavigationBar {
10 |
11 |
12 | /// Resets this UINavigationBar to its natural position (not collapsed).
13 | ///
14 | /// :param: animated Whether or not to animate the change
15 | /// :param: scrollProvider A NavigationScrollProvider to be informed of the change
16 | public func scroll_nav_resetToDefaultPosition(animated: Bool, scrollProvider: NavigationScrollProvider) {
17 | var defaultFrame = frame
18 | defaultFrame.origin.y = scroll_nav_statusBarHeight()
19 | scroll_nav_setFrame(defaultFrame, alpha: 1.0, animated: animated, scrollProvider: scrollProvider)
20 | }
21 |
22 |
23 | /// Adjusts the frame of this UINavigation bar to the given frame, with a content alpha.
24 | ///
25 | /// :param: newFrame The frame to give this UINavigationBar
26 | /// :param: alpha The alpha of the content
27 | /// :param: animated Whether we should animate the frame / alpha change
28 | /// :param: scrollProvider The NavigationScrollProvider associated with this change being made. It will be adjusted accordingly.
29 | public func scroll_nav_setFrame(newFrame: CGRect, alpha: CGFloat, animated: Bool, scrollProvider: NavigationScrollProvider) {
30 |
31 | func moveFrame() {
32 | var offsetY = CGRectGetMinY(newFrame) - CGRectGetMinY(self.frame)
33 |
34 | // set all subviews alphas to desired alpha...except background view which is (always?) first subview
35 | for subview in self.subviews as [UIView] {
36 | var isBackgroundView = (subview === self.subviews[0])
37 | var isViewHidden = subview.hidden || subview.alpha == 0.0
38 |
39 | if !(isBackgroundView || isViewHidden) {
40 | subview.alpha = alpha
41 | }
42 | }
43 |
44 | // move the navbar
45 | self.frame = newFrame
46 |
47 | // adjust scrollview contentInset
48 | scrollProvider.adjustScrollingViewInsets()
49 | }
50 |
51 | // Animate the moveFrame() changes if desired, otherwise just execute them
52 | if animated {
53 | UIView.animateWithDuration(0.2, animations: moveFrame)
54 | } else {
55 | moveFrame()
56 | }
57 | }
58 |
59 |
60 | /// Convenience getter for the height of the status bar frame. On iOS 7 takes into account the
61 | /// user interface orientation. On iOS 8 this is not necessary.
62 | public func scroll_nav_statusBarHeight() -> CGFloat {
63 | let application = UIApplication.sharedApplication()
64 | let orientation = application.statusBarOrientation
65 | let statusBarFrame = application.statusBarFrame
66 |
67 | let versions = UIDevice.currentDevice().systemVersion.componentsSeparatedByString(".")
68 | if versions[0] == "7" {
69 | // ios 7 code
70 | switch orientation {
71 | case UIInterfaceOrientation.Portrait, UIInterfaceOrientation.PortraitUpsideDown:
72 | return statusBarFrame.height
73 | case UIInterfaceOrientation.LandscapeLeft, UIInterfaceOrientation.LandscapeRight:
74 | return statusBarFrame.width
75 | default:
76 | return statusBarFrame.height
77 | }
78 | } else if versions[0] == "8" {
79 | // ios 8 code
80 | return statusBarFrame.height
81 | } else {
82 | return 20.0
83 | }
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/ACScrollNavBar/ACScrollNavBar/UIViewController+ScrollingNavbar.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+ScrollingNavbar.swift
3 | // ACScrollNavigationBarExample
4 | //
5 | // Created by Alex Corre on 9/16/14.
6 | // Copyright (c) 2014 Alex Corre. All rights reserved.
7 | //
8 |
9 | let NearZero: CGFloat = 0.000001
10 |
11 | public enum NavigationScrollProviderScrollState: String {
12 | case None = "NONE"
13 | case ScrollingUp = "SCROLLING_UP"
14 | case ScrollingDown = "SCROLLING_DOWN"
15 | }
16 |
17 | @objc public protocol NavigationScrollProvider {
18 | var panGesture: UIPanGestureRecognizer { get set }
19 | var scrollState: String { get set }
20 | var gestureIsActive: Bool { get set }
21 | var lastContentOffsetY: CGFloat { get set }
22 |
23 | func navigationScrollingView() -> UIScrollView
24 | func adjustScrollingViewInsets()
25 | }
26 |
27 | extension UIViewController: UIGestureRecognizerDelegate {
28 |
29 |
30 | /// If this UIViewController instance implements the NavigationScrollProvider protocol, binds
31 | /// scrolling of the provided navigation scrolling view to the hiding / showing of the navigation
32 | /// bar.
33 | ///
34 | /// If this instance does not implement the NavigationScrollProvider protocol, or is not
35 | /// contained in a UINavigationController, this method is a noop.
36 | public func bindNavigationScrolling() {
37 | if let scrollProvider = self as? NavigationScrollProvider {
38 | if navigationController == nil {
39 | return
40 | }
41 |
42 | // here we know this UIViewController instance implements NavigationScrollProvider
43 | // and is contained in a UINavigationController
44 | var panGesture = UIPanGestureRecognizer(target: self, action: "handlePan:")
45 | panGesture.delegate = self
46 | selfAsScrollProvider().panGesture = panGesture
47 |
48 | // bind to notifications
49 | bindNotifications()
50 |
51 | // clean the panGesture and add it to the newly set scrollView
52 | selfAsScrollProvider().navigationScrollingView().addGestureRecognizer(panGesture)
53 | } else {
54 | return
55 | }
56 | }
57 |
58 |
59 | /// If this UIViewController instance implements the NavigationScrollProvider protocol and is
60 | /// contained within a UINavigationController, will reset the UINavigationBar position.
61 | public func resetNavBarPosition() {
62 | if navigationController == nil {
63 | return
64 | }
65 |
66 | if let scrollProvider = self as? NavigationScrollProvider {
67 | navigationController!.navigationBar.scroll_nav_resetToDefaultPosition(true, scrollProvider: scrollProvider)
68 | }
69 |
70 | }
71 |
72 | // MARK: - Pan Gesture Handling
73 |
74 | public func handlePan(gesture: UIPanGestureRecognizer) {
75 | let scrollProvider = selfAsScrollProvider()
76 | let myScrollView = scrollProvider.navigationScrollingView()
77 |
78 | // return if the gesture is not attached to our scroll view
79 | if gesture.view !== myScrollView {
80 | return
81 | }
82 |
83 | if myScrollView.frame.size.height + (navigationController!.navigationBar.bounds.size.height * 2) >= myScrollView.contentSize.height {
84 | return
85 | }
86 |
87 | let contentOffsetY = myScrollView.contentOffset.y
88 |
89 | // Do nothing if we are scrolling the contentInset (padding)
90 | if contentOffsetY < -myScrollView.contentInset.top {
91 | return
92 | }
93 |
94 | // if the gesture just started...reset the state and store the last offset
95 | if gesture.state == .Began {
96 | scrollProvider.scrollState = NavigationScrollProviderScrollState.None.rawValue
97 | scrollProvider.lastContentOffsetY = contentOffsetY
98 | scrollProvider.gestureIsActive = true
99 | return
100 | }
101 |
102 | var deltaY = contentOffsetY - scrollProvider.lastContentOffsetY
103 | if deltaY < 0.0 {
104 | scrollProvider.scrollState = NavigationScrollProviderScrollState.ScrollingDown.rawValue
105 | } else if deltaY > 0.0 {
106 | scrollProvider.scrollState = NavigationScrollProviderScrollState.ScrollingUp.rawValue
107 | }
108 |
109 | var newFrame = navigationController!.navigationBar.frame
110 | var alpha: CGFloat = 1.0
111 | var statusBarHeight = navigationController!.navigationBar.scroll_nav_statusBarHeight()
112 | var maxY = statusBarHeight
113 | var minY = maxY - CGRectGetHeight(newFrame) + 1.0
114 |
115 | let isScrolling = scrollProvider.scrollState == NavigationScrollProviderScrollState.ScrollingUp.rawValue || scrollProvider.scrollState == NavigationScrollProviderScrollState.ScrollingDown.rawValue
116 | scrollProvider.gestureIsActive = gesture.state != .Ended && gesture.state != .Cancelled
117 |
118 | if isScrolling && !scrollProvider.gestureIsActive {
119 | var contentOffsetYDelta: CGFloat = 0.0
120 | if scrollProvider.scrollState == NavigationScrollProviderScrollState.ScrollingDown.rawValue {
121 | contentOffsetYDelta = maxY - newFrame.origin.y
122 | newFrame.origin.y = maxY
123 | alpha = 1.0
124 | }
125 | else if scrollProvider.scrollState == NavigationScrollProviderScrollState.ScrollingUp.rawValue {
126 | contentOffsetYDelta = minY - newFrame.origin.y
127 | newFrame.origin.y = minY
128 | alpha = NearZero
129 | }
130 |
131 | navigationController!.navigationBar.scroll_nav_setFrame(newFrame, alpha: alpha, animated: true, scrollProvider: scrollProvider)
132 |
133 | if !myScrollView.decelerating {
134 | var newContentOffset = CGPointMake(myScrollView.contentOffset.x, contentOffsetY - contentOffsetYDelta)
135 | myScrollView.setContentOffset(newContentOffset, animated: true)
136 | }
137 |
138 | } else {
139 | newFrame.origin.y -= deltaY;
140 | newFrame.origin.y = min(maxY, max(newFrame.origin.y, minY))
141 |
142 | alpha = (newFrame.origin.y - (minY + statusBarHeight)) / (maxY - (minY + statusBarHeight))
143 | alpha = max(NearZero, alpha);
144 |
145 | navigationController!.navigationBar.scroll_nav_setFrame(newFrame, alpha: alpha, animated: false, scrollProvider: scrollProvider)
146 | }
147 |
148 | scrollProvider.lastContentOffsetY = contentOffsetY
149 | }
150 |
151 | // MARK: - NavigationScrollProvider
152 |
153 | public func adjustScrollingViewInsets() {
154 | let scrollProvider = selfAsScrollProvider()
155 | var scrollView = scrollProvider.navigationScrollingView()
156 |
157 | if scrollView.contentInset.top == 0 && scrollView.contentOffset.y == 0 {
158 | return
159 | }
160 |
161 | var insets = scrollView.contentInset
162 | insets.top = navigationController!.navigationBar.frame.origin.y + navigationController!.navigationBar.frame.size.height
163 | scrollView.contentInset = insets
164 |
165 | let isAtTop = !scrollProvider.gestureIsActive && scrollView.contentOffset.y <= 0
166 | if isAtTop && scrollView.contentOffset.y != scrollView.contentInset.top {
167 | let newContentOffset = CGPointMake(scrollView.contentOffset.x, -scrollView.contentInset.top)
168 | scrollView.setContentOffset(newContentOffset, animated: false)
169 | }
170 | }
171 |
172 | // MARK: - UIGestureRecognizerDelegate
173 |
174 | public func gestureRecognizer(gestureRecognizer: UIGestureRecognizer!, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer!) -> Bool {
175 | return true
176 | }
177 |
178 | // MARK: - Notifications
179 |
180 | private func bindNotifications() {
181 | NSNotificationCenter.defaultCenter().addObserver(self, selector: "statusBarOrientationDidChange", name: UIApplicationDidChangeStatusBarOrientationNotification, object: nil)
182 | NSNotificationCenter.defaultCenter().addObserver(self, selector: "applicationDidBecomeActive", name: UIApplicationDidBecomeActiveNotification, object: nil)
183 | }
184 |
185 | private func unbindNotifications() {
186 | NSNotificationCenter.defaultCenter().removeObserver(self, name: UIApplicationDidChangeStatusBarOrientationNotification, object: nil)
187 | NSNotificationCenter.defaultCenter().removeObserver(self, name: UIApplicationDidBecomeActiveNotification, object: nil)
188 | }
189 |
190 | public func statusBarOrientationDidChange() {
191 | selfAsScrollProvider().scrollState = NavigationScrollProviderScrollState.None.rawValue
192 | navigationController!.navigationBar.scroll_nav_resetToDefaultPosition(false, scrollProvider: selfAsScrollProvider())
193 | }
194 |
195 | public func applicationDidBecomeActive() {
196 | selfAsScrollProvider().scrollState = NavigationScrollProviderScrollState.None.rawValue
197 | navigationController!.navigationBar.scroll_nav_resetToDefaultPosition(false, scrollProvider: selfAsScrollProvider())
198 | }
199 |
200 | // MARK: - Helpers
201 |
202 | /**
203 | Helper for getting self as a NavigationScrollProvider. This will crash if its called
204 | by a non-conformer. Should only be called from bindNavigationScrolling() which ensures
205 | this cast will succeed.
206 | */
207 | private func selfAsScrollProvider() -> NavigationScrollProvider {
208 | return self as NavigationScrollProvider
209 | }
210 |
211 | }
--------------------------------------------------------------------------------
/ACScrollNavBar/ACScrollNavBarTests/ACScrollNavBarTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ACScrollNavBarTests.swift
3 | // ACScrollNavBarTests
4 | //
5 | // Created by Alex Corre on 10/17/14.
6 | // Copyright (c) 2014 Alex Corre. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import XCTest
11 |
12 | class ACScrollNavBarTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | XCTAssert(true, "Pass")
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measureBlock() {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/ACScrollNavBar/ACScrollNavBarTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.alexcorre.$(PRODUCT_NAME:rfc1034identifier)
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 |
--------------------------------------------------------------------------------
/DemoApp/DemoApp.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0E10A4151A06D1A300E3C704 /* ACScrollNavBar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E10A4101A06D18300E3C704 /* ACScrollNavBar.framework */; };
11 | 0E10A4161A06D1A300E3C704 /* ACScrollNavBar.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0E10A4101A06D18300E3C704 /* ACScrollNavBar.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
12 | BD9A5B1B19F1D65400C1F777 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9A5B1A19F1D65400C1F777 /* AppDelegate.swift */; };
13 | BD9A5B1D19F1D65400C1F777 /* RootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9A5B1C19F1D65400C1F777 /* RootViewController.swift */; };
14 | BD9A5B2019F1D65400C1F777 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BD9A5B1E19F1D65400C1F777 /* Main.storyboard */; };
15 | BD9A5B2219F1D65400C1F777 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD9A5B2119F1D65400C1F777 /* Images.xcassets */; };
16 | BD9A5B2519F1D65400C1F777 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = BD9A5B2319F1D65400C1F777 /* LaunchScreen.xib */; };
17 | BD9A5B3119F1D65400C1F777 /* DemoAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9A5B3019F1D65400C1F777 /* DemoAppTests.swift */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXContainerItemProxy section */
21 | 0E10A40F1A06D18300E3C704 /* PBXContainerItemProxy */ = {
22 | isa = PBXContainerItemProxy;
23 | containerPortal = 0E10A40A1A06D18300E3C704 /* ACScrollNavBar.xcodeproj */;
24 | proxyType = 2;
25 | remoteGlobalIDString = BD9A5AED19F1D41400C1F777;
26 | remoteInfo = ACScrollNavBar;
27 | };
28 | 0E10A4111A06D18300E3C704 /* PBXContainerItemProxy */ = {
29 | isa = PBXContainerItemProxy;
30 | containerPortal = 0E10A40A1A06D18300E3C704 /* ACScrollNavBar.xcodeproj */;
31 | proxyType = 2;
32 | remoteGlobalIDString = BD9A5AF819F1D41400C1F777;
33 | remoteInfo = ACScrollNavBarTests;
34 | };
35 | 0E10A4131A06D19300E3C704 /* PBXContainerItemProxy */ = {
36 | isa = PBXContainerItemProxy;
37 | containerPortal = 0E10A40A1A06D18300E3C704 /* ACScrollNavBar.xcodeproj */;
38 | proxyType = 1;
39 | remoteGlobalIDString = BD9A5AEC19F1D41400C1F777;
40 | remoteInfo = ACScrollNavBar;
41 | };
42 | 0E10A4171A06D1A300E3C704 /* PBXContainerItemProxy */ = {
43 | isa = PBXContainerItemProxy;
44 | containerPortal = 0E10A40A1A06D18300E3C704 /* ACScrollNavBar.xcodeproj */;
45 | proxyType = 1;
46 | remoteGlobalIDString = BD9A5AEC19F1D41400C1F777;
47 | remoteInfo = ACScrollNavBar;
48 | };
49 | BD9A5B2B19F1D65400C1F777 /* PBXContainerItemProxy */ = {
50 | isa = PBXContainerItemProxy;
51 | containerPortal = BD9A5B0D19F1D65400C1F777 /* Project object */;
52 | proxyType = 1;
53 | remoteGlobalIDString = BD9A5B1419F1D65400C1F777;
54 | remoteInfo = DemoApp;
55 | };
56 | /* End PBXContainerItemProxy section */
57 |
58 | /* Begin PBXCopyFilesBuildPhase section */
59 | 0E10A4191A06D1A300E3C704 /* Embed Frameworks */ = {
60 | isa = PBXCopyFilesBuildPhase;
61 | buildActionMask = 2147483647;
62 | dstPath = "";
63 | dstSubfolderSpec = 10;
64 | files = (
65 | 0E10A4161A06D1A300E3C704 /* ACScrollNavBar.framework in Embed Frameworks */,
66 | );
67 | name = "Embed Frameworks";
68 | runOnlyForDeploymentPostprocessing = 0;
69 | };
70 | /* End PBXCopyFilesBuildPhase section */
71 |
72 | /* Begin PBXFileReference section */
73 | 0E10A40A1A06D18300E3C704 /* ACScrollNavBar.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ACScrollNavBar.xcodeproj; path = ../ACScrollNavBar/ACScrollNavBar.xcodeproj; sourceTree = ""; };
74 | BD9A5B1519F1D65400C1F777 /* DemoApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DemoApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
75 | BD9A5B1919F1D65400C1F777 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
76 | BD9A5B1A19F1D65400C1F777 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
77 | BD9A5B1C19F1D65400C1F777 /* RootViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootViewController.swift; sourceTree = ""; };
78 | BD9A5B1F19F1D65400C1F777 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
79 | BD9A5B2119F1D65400C1F777 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
80 | BD9A5B2419F1D65400C1F777 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
81 | BD9A5B2A19F1D65400C1F777 /* DemoAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
82 | BD9A5B2F19F1D65400C1F777 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
83 | BD9A5B3019F1D65400C1F777 /* DemoAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoAppTests.swift; sourceTree = ""; };
84 | /* End PBXFileReference section */
85 |
86 | /* Begin PBXFrameworksBuildPhase section */
87 | BD9A5B1219F1D65400C1F777 /* Frameworks */ = {
88 | isa = PBXFrameworksBuildPhase;
89 | buildActionMask = 2147483647;
90 | files = (
91 | 0E10A4151A06D1A300E3C704 /* ACScrollNavBar.framework in Frameworks */,
92 | );
93 | runOnlyForDeploymentPostprocessing = 0;
94 | };
95 | BD9A5B2719F1D65400C1F777 /* Frameworks */ = {
96 | isa = PBXFrameworksBuildPhase;
97 | buildActionMask = 2147483647;
98 | files = (
99 | );
100 | runOnlyForDeploymentPostprocessing = 0;
101 | };
102 | /* End PBXFrameworksBuildPhase section */
103 |
104 | /* Begin PBXGroup section */
105 | 0E10A40B1A06D18300E3C704 /* Products */ = {
106 | isa = PBXGroup;
107 | children = (
108 | 0E10A4101A06D18300E3C704 /* ACScrollNavBar.framework */,
109 | 0E10A4121A06D18300E3C704 /* ACScrollNavBarTests.xctest */,
110 | );
111 | name = Products;
112 | sourceTree = "";
113 | };
114 | BD9A5B0C19F1D65400C1F777 = {
115 | isa = PBXGroup;
116 | children = (
117 | 0E10A40A1A06D18300E3C704 /* ACScrollNavBar.xcodeproj */,
118 | BD9A5B1719F1D65400C1F777 /* DemoApp */,
119 | BD9A5B2D19F1D65400C1F777 /* DemoAppTests */,
120 | BD9A5B1619F1D65400C1F777 /* Products */,
121 | );
122 | sourceTree = "";
123 | };
124 | BD9A5B1619F1D65400C1F777 /* Products */ = {
125 | isa = PBXGroup;
126 | children = (
127 | BD9A5B1519F1D65400C1F777 /* DemoApp.app */,
128 | BD9A5B2A19F1D65400C1F777 /* DemoAppTests.xctest */,
129 | );
130 | name = Products;
131 | sourceTree = "";
132 | };
133 | BD9A5B1719F1D65400C1F777 /* DemoApp */ = {
134 | isa = PBXGroup;
135 | children = (
136 | BD9A5B1A19F1D65400C1F777 /* AppDelegate.swift */,
137 | BD9A5B1C19F1D65400C1F777 /* RootViewController.swift */,
138 | BD9A5B1E19F1D65400C1F777 /* Main.storyboard */,
139 | BD9A5B2119F1D65400C1F777 /* Images.xcassets */,
140 | BD9A5B2319F1D65400C1F777 /* LaunchScreen.xib */,
141 | BD9A5B1819F1D65400C1F777 /* Supporting Files */,
142 | );
143 | path = DemoApp;
144 | sourceTree = "";
145 | };
146 | BD9A5B1819F1D65400C1F777 /* Supporting Files */ = {
147 | isa = PBXGroup;
148 | children = (
149 | BD9A5B1919F1D65400C1F777 /* Info.plist */,
150 | );
151 | name = "Supporting Files";
152 | sourceTree = "";
153 | };
154 | BD9A5B2D19F1D65400C1F777 /* DemoAppTests */ = {
155 | isa = PBXGroup;
156 | children = (
157 | BD9A5B3019F1D65400C1F777 /* DemoAppTests.swift */,
158 | BD9A5B2E19F1D65400C1F777 /* Supporting Files */,
159 | );
160 | path = DemoAppTests;
161 | sourceTree = "";
162 | };
163 | BD9A5B2E19F1D65400C1F777 /* Supporting Files */ = {
164 | isa = PBXGroup;
165 | children = (
166 | BD9A5B2F19F1D65400C1F777 /* Info.plist */,
167 | );
168 | name = "Supporting Files";
169 | sourceTree = "";
170 | };
171 | /* End PBXGroup section */
172 |
173 | /* Begin PBXNativeTarget section */
174 | BD9A5B1419F1D65400C1F777 /* DemoApp */ = {
175 | isa = PBXNativeTarget;
176 | buildConfigurationList = BD9A5B3419F1D65400C1F777 /* Build configuration list for PBXNativeTarget "DemoApp" */;
177 | buildPhases = (
178 | BD9A5B1119F1D65400C1F777 /* Sources */,
179 | BD9A5B1219F1D65400C1F777 /* Frameworks */,
180 | BD9A5B1319F1D65400C1F777 /* Resources */,
181 | 0E10A4191A06D1A300E3C704 /* Embed Frameworks */,
182 | );
183 | buildRules = (
184 | );
185 | dependencies = (
186 | 0E10A4141A06D19300E3C704 /* PBXTargetDependency */,
187 | 0E10A4181A06D1A300E3C704 /* PBXTargetDependency */,
188 | );
189 | name = DemoApp;
190 | productName = DemoApp;
191 | productReference = BD9A5B1519F1D65400C1F777 /* DemoApp.app */;
192 | productType = "com.apple.product-type.application";
193 | };
194 | BD9A5B2919F1D65400C1F777 /* DemoAppTests */ = {
195 | isa = PBXNativeTarget;
196 | buildConfigurationList = BD9A5B3719F1D65400C1F777 /* Build configuration list for PBXNativeTarget "DemoAppTests" */;
197 | buildPhases = (
198 | BD9A5B2619F1D65400C1F777 /* Sources */,
199 | BD9A5B2719F1D65400C1F777 /* Frameworks */,
200 | BD9A5B2819F1D65400C1F777 /* Resources */,
201 | );
202 | buildRules = (
203 | );
204 | dependencies = (
205 | BD9A5B2C19F1D65400C1F777 /* PBXTargetDependency */,
206 | );
207 | name = DemoAppTests;
208 | productName = DemoAppTests;
209 | productReference = BD9A5B2A19F1D65400C1F777 /* DemoAppTests.xctest */;
210 | productType = "com.apple.product-type.bundle.unit-test";
211 | };
212 | /* End PBXNativeTarget section */
213 |
214 | /* Begin PBXProject section */
215 | BD9A5B0D19F1D65400C1F777 /* Project object */ = {
216 | isa = PBXProject;
217 | attributes = {
218 | LastUpgradeCheck = 0600;
219 | ORGANIZATIONNAME = "Alex Corre";
220 | TargetAttributes = {
221 | BD9A5B1419F1D65400C1F777 = {
222 | CreatedOnToolsVersion = 6.0.1;
223 | };
224 | BD9A5B2919F1D65400C1F777 = {
225 | CreatedOnToolsVersion = 6.0.1;
226 | TestTargetID = BD9A5B1419F1D65400C1F777;
227 | };
228 | };
229 | };
230 | buildConfigurationList = BD9A5B1019F1D65400C1F777 /* Build configuration list for PBXProject "DemoApp" */;
231 | compatibilityVersion = "Xcode 3.2";
232 | developmentRegion = English;
233 | hasScannedForEncodings = 0;
234 | knownRegions = (
235 | en,
236 | Base,
237 | );
238 | mainGroup = BD9A5B0C19F1D65400C1F777;
239 | productRefGroup = BD9A5B1619F1D65400C1F777 /* Products */;
240 | projectDirPath = "";
241 | projectReferences = (
242 | {
243 | ProductGroup = 0E10A40B1A06D18300E3C704 /* Products */;
244 | ProjectRef = 0E10A40A1A06D18300E3C704 /* ACScrollNavBar.xcodeproj */;
245 | },
246 | );
247 | projectRoot = "";
248 | targets = (
249 | BD9A5B1419F1D65400C1F777 /* DemoApp */,
250 | BD9A5B2919F1D65400C1F777 /* DemoAppTests */,
251 | );
252 | };
253 | /* End PBXProject section */
254 |
255 | /* Begin PBXReferenceProxy section */
256 | 0E10A4101A06D18300E3C704 /* ACScrollNavBar.framework */ = {
257 | isa = PBXReferenceProxy;
258 | fileType = wrapper.framework;
259 | path = ACScrollNavBar.framework;
260 | remoteRef = 0E10A40F1A06D18300E3C704 /* PBXContainerItemProxy */;
261 | sourceTree = BUILT_PRODUCTS_DIR;
262 | };
263 | 0E10A4121A06D18300E3C704 /* ACScrollNavBarTests.xctest */ = {
264 | isa = PBXReferenceProxy;
265 | fileType = wrapper.cfbundle;
266 | path = ACScrollNavBarTests.xctest;
267 | remoteRef = 0E10A4111A06D18300E3C704 /* PBXContainerItemProxy */;
268 | sourceTree = BUILT_PRODUCTS_DIR;
269 | };
270 | /* End PBXReferenceProxy section */
271 |
272 | /* Begin PBXResourcesBuildPhase section */
273 | BD9A5B1319F1D65400C1F777 /* Resources */ = {
274 | isa = PBXResourcesBuildPhase;
275 | buildActionMask = 2147483647;
276 | files = (
277 | BD9A5B2019F1D65400C1F777 /* Main.storyboard in Resources */,
278 | BD9A5B2519F1D65400C1F777 /* LaunchScreen.xib in Resources */,
279 | BD9A5B2219F1D65400C1F777 /* Images.xcassets in Resources */,
280 | );
281 | runOnlyForDeploymentPostprocessing = 0;
282 | };
283 | BD9A5B2819F1D65400C1F777 /* Resources */ = {
284 | isa = PBXResourcesBuildPhase;
285 | buildActionMask = 2147483647;
286 | files = (
287 | );
288 | runOnlyForDeploymentPostprocessing = 0;
289 | };
290 | /* End PBXResourcesBuildPhase section */
291 |
292 | /* Begin PBXSourcesBuildPhase section */
293 | BD9A5B1119F1D65400C1F777 /* Sources */ = {
294 | isa = PBXSourcesBuildPhase;
295 | buildActionMask = 2147483647;
296 | files = (
297 | BD9A5B1D19F1D65400C1F777 /* RootViewController.swift in Sources */,
298 | BD9A5B1B19F1D65400C1F777 /* AppDelegate.swift in Sources */,
299 | );
300 | runOnlyForDeploymentPostprocessing = 0;
301 | };
302 | BD9A5B2619F1D65400C1F777 /* Sources */ = {
303 | isa = PBXSourcesBuildPhase;
304 | buildActionMask = 2147483647;
305 | files = (
306 | BD9A5B3119F1D65400C1F777 /* DemoAppTests.swift in Sources */,
307 | );
308 | runOnlyForDeploymentPostprocessing = 0;
309 | };
310 | /* End PBXSourcesBuildPhase section */
311 |
312 | /* Begin PBXTargetDependency section */
313 | 0E10A4141A06D19300E3C704 /* PBXTargetDependency */ = {
314 | isa = PBXTargetDependency;
315 | name = ACScrollNavBar;
316 | targetProxy = 0E10A4131A06D19300E3C704 /* PBXContainerItemProxy */;
317 | };
318 | 0E10A4181A06D1A300E3C704 /* PBXTargetDependency */ = {
319 | isa = PBXTargetDependency;
320 | name = ACScrollNavBar;
321 | targetProxy = 0E10A4171A06D1A300E3C704 /* PBXContainerItemProxy */;
322 | };
323 | BD9A5B2C19F1D65400C1F777 /* PBXTargetDependency */ = {
324 | isa = PBXTargetDependency;
325 | target = BD9A5B1419F1D65400C1F777 /* DemoApp */;
326 | targetProxy = BD9A5B2B19F1D65400C1F777 /* PBXContainerItemProxy */;
327 | };
328 | /* End PBXTargetDependency section */
329 |
330 | /* Begin PBXVariantGroup section */
331 | BD9A5B1E19F1D65400C1F777 /* Main.storyboard */ = {
332 | isa = PBXVariantGroup;
333 | children = (
334 | BD9A5B1F19F1D65400C1F777 /* Base */,
335 | );
336 | name = Main.storyboard;
337 | sourceTree = "";
338 | };
339 | BD9A5B2319F1D65400C1F777 /* LaunchScreen.xib */ = {
340 | isa = PBXVariantGroup;
341 | children = (
342 | BD9A5B2419F1D65400C1F777 /* Base */,
343 | );
344 | name = LaunchScreen.xib;
345 | sourceTree = "";
346 | };
347 | /* End PBXVariantGroup section */
348 |
349 | /* Begin XCBuildConfiguration section */
350 | BD9A5B3219F1D65400C1F777 /* Debug */ = {
351 | isa = XCBuildConfiguration;
352 | buildSettings = {
353 | ALWAYS_SEARCH_USER_PATHS = NO;
354 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
355 | CLANG_CXX_LIBRARY = "libc++";
356 | CLANG_ENABLE_MODULES = YES;
357 | CLANG_ENABLE_OBJC_ARC = YES;
358 | CLANG_WARN_BOOL_CONVERSION = YES;
359 | CLANG_WARN_CONSTANT_CONVERSION = YES;
360 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
361 | CLANG_WARN_EMPTY_BODY = YES;
362 | CLANG_WARN_ENUM_CONVERSION = YES;
363 | CLANG_WARN_INT_CONVERSION = YES;
364 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
365 | CLANG_WARN_UNREACHABLE_CODE = YES;
366 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
367 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
368 | COPY_PHASE_STRIP = NO;
369 | ENABLE_STRICT_OBJC_MSGSEND = YES;
370 | GCC_C_LANGUAGE_STANDARD = gnu99;
371 | GCC_DYNAMIC_NO_PIC = NO;
372 | GCC_OPTIMIZATION_LEVEL = 0;
373 | GCC_PREPROCESSOR_DEFINITIONS = (
374 | "DEBUG=1",
375 | "$(inherited)",
376 | );
377 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
378 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
379 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
380 | GCC_WARN_UNDECLARED_SELECTOR = YES;
381 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
382 | GCC_WARN_UNUSED_FUNCTION = YES;
383 | GCC_WARN_UNUSED_VARIABLE = YES;
384 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
385 | MTL_ENABLE_DEBUG_INFO = YES;
386 | ONLY_ACTIVE_ARCH = YES;
387 | SDKROOT = iphoneos;
388 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
389 | };
390 | name = Debug;
391 | };
392 | BD9A5B3319F1D65400C1F777 /* Release */ = {
393 | isa = XCBuildConfiguration;
394 | buildSettings = {
395 | ALWAYS_SEARCH_USER_PATHS = NO;
396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
397 | CLANG_CXX_LIBRARY = "libc++";
398 | CLANG_ENABLE_MODULES = YES;
399 | CLANG_ENABLE_OBJC_ARC = YES;
400 | CLANG_WARN_BOOL_CONVERSION = YES;
401 | CLANG_WARN_CONSTANT_CONVERSION = YES;
402 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
403 | CLANG_WARN_EMPTY_BODY = YES;
404 | CLANG_WARN_ENUM_CONVERSION = YES;
405 | CLANG_WARN_INT_CONVERSION = YES;
406 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
407 | CLANG_WARN_UNREACHABLE_CODE = YES;
408 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
409 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
410 | COPY_PHASE_STRIP = YES;
411 | ENABLE_NS_ASSERTIONS = NO;
412 | ENABLE_STRICT_OBJC_MSGSEND = YES;
413 | GCC_C_LANGUAGE_STANDARD = gnu99;
414 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
415 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
416 | GCC_WARN_UNDECLARED_SELECTOR = YES;
417 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
418 | GCC_WARN_UNUSED_FUNCTION = YES;
419 | GCC_WARN_UNUSED_VARIABLE = YES;
420 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
421 | MTL_ENABLE_DEBUG_INFO = NO;
422 | SDKROOT = iphoneos;
423 | VALIDATE_PRODUCT = YES;
424 | };
425 | name = Release;
426 | };
427 | BD9A5B3519F1D65400C1F777 /* Debug */ = {
428 | isa = XCBuildConfiguration;
429 | buildSettings = {
430 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
431 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
432 | FRAMEWORK_SEARCH_PATHS = (
433 | "$(inherited)",
434 | "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/ACScrollNavBar-ekmxsyqvxxcdobggogmelwjoqdbc/Build/Products/Debug-iphoneos",
435 | "/Users/alexcorre/dev/ACScrollNavigationBar/ACScrollNavBar/build/Debug-iphoneos",
436 | );
437 | INFOPLIST_FILE = DemoApp/Info.plist;
438 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
439 | PRODUCT_NAME = "$(TARGET_NAME)";
440 | };
441 | name = Debug;
442 | };
443 | BD9A5B3619F1D65400C1F777 /* Release */ = {
444 | isa = XCBuildConfiguration;
445 | buildSettings = {
446 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
447 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
448 | FRAMEWORK_SEARCH_PATHS = (
449 | "$(inherited)",
450 | "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/ACScrollNavBar-ekmxsyqvxxcdobggogmelwjoqdbc/Build/Products/Debug-iphoneos",
451 | "/Users/alexcorre/dev/ACScrollNavigationBar/ACScrollNavBar/build/Debug-iphoneos",
452 | );
453 | INFOPLIST_FILE = DemoApp/Info.plist;
454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
455 | PRODUCT_NAME = "$(TARGET_NAME)";
456 | };
457 | name = Release;
458 | };
459 | BD9A5B3819F1D65400C1F777 /* Debug */ = {
460 | isa = XCBuildConfiguration;
461 | buildSettings = {
462 | BUNDLE_LOADER = "$(TEST_HOST)";
463 | FRAMEWORK_SEARCH_PATHS = (
464 | "$(SDKROOT)/Developer/Library/Frameworks",
465 | "$(inherited)",
466 | );
467 | GCC_PREPROCESSOR_DEFINITIONS = (
468 | "DEBUG=1",
469 | "$(inherited)",
470 | );
471 | INFOPLIST_FILE = DemoAppTests/Info.plist;
472 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
473 | PRODUCT_NAME = "$(TARGET_NAME)";
474 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DemoApp.app/DemoApp";
475 | };
476 | name = Debug;
477 | };
478 | BD9A5B3919F1D65400C1F777 /* Release */ = {
479 | isa = XCBuildConfiguration;
480 | buildSettings = {
481 | BUNDLE_LOADER = "$(TEST_HOST)";
482 | FRAMEWORK_SEARCH_PATHS = (
483 | "$(SDKROOT)/Developer/Library/Frameworks",
484 | "$(inherited)",
485 | );
486 | INFOPLIST_FILE = DemoAppTests/Info.plist;
487 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
488 | PRODUCT_NAME = "$(TARGET_NAME)";
489 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DemoApp.app/DemoApp";
490 | };
491 | name = Release;
492 | };
493 | /* End XCBuildConfiguration section */
494 |
495 | /* Begin XCConfigurationList section */
496 | BD9A5B1019F1D65400C1F777 /* Build configuration list for PBXProject "DemoApp" */ = {
497 | isa = XCConfigurationList;
498 | buildConfigurations = (
499 | BD9A5B3219F1D65400C1F777 /* Debug */,
500 | BD9A5B3319F1D65400C1F777 /* Release */,
501 | );
502 | defaultConfigurationIsVisible = 0;
503 | defaultConfigurationName = Release;
504 | };
505 | BD9A5B3419F1D65400C1F777 /* Build configuration list for PBXNativeTarget "DemoApp" */ = {
506 | isa = XCConfigurationList;
507 | buildConfigurations = (
508 | BD9A5B3519F1D65400C1F777 /* Debug */,
509 | BD9A5B3619F1D65400C1F777 /* Release */,
510 | );
511 | defaultConfigurationIsVisible = 0;
512 | defaultConfigurationName = Release;
513 | };
514 | BD9A5B3719F1D65400C1F777 /* Build configuration list for PBXNativeTarget "DemoAppTests" */ = {
515 | isa = XCConfigurationList;
516 | buildConfigurations = (
517 | BD9A5B3819F1D65400C1F777 /* Debug */,
518 | BD9A5B3919F1D65400C1F777 /* Release */,
519 | );
520 | defaultConfigurationIsVisible = 0;
521 | defaultConfigurationName = Release;
522 | };
523 | /* End XCConfigurationList section */
524 | };
525 | rootObject = BD9A5B0D19F1D65400C1F777 /* Project object */;
526 | }
527 |
--------------------------------------------------------------------------------
/DemoApp/DemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/DemoApp/DemoApp/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // DemoApp
4 | //
5 | // Created by Alex Corre on 10/17/14.
6 | // Copyright (c) 2014 Alex Corre. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/DemoApp/DemoApp/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/DemoApp/DemoApp/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
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 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/DemoApp/DemoApp/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/DemoApp/DemoApp/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.alexcorre.$(PRODUCT_NAME:rfc1034identifier)
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 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/DemoApp/DemoApp/RootViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // DemoApp
4 | //
5 | // Created by Alex Corre on 10/17/14.
6 | // Copyright (c) 2014 Alex Corre. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ACScrollNavBar
11 |
12 | class RootViewController: UITableViewController {
13 |
14 | // MARK: - NavigationScrollProvider Stored Properties
15 |
16 | private var _panGesture: UIPanGestureRecognizer!
17 | private var _scrollState: String!
18 | private var _gestureIsActive = false
19 | private var _lastContentOffsetY: CGFloat = 0.0
20 |
21 | // MARK: - View LifeCycle
22 |
23 | override func viewDidLoad() {
24 | super.viewDidLoad()
25 | registerCells()
26 |
27 | // ACTIVATE Nav bar scrolling
28 | bindNavigationScrolling()
29 | }
30 |
31 |
32 | // MARK: - Setup
33 |
34 | func registerCells() {
35 | tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")
36 | }
37 |
38 | }
39 |
40 | // MARK: - UITableViewDataSource
41 |
42 | extension RootViewController {
43 |
44 | override func numberOfSectionsInTableView(tableView: UITableView?) -> Int {
45 | return 1
46 | }
47 |
48 | override func tableView(tableView: UITableView?, numberOfRowsInSection section: Int) -> Int {
49 | return 100
50 | }
51 |
52 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
53 | let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell
54 | var row = indexPath.row
55 | cell.textLabel?.text = String(row)
56 |
57 | return cell
58 | }
59 |
60 | }
61 |
62 | // MARK: - UIScrollViewDelegate Override
63 |
64 | extension RootViewController {
65 |
66 | override func scrollViewDidScrollToTop(scrollView: UIScrollView) {
67 | // Ensure that nav bar is reset when we scroll to the top programatically.
68 | resetNavBarPosition()
69 | }
70 |
71 | }
72 |
73 | // MARK: - NavigationScrollProvider
74 |
75 | extension RootViewController: NavigationScrollProvider {
76 |
77 | var panGesture: UIPanGestureRecognizer {
78 | get { return _panGesture }
79 | set { _panGesture = newValue }
80 | }
81 |
82 | var scrollState: String {
83 | get { return _scrollState }
84 | set { _scrollState = newValue }
85 | }
86 |
87 | var gestureIsActive: Bool {
88 | get { return _gestureIsActive }
89 | set { _gestureIsActive = newValue }
90 | }
91 |
92 | var lastContentOffsetY: CGFloat {
93 | get { return _lastContentOffsetY }
94 | set { _lastContentOffsetY = newValue }
95 | }
96 |
97 | func navigationScrollingView() -> UIScrollView {
98 | return tableView
99 | }
100 |
101 | }
102 |
103 |
--------------------------------------------------------------------------------
/DemoApp/DemoAppTests/DemoAppTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DemoAppTests.swift
3 | // DemoAppTests
4 | //
5 | // Created by Alex Corre on 10/17/14.
6 | // Copyright (c) 2014 Alex Corre. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import XCTest
11 |
12 | class DemoAppTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | XCTAssert(true, "Pass")
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measureBlock() {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/DemoApp/DemoAppTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.alexcorre.$(PRODUCT_NAME:rfc1034identifier)
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 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Alex Corre
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, 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,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #ACScrollNavigationBar (swift)
2 |
3 | > A scrollable UINavigationBar that follows a UIScrollView.
4 |
5 | 
6 |
7 | ## Overview
8 |
9 | This project is very much in beta and experimental. It was originally based on [GTScrollNavigationBar](https://github.com/luugiathuy/GTScrollNavigationBar) and shared the same API.
10 |
11 | Now, the API and implementation have changed drastically to make it easier to use in swift. Instead of having a subclass of UINavigationBar, we now are able to bring in scrollable nav functionality through two class extensions.
12 | - `UINavigationBar+Scrollable.swift`
13 | - `UIViewController+ScrollingNavBar.swift`
14 |
15 | ## Installation
16 |
17 | ### Manually
18 | For now, until CocoaPods gets swift support, add the `ACScrollNavBar` project as a subproject of your app. The ACScrollNavBar project creates a Framework. Add this framework to your apps build phases under "Target Dependencies". Also add the ACScrollNavBar framework to your project as in the "Embedded Binaries" section in General settings for the app project. After this you should be able to do an import ACScrollNavBar successfully in your app project.
19 |
20 | Check out `ACScrollNavBar.xcworkspace` for an example.
21 |
22 | ## Usage
23 |
24 | Setup the your UIViewController to implement the `NavigationScrollProvider` protocol. See example project for details.
25 |
26 | ```swift
27 | extension SampleTableViewController: NavigationScrollProvider {
28 |
29 | var panGesture: UIPanGestureRecognizer {
30 | get { return _panGesture }
31 | set { _panGesture = newValue }
32 | }
33 |
34 | var scrollState: String {
35 | get { return _scrollState }
36 | set { _scrollState = newValue }
37 | }
38 |
39 | var gestureIsActive: Bool {
40 | get { return _gestureIsActive }
41 | set { _gestureIsActive = newValue }
42 | }
43 |
44 | var lastContentOffsetY: CGFloat {
45 | get { return _lastContentOffsetY }
46 | set { _lastContentOffsetY = newValue }
47 | }
48 |
49 | func navigationScrollingView() -> UIScrollView {
50 | return tableView
51 | }
52 |
53 | }
54 |
55 | ```
56 |
57 | Note that you'll need to add some private instance properties to your view controller. This is required since the library is based on class extensions and thus cannot add stored properties to a class.
58 |
59 | ```swift
60 | class MyTableViewController: UITableViewController {
61 |
62 | // MARK: - NavigationScrollProvider Stored Properties
63 |
64 | private var _panGesture: UIPanGestureRecognizer!
65 | private var _scrollState: String!
66 | private var _gestureIsActive = false
67 | private var _lastContentOffsetY: CGFloat = 0.0
68 |
69 | }
70 | ```
71 |
72 | Once your UIViewController is implementing the NavigationScrollProvider protocol, you can simple call `bindNavigationScrolling()` on `viewDidLoad()`. If you are not inside a `UINavigationController` or dont implement the `NavigationScrollProvider` protocol, this call will do nothing.
73 |
74 | ```swift
75 |
76 | class MyTableViewController: UITableViewController {
77 |
78 | func viewDidLoad() {
79 | super.viewDidLoad()
80 | bindNavigationScrolling()
81 | }
82 |
83 | }
84 |
85 | ```
86 |
87 | If desired, implement `scrollViewDidScrollToTop(scrollView: UIScrollView!)` in your `UIScrollView's` delegate to reset the navigation bar.
88 |
89 | ```swift
90 | func scrollViewDidScrollToTop(scrollView: UIScrollView) {
91 | resetNavBarPosition()
92 | }
93 |
94 | ```
95 |
96 | Thats it...
97 |
98 | ## Contact
99 | - for questions please open an issue
100 | - twitter: [@alexcorre](http://twitter.com/alexcorre)
101 |
--------------------------------------------------------------------------------
/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexcorre/ACScrollNavigationBar/498a63aa68682f0c46a0dfddd66726ce92af3502/demo.gif
--------------------------------------------------------------------------------