Git Product home page Git Product logo

uinavigationbar-addition's Introduction

UINavigationBar+Addition

Version Platform

Usage

UINavigationBar+Addition is available through CocoaPods, to install, simply add the following line to your Podfile:

pod "UINavigationBar+Addition"

In your view controller, import the category header file.

#import "UINavigationBar+Addition.h"

Hide Hairline

Hide the (1px bottom) hairline of nav bar

- (void)viewDidLoad {
    [super viewDidLoad];

    UINavigationBar *navigationBar = self.navigationController.navigationBar;
    [navigationBar hideBottomHairline];
}

Make Transparent

Or make the whole nav bar transparent with [navigationBar makeTransparent];

Author

Junda, [email protected]

License

UINavigationBar+Addition is available under the MIT license. See the LICENSE file for more info.

Bitdeli Badge

uinavigationbar-addition's People

Contributors

samwize avatar migue1s avatar bitdeli-chef avatar

Stargazers

 avatar Michael.Yang avatar CuiXg avatar  avatar alirafiq avatar Daniel Ran Lehmann avatar robyzhou avatar hellpeng avatar  avatar Kevin Candelaria avatar  avatar Baris Atamer avatar Jefferson avatar bedrock avatar Guillermo Sáenz avatar Shwet avatar Ahmed Abu Shmmala avatar  avatar Michael Deasy avatar Kevin San 闪奎章 avatar Sam Willsea avatar Seth Sandler avatar Shanti Rodríguez avatar Ernest Semerda avatar Luke Luo avatar Steve Rock avatar Mohamed Saleh Zaied avatar  avatar Jiyee Sheng avatar Kyle Zawacki avatar 龙伟 avatar  avatar  avatar Milosz Balus avatar Josh Fuggle avatar Marco Bonaldo avatar changwei avatar  avatar Eddie Espinal avatar Karthikeyan avatar Tony Woo avatar Jianqiu Xiao avatar ddddddd avatar Francis Lata avatar Mitchell Porter avatar Stone avatar Harlan Kellaway avatar Calios avatar  avatar  avatar  avatar Yigang Zhang avatar jam avatar de meng avatar Alexey avatar hengyu avatar Nathan avatar 巩鹏军 avatar 挡不住的君文 avatar QFish avatar Joshwin Greene avatar Komkrit Kawichai avatar  avatar Alvin Zeng avatar Vitaly Vegera avatar Paul J avatar Simon Strandgaard avatar codingduck avatar  avatar flypigz avatar C. Anglin avatar Collin Ruffenach avatar  avatar

Watchers

 avatar Matthew Loseke avatar  avatar Kevin Candelaria avatar bluesky avatar Michael.Yang avatar  avatar

uinavigationbar-addition's Issues

To accomplish your code in swift

Hey! I based some swift code off of your code, so here it is :)

import Foundation
import UIKit

extension UINavigationBar {

func hideBottomHairline() {
    var imageView: UIImageView? = findHairlineImageViewunder(self)
    if imageView {
        imageView!.hidden = true
    }
}

func showBottomHairline() {
    var imageView: UIImageView? = findHairlineImageViewunder(self)
    if imageView {
        imageView!.hidden = false
    }
}

func findHairlineImageViewunder(view: UIView) -> UIImageView? {
    if (view is UIImageView) && (1.0 >= view.bounds.size.height) {
        return view as? UIImageView
    }
    for subView: AnyObject in view.subviews {
        var imageView: UIImageView? = findHairlineImageViewunder(subView as UIView)
        if imageView {
            return imageView
        }
    }
    return nil
}

}

Receiving an "unrecognized selector sent to instance" when calling hide/showBottomHairline

Apple's discussion on the matter.

Objective-C does not define linker symbols for each function (or method, in Objective-C) - instead, linker symbols are only generated for each class. If you extend a pre-existing class with categories, the linker does not know to associate the object code of the core class implementation and the category implementation. This prevents objects created in the resulting application from responding to a selector that is defined in the category.

I've forked the repo and added a commit which updates the podspec to include -all_load (along with -objC) when setting OTHER_LDFLAGS to see if this would fix the issue, but when I included my forked version of the pod in a project, I receive the same error.

Any thoughts? Have you guys come across this at all?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.