├── screenshoot1.gif
├── screenshoot2.gif
├── demo
├── angleababy.jpg
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── ViewController.swift
├── JHNavBarHandle.swift
├── AppDelegate.swift
├── Base.lproj
│ ├── LaunchScreen.xib
│ └── Main.storyboard
└── JHNavigationBar.swift
├── demo.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── project.pbxproj
├── .gitignore
├── demoTests
├── Info.plist
└── demoTests.swift
├── LICENSE
├── README.md
├── JHNavigationBar
├── JHNavBarHandle.swift
└── JHNavigationBar.swift
└── JHNavigationBar.podspec
/screenshoot1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jahov0820/JHNavigationBar/HEAD/screenshoot1.gif
--------------------------------------------------------------------------------
/screenshoot2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jahov0820/JHNavigationBar/HEAD/screenshoot2.gif
--------------------------------------------------------------------------------
/demo/angleababy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jahov0820/JHNavigationBar/HEAD/demo/angleababy.jpg
--------------------------------------------------------------------------------
/demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.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 |
28 | # Carthage
29 | #
30 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
31 | # Carthage/Checkouts
32 |
33 | Carthage/Build
34 |
--------------------------------------------------------------------------------
/demo/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 | }
--------------------------------------------------------------------------------
/demoTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | jh.$(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 |
--------------------------------------------------------------------------------
/demoTests/demoTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // demoTests.swift
3 | // demoTests
4 | //
5 | // Created by JiaHao on 6/23/15.
6 | // Copyright (c) 2015 JH. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import XCTest
11 |
12 | class demoTests: 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 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 JiaHao
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 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # JHNavigationBar
2 |
3 | ##Screenshot
4 |
5 | 
6 | 
7 |
8 | ##Usage
9 |
10 | ```
11 | override func viewDidLoad() {
12 | super.viewDidLoad()
13 |
14 |
15 | // case1:
16 | var color = UIColor(red: 25/255, green: 144/255, blue: 211/255, alpha: 1)
17 | self.navigationController?.navigationBar.overlayColor = color
18 |
19 | }
20 | override func viewWillDisappear(animated: Bool) {
21 | super.viewWillDisappear(animated)
22 |
23 | // case2:
24 | // self.navigationController?.navigationBar.jh_heightReset()
25 |
26 | // case1:
27 | self.navigationController?.navigationBar.jh_alphaReset()
28 | }
29 |
30 | override func viewWillAppear(animated: Bool) {
31 | //need
32 | self.scrollViewDidScroll(tableView)
33 | }
34 |
35 | func scrollViewDidScroll(scrollView: UIScrollView) {
36 | // case1:
37 | JHNavBarHandle.handleJHNavigationBarAlpha(scrollView, uiviewcontoller: self)
38 |
39 |
40 | //case2:
41 | // JHNavBarHandle.handleJHNavigationBarHeight(scrollView, uiviewcontoller: self)
42 |
43 | }
44 | ```
45 |
46 | ## CocoaPods
47 |
48 | > pod 'JHNavigationBar', '~> 1.1.0'
49 |
--------------------------------------------------------------------------------
/demo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | jh.$(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 |
--------------------------------------------------------------------------------
/demo/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // demo
4 | //
5 | // Created by JiaHao on 6/23/15.
6 | // Copyright (c) 2015 JH. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController,UIScrollViewDelegate {
12 |
13 | @IBOutlet weak var tableView: UITableView!
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 |
18 |
19 | // case1:
20 | var color = UIColor(red: 25/255, green: 144/255, blue: 211/255, alpha: 1)
21 | self.navigationController?.navigationBar.overlayColor = color
22 |
23 | }
24 | override func viewWillDisappear(animated: Bool) {
25 | super.viewWillDisappear(animated)
26 |
27 | // case2:
28 | // self.navigationController?.navigationBar.jh_heightReset()
29 |
30 | // case1:
31 | self.navigationController?.navigationBar.jh_alphaReset()
32 | }
33 |
34 | override func viewWillAppear(animated: Bool) {
35 | //need
36 | self.scrollViewDidScroll(tableView)
37 | }
38 |
39 | func scrollViewDidScroll(scrollView: UIScrollView) {
40 | // case1:
41 | JHNavBarHandle.handleJHNavigationBarAlpha(scrollView, uiviewcontoller: self)
42 |
43 |
44 | //case2:
45 | // JHNavBarHandle.handleJHNavigationBarHeight(scrollView, uiviewcontoller: self)
46 |
47 | }
48 |
49 | }
50 |
51 |
52 | extension ViewController:UITableViewDelegate,UITableViewDataSource {
53 |
54 | func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
55 | return 10
56 | }
57 |
58 | func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
59 | var cell = tableView.dequeueReusableCellWithIdentifier("Cell") as! UITableViewCell
60 | cell.textLabel?.text = "test\(indexPath.row)"
61 | return cell;
62 | }
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/demo/JHNavBarHandle.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JHNavBarHandle.swift
3 | //
4 | // Created by JiaHao on 6/23/15.
5 | // Copyright (c) 2015 JH. All rights reserved.
6 | //
7 |
8 | import UIKit
9 | class JHNavBarHandle: NSObject {
10 |
11 | class func handleJHNavigationBarAlpha(scroll:UIScrollView,uiviewcontoller:UIViewController){
12 | uiviewcontoller.automaticallyAdjustsScrollViewInsets = false
13 | var overlayColor = uiviewcontoller.navigationController?.navigationBar.overlayColor
14 | var offsetY = scroll.contentOffset.y
15 | if offsetY > 50{
16 | let alpha = 1 - ((50+64-offsetY)/64)
17 | uiviewcontoller.navigationController?.navigationBar.jh_setBackgroundColor(overlayColor!.colorWithAlphaComponent(alpha))
18 | }else{
19 | uiviewcontoller.navigationController?.navigationBar.jh_setBackgroundColor(overlayColor!.colorWithAlphaComponent(0))
20 | }
21 | }
22 |
23 | class func handleJHNavigationBarHeight(scroll:UIScrollView,uiviewcontoller:UIViewController){
24 | uiviewcontoller.automaticallyAdjustsScrollViewInsets = false
25 | var offsetY = scroll.contentOffset.y
26 | if offsetY > 0{
27 | if(offsetY >= 44){
28 | self.setNavigationBarTransformProgress(uiviewcontoller,progress: 1)
29 | }else{
30 | self.setNavigationBarTransformProgress(uiviewcontoller,progress: offsetY / 44)
31 | }
32 | }else{
33 | self.setNavigationBarTransformProgress(uiviewcontoller,progress: 0)
34 | uiviewcontoller.navigationController?.navigationBar.backIndicatorImage = nil
35 | uiviewcontoller.navigationController?.navigationBar.backIndicatorTransitionMaskImage = nil
36 |
37 | }
38 | }
39 |
40 | class func setNavigationBarTransformProgress(uiviewcontoller:UIViewController,progress:CGFloat){
41 | uiviewcontoller.navigationController?.navigationBar.jh_setTranslationY(-44 * progress)
42 | uiviewcontoller.navigationController?.navigationBar.jh_setContentAlpha(1-progress)
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/JHNavigationBar/JHNavBarHandle.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JHNavBarHandle.swift
3 | //
4 | // Created by JiaHao on 6/23/15.
5 | // Copyright (c) 2015 JH. All rights reserved.
6 | //
7 |
8 | import UIKit
9 | class JHNavBarHandle: NSObject {
10 |
11 | class func handleJHNavigationBarAlpha(scroll:UIScrollView,uiviewcontoller:UIViewController){
12 | uiviewcontoller.automaticallyAdjustsScrollViewInsets = false
13 | var overlayColor = uiviewcontoller.navigationController?.navigationBar.overlayColor
14 | var offsetY = scroll.contentOffset.y
15 | if offsetY > 50{
16 | let alpha = 1 - ((50+64-offsetY)/64)
17 | uiviewcontoller.navigationController?.navigationBar.jh_setBackgroundColor(overlayColor!.colorWithAlphaComponent(alpha))
18 | }else{
19 | uiviewcontoller.navigationController?.navigationBar.jh_setBackgroundColor(overlayColor!.colorWithAlphaComponent(0))
20 | }
21 | }
22 |
23 | class func handleJHNavigationBarHeight(scroll:UIScrollView,uiviewcontoller:UIViewController){
24 | uiviewcontoller.automaticallyAdjustsScrollViewInsets = false
25 | var offsetY = scroll.contentOffset.y
26 | if offsetY > 0{
27 | if(offsetY >= 44){
28 | self.setNavigationBarTransformProgress(uiviewcontoller,progress: 1)
29 | }else{
30 | self.setNavigationBarTransformProgress(uiviewcontoller,progress: offsetY / 44)
31 | }
32 | }else{
33 | self.setNavigationBarTransformProgress(uiviewcontoller,progress: 0)
34 | uiviewcontoller.navigationController?.navigationBar.backIndicatorImage = nil
35 | uiviewcontoller.navigationController?.navigationBar.backIndicatorTransitionMaskImage = nil
36 |
37 | }
38 | }
39 |
40 | class func setNavigationBarTransformProgress(uiviewcontoller:UIViewController,progress:CGFloat){
41 | uiviewcontoller.navigationController?.navigationBar.jh_setTranslationY(-44 * progress)
42 | uiviewcontoller.navigationController?.navigationBar.jh_setContentAlpha(1-progress)
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/demo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // demo
4 | //
5 | // Created by JiaHao on 6/23/15.
6 | // Copyright (c) 2015 JH. 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 |
--------------------------------------------------------------------------------
/JHNavigationBar.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod spec lint JHNavigationBar.podspec' to ensure this is a
3 | # valid spec and to remove all comments including this before submitting the spec.
4 | #
5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
7 | #
8 |
9 | Pod::Spec.new do |s|
10 |
11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
12 | #
13 | # These will help people to find your library, and whilst it
14 | # can feel like a chore to fill in it's definitely to your advantage. The
15 | # summary should be tweet-length, and the description more in depth.
16 | #
17 |
18 | s.name = "JHNavigationBar"
19 | s.version = "1.0.0"
20 | s.summary = "Change UINavigationBar appearance dynamically in Swift"
21 |
22 | s.description = <<-DESC
23 | Change UINavigationBar appearance dynamically in Swift
24 |
25 | DESC
26 |
27 | s.homepage = "https://github.com/Liaojiahao/JHNavigationBar"
28 | s.screenshots = "https://raw.githubusercontent.com/Liaojiahao/JHNavigationBar/master/screenshoot1.gif", "https://raw.githubusercontent.com/Liaojiahao/JHNavigationBar/master/screenshoot2.gif"
29 |
30 | s.license = "MIT"
31 | s.author = { "LiaoJiaHao" => "liaojiahao820@foxmail.com" }
32 | s.platform = :ios, "8.0"
33 |
34 | s.source = { :git => "https://github.com/Liaojiahao/JHNavigationBar.git", :tag => "1.0.0" }
35 |
36 |
37 | s.source_files = "JHNavigationBar/*"
38 | #s.exclude_files = "Classes/Exclude"
39 |
40 |
41 |
42 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
43 | #
44 | # A list of resources included with the Pod. These are copied into the
45 | # target bundle with a build phase script. Anything else will be cleaned.
46 | # You can preserve files from being cleaned, please don't preserve
47 | # non-essential files like tests, examples and documentation.
48 | #
49 |
50 | # s.resource = "icon.png"
51 | # s.resources = "Resources/*.png"
52 |
53 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave"
54 |
55 |
56 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
57 | #
58 | # Link your library with frameworks, or libraries. Libraries do not include
59 | # the lib prefix of their name.
60 | #
61 |
62 | # s.framework = "SomeFramework"
63 | # s.frameworks = "SomeFramework", "AnotherFramework"
64 |
65 | # s.library = "iconv"
66 | # s.libraries = "iconv", "xml2"
67 |
68 |
69 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
70 | #
71 | # If your library depends on compiler flags you can set them in the xcconfig hash
72 | # where they will only apply to your library. If you depend on other Podspecs
73 | # you can include multiple dependencies to ensure it works.
74 |
75 | # s.requires_arc = true
76 |
77 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
78 | # s.dependency "JSONKit", "~> 1.4"
79 |
80 | end
81 |
--------------------------------------------------------------------------------
/demo/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 |
--------------------------------------------------------------------------------
/demo/JHNavigationBar.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JHNavigationBar.swift
3 | //
4 | // Created by JiaHao on 6/23/15.
5 | // Copyright (c) 2015 JH. All rights reserved.
6 | //
7 |
8 | import Foundation
9 | import UIKit
10 |
11 |
12 |
13 | extension UINavigationBar {
14 |
15 | private struct AssociatedKeys {
16 | static var overLay = "overLay"
17 | static var emptyImage = "emptyImage"
18 | static var overlayColor = "overlayColor"
19 | }
20 |
21 | var overlay: UIView? {
22 | get {
23 | return objc_getAssociatedObject(self, &AssociatedKeys.overLay) as?UIView
24 | }
25 | set {
26 | if let newValue = newValue {
27 | objc_setAssociatedObject(
28 | self,
29 | &AssociatedKeys.overLay,
30 | newValue as UIView?,
31 | UInt(OBJC_ASSOCIATION_RETAIN_NONATOMIC)
32 | )
33 | }
34 | }
35 | }
36 | var overlayColor:UIColor?{
37 | get {
38 | return objc_getAssociatedObject(self, &AssociatedKeys.overlayColor) as?UIColor
39 | }
40 | set {
41 | if let newValue = newValue {
42 | objc_setAssociatedObject(
43 | self,
44 | &AssociatedKeys.overlayColor,
45 | newValue as UIColor?,
46 | UInt(OBJC_ASSOCIATION_RETAIN_NONATOMIC)
47 | )
48 | }
49 | }
50 | }
51 | var emptyImage: UIImage? {
52 | get {
53 | return objc_getAssociatedObject(self, &AssociatedKeys.emptyImage) as?UIImage
54 | }
55 | set {
56 | if let newValue = newValue {
57 | objc_setAssociatedObject(
58 | self,
59 | &AssociatedKeys.emptyImage,
60 | newValue as UIImage?,
61 | UInt(OBJC_ASSOCIATION_RETAIN_NONATOMIC)
62 | )
63 | }
64 | }
65 | }
66 |
67 | func jh_setBackgroundColor(color:UIColor){
68 | self.shadowImage = UIImage.new()
69 | if let jh_Overlay = overlay{
70 | }else{
71 | self.setBackgroundImage(UIImage.new(), forBarMetrics: UIBarMetrics.Default)
72 | overlay = UIView(frame:CGRectMake(0, -20, UIScreen.mainScreen().bounds.size.width, CGRectGetHeight(self.bounds)+20))
73 | overlay?.userInteractionEnabled = false
74 | self.insertSubview(overlay!, atIndex: 0)
75 | }
76 | overlay!.backgroundColor = color
77 | }
78 |
79 | func jh_setTranslationY(translationY:CGFloat){
80 | self.transform = CGAffineTransformMakeTranslation(0, translationY)
81 | }
82 |
83 | func jh_setContentAlpha(alpha:CGFloat){
84 | if let jh_Overlay = overlay{
85 | self.jh_setAlphaForSubviewsOfView(alpha, view: self)
86 | if alpha == 1 {
87 | if let emptyImage = self.emptyImage{
88 | }else{
89 | self.emptyImage = UIImage.new()
90 | }
91 | self.backIndicatorImage = self.emptyImage
92 | self.backIndicatorTransitionMaskImage = self.emptyImage
93 | }
94 | }else{
95 | if let barTint = self.barTintColor{
96 | self.jh_setBackgroundColor(self.barTintColor!)
97 | }
98 | }
99 | }
100 |
101 | func jh_setAlphaForSubviewsOfView(alpha:CGFloat,view:UIView){
102 | for subview in view.subviews as! [UIView]{
103 | if subview .isEqual(self.overlay) {
104 | continue
105 | }
106 | subview.alpha = alpha
107 | self.jh_setAlphaForSubviewsOfView(alpha, view: subview)
108 | }
109 | }
110 |
111 | func jh_alphaReset(){
112 | self.shadowImage = nil
113 | overlay!.backgroundColor = self.overlayColor
114 | self.overlay = nil
115 | }
116 | func jh_heightReset(){
117 | self.jh_setTranslationY(0)
118 | }
119 |
120 | }
121 |
122 |
123 |
--------------------------------------------------------------------------------
/JHNavigationBar/JHNavigationBar.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JHNavigationBar.swift
3 | //
4 | // Created by JiaHao on 6/23/15.
5 | // Copyright (c) 2015 JH. All rights reserved.
6 | //
7 |
8 | import Foundation
9 | import UIKit
10 |
11 |
12 |
13 | extension UINavigationBar {
14 |
15 | private struct AssociatedKeys {
16 | static var overLay = "overLay"
17 | static var emptyImage = "emptyImage"
18 | static var overlayColor = "overlayColor"
19 | }
20 |
21 | var overlay: UIView? {
22 | get {
23 | return objc_getAssociatedObject(self, &AssociatedKeys.overLay) as?UIView
24 | }
25 | set {
26 | if let newValue = newValue {
27 | objc_setAssociatedObject(
28 | self,
29 | &AssociatedKeys.overLay,
30 | newValue as UIView?,
31 | UInt(OBJC_ASSOCIATION_RETAIN_NONATOMIC)
32 | )
33 | }
34 | }
35 | }
36 | var overlayColor:UIColor?{
37 | get {
38 | return objc_getAssociatedObject(self, &AssociatedKeys.overlayColor) as?UIColor
39 | }
40 | set {
41 | if let newValue = newValue {
42 | objc_setAssociatedObject(
43 | self,
44 | &AssociatedKeys.overlayColor,
45 | newValue as UIColor?,
46 | UInt(OBJC_ASSOCIATION_RETAIN_NONATOMIC)
47 | )
48 | }
49 | }
50 | }
51 | var emptyImage: UIImage? {
52 | get {
53 | return objc_getAssociatedObject(self, &AssociatedKeys.emptyImage) as?UIImage
54 | }
55 | set {
56 | if let newValue = newValue {
57 | objc_setAssociatedObject(
58 | self,
59 | &AssociatedKeys.emptyImage,
60 | newValue as UIImage?,
61 | UInt(OBJC_ASSOCIATION_RETAIN_NONATOMIC)
62 | )
63 | }
64 | }
65 | }
66 |
67 | func jh_setBackgroundColor(color:UIColor){
68 | self.shadowImage = UIImage.new()
69 | if let jh_Overlay = overlay{
70 | }else{
71 | self.setBackgroundImage(UIImage.new(), forBarMetrics: UIBarMetrics.Default)
72 | overlay = UIView(frame:CGRectMake(0, -20, UIScreen.mainScreen().bounds.size.width, CGRectGetHeight(self.bounds)+20))
73 | overlay?.userInteractionEnabled = false
74 | self.insertSubview(overlay!, atIndex: 0)
75 | }
76 | overlay!.backgroundColor = color
77 | }
78 |
79 | func jh_setTranslationY(translationY:CGFloat){
80 | self.transform = CGAffineTransformMakeTranslation(0, translationY)
81 | }
82 |
83 | func jh_setContentAlpha(alpha:CGFloat){
84 | if let jh_Overlay = overlay{
85 | self.jh_setAlphaForSubviewsOfView(alpha, view: self)
86 | if alpha == 1 {
87 | if let emptyImage = self.emptyImage{
88 | }else{
89 | self.emptyImage = UIImage.new()
90 | }
91 | self.backIndicatorImage = self.emptyImage
92 | self.backIndicatorTransitionMaskImage = self.emptyImage
93 | }
94 | }else{
95 | if let barTint = self.barTintColor{
96 | self.jh_setBackgroundColor(self.barTintColor!)
97 | }
98 | }
99 | }
100 |
101 | func jh_setAlphaForSubviewsOfView(alpha:CGFloat,view:UIView){
102 | for subview in view.subviews as! [UIView]{
103 | if subview .isEqual(self.overlay) {
104 | continue
105 | }
106 | subview.alpha = alpha
107 | self.jh_setAlphaForSubviewsOfView(alpha, view: subview)
108 | }
109 | }
110 |
111 | func jh_alphaReset(){
112 | self.shadowImage = nil
113 | overlay!.backgroundColor = self.overlayColor
114 | self.overlay = nil
115 | }
116 | func jh_heightReset(){
117 | self.jh_setTranslationY(0)
118 | }
119 |
120 | }
121 |
122 |
123 |
--------------------------------------------------------------------------------
/demo/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 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/demo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 182D41F11B39AE2A0063FB23 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 182D41F01B39AE2A0063FB23 /* AppDelegate.swift */; };
11 | 182D41F31B39AE2A0063FB23 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 182D41F21B39AE2A0063FB23 /* ViewController.swift */; };
12 | 182D41F61B39AE2A0063FB23 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 182D41F41B39AE2A0063FB23 /* Main.storyboard */; };
13 | 182D41F81B39AE2A0063FB23 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 182D41F71B39AE2A0063FB23 /* Images.xcassets */; };
14 | 182D41FB1B39AE2A0063FB23 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 182D41F91B39AE2A0063FB23 /* LaunchScreen.xib */; };
15 | 182D42071B39AE2B0063FB23 /* demoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 182D42061B39AE2B0063FB23 /* demoTests.swift */; };
16 | 182D42121B39AE400063FB23 /* JHNavBarHandle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 182D42101B39AE400063FB23 /* JHNavBarHandle.swift */; };
17 | 182D42131B39AE400063FB23 /* JHNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 182D42111B39AE400063FB23 /* JHNavigationBar.swift */; };
18 | 182D42151B39AEDC0063FB23 /* angleababy.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 182D42141B39AEDC0063FB23 /* angleababy.jpg */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXContainerItemProxy section */
22 | 182D42011B39AE2B0063FB23 /* PBXContainerItemProxy */ = {
23 | isa = PBXContainerItemProxy;
24 | containerPortal = 182D41E31B39AE2A0063FB23 /* Project object */;
25 | proxyType = 1;
26 | remoteGlobalIDString = 182D41EA1B39AE2A0063FB23;
27 | remoteInfo = demo;
28 | };
29 | /* End PBXContainerItemProxy section */
30 |
31 | /* Begin PBXFileReference section */
32 | 182D41EB1B39AE2A0063FB23 /* demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
33 | 182D41EF1B39AE2A0063FB23 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
34 | 182D41F01B39AE2A0063FB23 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
35 | 182D41F21B39AE2A0063FB23 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
36 | 182D41F51B39AE2A0063FB23 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
37 | 182D41F71B39AE2A0063FB23 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
38 | 182D41FA1B39AE2A0063FB23 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
39 | 182D42001B39AE2B0063FB23 /* demoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = demoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
40 | 182D42051B39AE2B0063FB23 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
41 | 182D42061B39AE2B0063FB23 /* demoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = demoTests.swift; sourceTree = ""; };
42 | 182D42101B39AE400063FB23 /* JHNavBarHandle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JHNavBarHandle.swift; sourceTree = ""; };
43 | 182D42111B39AE400063FB23 /* JHNavigationBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JHNavigationBar.swift; sourceTree = ""; };
44 | 182D42141B39AEDC0063FB23 /* angleababy.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = angleababy.jpg; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 182D41E81B39AE2A0063FB23 /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | 182D41FD1B39AE2B0063FB23 /* Frameworks */ = {
56 | isa = PBXFrameworksBuildPhase;
57 | buildActionMask = 2147483647;
58 | files = (
59 | );
60 | runOnlyForDeploymentPostprocessing = 0;
61 | };
62 | /* End PBXFrameworksBuildPhase section */
63 |
64 | /* Begin PBXGroup section */
65 | 182D41E21B39AE2A0063FB23 = {
66 | isa = PBXGroup;
67 | children = (
68 | 182D41ED1B39AE2A0063FB23 /* demo */,
69 | 182D42031B39AE2B0063FB23 /* demoTests */,
70 | 182D41EC1B39AE2A0063FB23 /* Products */,
71 | );
72 | sourceTree = "";
73 | };
74 | 182D41EC1B39AE2A0063FB23 /* Products */ = {
75 | isa = PBXGroup;
76 | children = (
77 | 182D41EB1B39AE2A0063FB23 /* demo.app */,
78 | 182D42001B39AE2B0063FB23 /* demoTests.xctest */,
79 | );
80 | name = Products;
81 | sourceTree = "";
82 | };
83 | 182D41ED1B39AE2A0063FB23 /* demo */ = {
84 | isa = PBXGroup;
85 | children = (
86 | 182D42141B39AEDC0063FB23 /* angleababy.jpg */,
87 | 182D42101B39AE400063FB23 /* JHNavBarHandle.swift */,
88 | 182D42111B39AE400063FB23 /* JHNavigationBar.swift */,
89 | 182D41F01B39AE2A0063FB23 /* AppDelegate.swift */,
90 | 182D41F21B39AE2A0063FB23 /* ViewController.swift */,
91 | 182D41F41B39AE2A0063FB23 /* Main.storyboard */,
92 | 182D41F71B39AE2A0063FB23 /* Images.xcassets */,
93 | 182D41F91B39AE2A0063FB23 /* LaunchScreen.xib */,
94 | 182D41EE1B39AE2A0063FB23 /* Supporting Files */,
95 | );
96 | path = demo;
97 | sourceTree = "";
98 | };
99 | 182D41EE1B39AE2A0063FB23 /* Supporting Files */ = {
100 | isa = PBXGroup;
101 | children = (
102 | 182D41EF1B39AE2A0063FB23 /* Info.plist */,
103 | );
104 | name = "Supporting Files";
105 | sourceTree = "";
106 | };
107 | 182D42031B39AE2B0063FB23 /* demoTests */ = {
108 | isa = PBXGroup;
109 | children = (
110 | 182D42061B39AE2B0063FB23 /* demoTests.swift */,
111 | 182D42041B39AE2B0063FB23 /* Supporting Files */,
112 | );
113 | path = demoTests;
114 | sourceTree = "";
115 | };
116 | 182D42041B39AE2B0063FB23 /* Supporting Files */ = {
117 | isa = PBXGroup;
118 | children = (
119 | 182D42051B39AE2B0063FB23 /* Info.plist */,
120 | );
121 | name = "Supporting Files";
122 | sourceTree = "";
123 | };
124 | /* End PBXGroup section */
125 |
126 | /* Begin PBXNativeTarget section */
127 | 182D41EA1B39AE2A0063FB23 /* demo */ = {
128 | isa = PBXNativeTarget;
129 | buildConfigurationList = 182D420A1B39AE2B0063FB23 /* Build configuration list for PBXNativeTarget "demo" */;
130 | buildPhases = (
131 | 182D41E71B39AE2A0063FB23 /* Sources */,
132 | 182D41E81B39AE2A0063FB23 /* Frameworks */,
133 | 182D41E91B39AE2A0063FB23 /* Resources */,
134 | );
135 | buildRules = (
136 | );
137 | dependencies = (
138 | );
139 | name = demo;
140 | productName = demo;
141 | productReference = 182D41EB1B39AE2A0063FB23 /* demo.app */;
142 | productType = "com.apple.product-type.application";
143 | };
144 | 182D41FF1B39AE2B0063FB23 /* demoTests */ = {
145 | isa = PBXNativeTarget;
146 | buildConfigurationList = 182D420D1B39AE2B0063FB23 /* Build configuration list for PBXNativeTarget "demoTests" */;
147 | buildPhases = (
148 | 182D41FC1B39AE2B0063FB23 /* Sources */,
149 | 182D41FD1B39AE2B0063FB23 /* Frameworks */,
150 | 182D41FE1B39AE2B0063FB23 /* Resources */,
151 | );
152 | buildRules = (
153 | );
154 | dependencies = (
155 | 182D42021B39AE2B0063FB23 /* PBXTargetDependency */,
156 | );
157 | name = demoTests;
158 | productName = demoTests;
159 | productReference = 182D42001B39AE2B0063FB23 /* demoTests.xctest */;
160 | productType = "com.apple.product-type.bundle.unit-test";
161 | };
162 | /* End PBXNativeTarget section */
163 |
164 | /* Begin PBXProject section */
165 | 182D41E31B39AE2A0063FB23 /* Project object */ = {
166 | isa = PBXProject;
167 | attributes = {
168 | LastUpgradeCheck = 0630;
169 | ORGANIZATIONNAME = JH;
170 | TargetAttributes = {
171 | 182D41EA1B39AE2A0063FB23 = {
172 | CreatedOnToolsVersion = 6.3;
173 | };
174 | 182D41FF1B39AE2B0063FB23 = {
175 | CreatedOnToolsVersion = 6.3;
176 | TestTargetID = 182D41EA1B39AE2A0063FB23;
177 | };
178 | };
179 | };
180 | buildConfigurationList = 182D41E61B39AE2A0063FB23 /* Build configuration list for PBXProject "demo" */;
181 | compatibilityVersion = "Xcode 3.2";
182 | developmentRegion = English;
183 | hasScannedForEncodings = 0;
184 | knownRegions = (
185 | en,
186 | Base,
187 | );
188 | mainGroup = 182D41E21B39AE2A0063FB23;
189 | productRefGroup = 182D41EC1B39AE2A0063FB23 /* Products */;
190 | projectDirPath = "";
191 | projectRoot = "";
192 | targets = (
193 | 182D41EA1B39AE2A0063FB23 /* demo */,
194 | 182D41FF1B39AE2B0063FB23 /* demoTests */,
195 | );
196 | };
197 | /* End PBXProject section */
198 |
199 | /* Begin PBXResourcesBuildPhase section */
200 | 182D41E91B39AE2A0063FB23 /* Resources */ = {
201 | isa = PBXResourcesBuildPhase;
202 | buildActionMask = 2147483647;
203 | files = (
204 | 182D41F61B39AE2A0063FB23 /* Main.storyboard in Resources */,
205 | 182D41FB1B39AE2A0063FB23 /* LaunchScreen.xib in Resources */,
206 | 182D41F81B39AE2A0063FB23 /* Images.xcassets in Resources */,
207 | 182D42151B39AEDC0063FB23 /* angleababy.jpg in Resources */,
208 | );
209 | runOnlyForDeploymentPostprocessing = 0;
210 | };
211 | 182D41FE1B39AE2B0063FB23 /* Resources */ = {
212 | isa = PBXResourcesBuildPhase;
213 | buildActionMask = 2147483647;
214 | files = (
215 | );
216 | runOnlyForDeploymentPostprocessing = 0;
217 | };
218 | /* End PBXResourcesBuildPhase section */
219 |
220 | /* Begin PBXSourcesBuildPhase section */
221 | 182D41E71B39AE2A0063FB23 /* Sources */ = {
222 | isa = PBXSourcesBuildPhase;
223 | buildActionMask = 2147483647;
224 | files = (
225 | 182D41F31B39AE2A0063FB23 /* ViewController.swift in Sources */,
226 | 182D41F11B39AE2A0063FB23 /* AppDelegate.swift in Sources */,
227 | 182D42121B39AE400063FB23 /* JHNavBarHandle.swift in Sources */,
228 | 182D42131B39AE400063FB23 /* JHNavigationBar.swift in Sources */,
229 | );
230 | runOnlyForDeploymentPostprocessing = 0;
231 | };
232 | 182D41FC1B39AE2B0063FB23 /* Sources */ = {
233 | isa = PBXSourcesBuildPhase;
234 | buildActionMask = 2147483647;
235 | files = (
236 | 182D42071B39AE2B0063FB23 /* demoTests.swift in Sources */,
237 | );
238 | runOnlyForDeploymentPostprocessing = 0;
239 | };
240 | /* End PBXSourcesBuildPhase section */
241 |
242 | /* Begin PBXTargetDependency section */
243 | 182D42021B39AE2B0063FB23 /* PBXTargetDependency */ = {
244 | isa = PBXTargetDependency;
245 | target = 182D41EA1B39AE2A0063FB23 /* demo */;
246 | targetProxy = 182D42011B39AE2B0063FB23 /* PBXContainerItemProxy */;
247 | };
248 | /* End PBXTargetDependency section */
249 |
250 | /* Begin PBXVariantGroup section */
251 | 182D41F41B39AE2A0063FB23 /* Main.storyboard */ = {
252 | isa = PBXVariantGroup;
253 | children = (
254 | 182D41F51B39AE2A0063FB23 /* Base */,
255 | );
256 | name = Main.storyboard;
257 | sourceTree = "";
258 | };
259 | 182D41F91B39AE2A0063FB23 /* LaunchScreen.xib */ = {
260 | isa = PBXVariantGroup;
261 | children = (
262 | 182D41FA1B39AE2A0063FB23 /* Base */,
263 | );
264 | name = LaunchScreen.xib;
265 | sourceTree = "";
266 | };
267 | /* End PBXVariantGroup section */
268 |
269 | /* Begin XCBuildConfiguration section */
270 | 182D42081B39AE2B0063FB23 /* Debug */ = {
271 | isa = XCBuildConfiguration;
272 | buildSettings = {
273 | ALWAYS_SEARCH_USER_PATHS = NO;
274 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
275 | CLANG_CXX_LIBRARY = "libc++";
276 | CLANG_ENABLE_MODULES = YES;
277 | CLANG_ENABLE_OBJC_ARC = YES;
278 | CLANG_WARN_BOOL_CONVERSION = YES;
279 | CLANG_WARN_CONSTANT_CONVERSION = YES;
280 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
281 | CLANG_WARN_EMPTY_BODY = YES;
282 | CLANG_WARN_ENUM_CONVERSION = YES;
283 | CLANG_WARN_INT_CONVERSION = YES;
284 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
285 | CLANG_WARN_UNREACHABLE_CODE = YES;
286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
288 | COPY_PHASE_STRIP = NO;
289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
290 | ENABLE_STRICT_OBJC_MSGSEND = YES;
291 | GCC_C_LANGUAGE_STANDARD = gnu99;
292 | GCC_DYNAMIC_NO_PIC = NO;
293 | GCC_NO_COMMON_BLOCKS = YES;
294 | GCC_OPTIMIZATION_LEVEL = 0;
295 | GCC_PREPROCESSOR_DEFINITIONS = (
296 | "DEBUG=1",
297 | "$(inherited)",
298 | );
299 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
300 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
301 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
302 | GCC_WARN_UNDECLARED_SELECTOR = YES;
303 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
304 | GCC_WARN_UNUSED_FUNCTION = YES;
305 | GCC_WARN_UNUSED_VARIABLE = YES;
306 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
307 | MTL_ENABLE_DEBUG_INFO = YES;
308 | ONLY_ACTIVE_ARCH = YES;
309 | SDKROOT = iphoneos;
310 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
311 | };
312 | name = Debug;
313 | };
314 | 182D42091B39AE2B0063FB23 /* Release */ = {
315 | isa = XCBuildConfiguration;
316 | buildSettings = {
317 | ALWAYS_SEARCH_USER_PATHS = NO;
318 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
319 | CLANG_CXX_LIBRARY = "libc++";
320 | CLANG_ENABLE_MODULES = YES;
321 | CLANG_ENABLE_OBJC_ARC = YES;
322 | CLANG_WARN_BOOL_CONVERSION = YES;
323 | CLANG_WARN_CONSTANT_CONVERSION = YES;
324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
325 | CLANG_WARN_EMPTY_BODY = YES;
326 | CLANG_WARN_ENUM_CONVERSION = YES;
327 | CLANG_WARN_INT_CONVERSION = YES;
328 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
329 | CLANG_WARN_UNREACHABLE_CODE = YES;
330 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
331 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
332 | COPY_PHASE_STRIP = NO;
333 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
334 | ENABLE_NS_ASSERTIONS = NO;
335 | ENABLE_STRICT_OBJC_MSGSEND = YES;
336 | GCC_C_LANGUAGE_STANDARD = gnu99;
337 | GCC_NO_COMMON_BLOCKS = YES;
338 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
339 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
340 | GCC_WARN_UNDECLARED_SELECTOR = YES;
341 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
342 | GCC_WARN_UNUSED_FUNCTION = YES;
343 | GCC_WARN_UNUSED_VARIABLE = YES;
344 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
345 | MTL_ENABLE_DEBUG_INFO = NO;
346 | SDKROOT = iphoneos;
347 | VALIDATE_PRODUCT = YES;
348 | };
349 | name = Release;
350 | };
351 | 182D420B1B39AE2B0063FB23 /* Debug */ = {
352 | isa = XCBuildConfiguration;
353 | buildSettings = {
354 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
355 | INFOPLIST_FILE = demo/Info.plist;
356 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
357 | PRODUCT_NAME = "$(TARGET_NAME)";
358 | };
359 | name = Debug;
360 | };
361 | 182D420C1B39AE2B0063FB23 /* Release */ = {
362 | isa = XCBuildConfiguration;
363 | buildSettings = {
364 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
365 | INFOPLIST_FILE = demo/Info.plist;
366 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
367 | PRODUCT_NAME = "$(TARGET_NAME)";
368 | };
369 | name = Release;
370 | };
371 | 182D420E1B39AE2B0063FB23 /* Debug */ = {
372 | isa = XCBuildConfiguration;
373 | buildSettings = {
374 | BUNDLE_LOADER = "$(TEST_HOST)";
375 | FRAMEWORK_SEARCH_PATHS = (
376 | "$(SDKROOT)/Developer/Library/Frameworks",
377 | "$(inherited)",
378 | );
379 | GCC_PREPROCESSOR_DEFINITIONS = (
380 | "DEBUG=1",
381 | "$(inherited)",
382 | );
383 | INFOPLIST_FILE = demoTests/Info.plist;
384 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
385 | PRODUCT_NAME = "$(TARGET_NAME)";
386 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/demo.app/demo";
387 | };
388 | name = Debug;
389 | };
390 | 182D420F1B39AE2B0063FB23 /* Release */ = {
391 | isa = XCBuildConfiguration;
392 | buildSettings = {
393 | BUNDLE_LOADER = "$(TEST_HOST)";
394 | FRAMEWORK_SEARCH_PATHS = (
395 | "$(SDKROOT)/Developer/Library/Frameworks",
396 | "$(inherited)",
397 | );
398 | INFOPLIST_FILE = demoTests/Info.plist;
399 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
400 | PRODUCT_NAME = "$(TARGET_NAME)";
401 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/demo.app/demo";
402 | };
403 | name = Release;
404 | };
405 | /* End XCBuildConfiguration section */
406 |
407 | /* Begin XCConfigurationList section */
408 | 182D41E61B39AE2A0063FB23 /* Build configuration list for PBXProject "demo" */ = {
409 | isa = XCConfigurationList;
410 | buildConfigurations = (
411 | 182D42081B39AE2B0063FB23 /* Debug */,
412 | 182D42091B39AE2B0063FB23 /* Release */,
413 | );
414 | defaultConfigurationIsVisible = 0;
415 | defaultConfigurationName = Release;
416 | };
417 | 182D420A1B39AE2B0063FB23 /* Build configuration list for PBXNativeTarget "demo" */ = {
418 | isa = XCConfigurationList;
419 | buildConfigurations = (
420 | 182D420B1B39AE2B0063FB23 /* Debug */,
421 | 182D420C1B39AE2B0063FB23 /* Release */,
422 | );
423 | defaultConfigurationIsVisible = 0;
424 | defaultConfigurationName = Release;
425 | };
426 | 182D420D1B39AE2B0063FB23 /* Build configuration list for PBXNativeTarget "demoTests" */ = {
427 | isa = XCConfigurationList;
428 | buildConfigurations = (
429 | 182D420E1B39AE2B0063FB23 /* Debug */,
430 | 182D420F1B39AE2B0063FB23 /* Release */,
431 | );
432 | defaultConfigurationIsVisible = 0;
433 | defaultConfigurationName = Release;
434 | };
435 | /* End XCConfigurationList section */
436 | };
437 | rootObject = 182D41E31B39AE2A0063FB23 /* Project object */;
438 | }
439 |
--------------------------------------------------------------------------------