Sunday, February 03, 2013

Use an image as your UIBarButtonItem

Using an image as your UIBarButtonItem in your navigationcontroller bar can only be achieved by using a common UIButton as the BarButtonItem's custom view.

This is an example on how you can achieve that. It takes a target, selector and image name and returns a UIBarButtonItem as an image.

+(UIBarButtonItem*) getBarButton:(id)target withSelector:(SEL)selector andImage:(NSString*)imageName
{
    //Create image
    UIImage *image = [UIImage imageNamed:imageName];
    
    //Create UIButton with the imag
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
    [button setImage:image forState:UIControlStateNormal];
    [button addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside];

    //Create UIBarButtonItem with customview button
    UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithCustomView:button];
    
    return barButton;
}

82 comments:

essaykings.co.uk said...

This proved out to be extremely useful in terms of home assignment at the university! I like the idea of your blog very much!

kevin antony said...

I appreciate your efforts because it conveys the message of what you are trying to say. It's a great skill to make even the person who doesn't know about the subject could able to understand the subject . Your blogs are understandable and also elaborately described. I hope to read more and more interesting articles from your blog. All the best.


rpa Training in annanagar

blue prism Training in annanagar

automation anywhere Training in annanagar

iot Training in annanagar

rpa Training in marathahalli

blue prism Training in marathahalli

automation anywhere Training in marathahalli

blue prism training in jayanagar

automation anywhere training in jayanagar

OGEN Infosystem (P) Limited said...

Thank you much for this tutorial; this is informative and valuable blog. Visit for
Europe Honeymoon Packages

service care said...

Superb.. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing post.
redmi service center
mi service center
redmi service center near me

tech news said...

Everything is very open with a clear explanation of the issues. It was definitely informative. Your site is very helpful. Many thanks for sharing!
Gadgets

Anonymous said...

I cannot thank Mr Benjamin service enough and letting people know how grateful I am for all the assistance that you and your team staff have provided and I look forward to recommending friends and family should they need financial advice or assistance @ 1,9% Rate for Business Loan .Via Contact : .  lfdsloans@outlook.com. WhatsApp...+ 19893943740. Keep up the great work.
Thanks, Busarakham.

keerthana said...

it's very supr information

PHP Training in Chennai | Certification | Online Training Course | Machine Learning Training in Chennai | Certification | Online Training Course | iOT Training in Chennai | Certification | Online Training Course | Blockchain Training in Chennai | Certification | Online Training Course | Open Stack Training in Chennai |
Certification | Online Training Course


Jayalakshmi said...

I would really like to read some personal experiences like the way, you've explained through the above article.
hardware and networking training in chennai

hardware and networking training in tambaram

xamarin training in chennai

xamarin training in tambaram

ios training in chennai

ios training in tambaram

iot training in chennai

iot training in tambaram

deiva said...

Thank you much for this tutorial; this is informative and valuable blog.
web designing training in chennai

web designing training in omr

digital marketing training in chennai

digital marketing training in omr

rpa training in chennai

rpa training in omr

tally training in chennai

tally training in omr

praveen said...

Nice blog with new information,
Thanks to share with us,

cyber security course in chennai

cyber security course in porur

ethical hacking course in chennai

ethical hacking course in porur

shiny said...

Thank you for these back links because they have been extremely useful in my link building........

hardware and networking training in chennai

hardware and networking training in annanagar

xamarin training in chennai

xamarin training in annanagar

ios training in chennai

ios training in annanagar

iot training in chennai

iot training in annanagar

tejaswini said...

You really make it look so natural with your exhibition however I see this issue as really something which I figure I could never understand. It appears to be excessively entangled and incredibly expansive for me.https://360digitmg.com/course/certification-program-in-data-science

360digitmgdelhi said...

informative blog...!
artificial intelligence course in delhi

vivekvedha said...

Superb.. Really it is an amazing article I had ever read. I hope it will help a lot for all.
acte reviews

acte velachery reviews

acte tambaram reviews

acte anna nagar reviews

acte porur reviews

acte omr reviews

acte chennai reviews

acte student reviews

rocky said...

Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
python training in bangalore

python training in hyderabad

python online training

python training

python flask training

python flask online training

python training in coimbatore

360DigiTMG said...

This is a great post I saw thanks to sharing. I really want to hope that you will continue to share great posts in the future.
hrdf contribution

hrdf claimable said...


This is a great post I saw thanks to sharing. I really want to hope that you will continue to share great posts in the future.

hrdf claimable

360digitmg said...

I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day!
business analytics course

Glion Overseas said...

Usually I never comment on blogs but your article is so convincing that I never stop myself to say something about it. You’re doing a great job Man,Keep it up.
study abroad consultants in delhi
How to choose Overseas education consultants in Delhi
Overseas Education Consultants in Delhi

360digitmg said...

I'm cheerful I found this blog! Every now and then, understudies need to psychologically the keys of beneficial artistic articles forming. Your information about this great post can turn into a reason for such individuals.
arttificial intelligence training in aurangabad

AI Course said...

Pleasant article, I acknowledged examining your post, fair offer, I need to joke this to my disciples. Much valued!.
AI Course

lovemaster said...

vidalista ct 20mg
vidalista-nederland.com

Kim said...

You’re so interesting! I don’t believe I’ve truly read something like this before. So great to find someone with genuine thoughts on this issue. Really.. many thanks for starting this up. This website is something that’s needed on the internet, someone with some originality!

CBSE Schools In Golconda
CBSE Schools In Hasbiguda
CBSE Schools In Hayathnagar
CBSE Schools In Himayathnagar
CBSE Schools In Jeedimetla
CBSE Schools In Jubilee Hills
CBSE Schools In Kanchanbagh
CBSE Schools In Kapra
CBSE Schools In Karimnagar
CBSE Schools In Khammam

Anonymous said...

Informative blog post,
Top 10 Digital Marketing Agencies in Hyderabad

Anonymous said...

Python Training in Bangalore
It was wonderfull reading your article.

Python Classes in Bangalore

Priya Rathod said...

Great post! Very inspiring.
Data Science Training in Hyderabad
Data Science Course in Hyderabad

harry said...

Very well written blog post. Thanks for sharing with us.

Best Web designing company in Hyderabad

Best Web development company in Hyderabad

Best App development company in Hyderabad

Unknown said...

thanks for giving amazing article...
Web Designing training in coimbatore | Data Science course in coimbatore | python coaching classes near me | web development training in coimbatore | python course fee | best java course center in coimbatore | java training in coimbatore | data science training in coimbatore | software training near me | Top 10 java training institute in coimbatore | sap training in coimbatore | android training institutes in coimbatore | dot net training in coimbatore | ethical hacking certification in coimbatore | ethical training institute in coimbatore | internship in coimbatore | Machine Learning Course in Coimbatore | job oriented courses in coimbatore | Digital marketing training in coimbatore

3RI Technologies said...

Thanks for interesting article.

Data Science Training in Pune

daniel said...

Nice blog..
web development company in india

Dettifoss IT Solutions said...

Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting
Mulesoft training in hyderabad

seo company in noida said...

CSS Founder can be the right choice for you, if you are looking for the best Website designing company in Delhi to get the world class web design for your business. Connect with us to get the best deal in the field of design & development services.

Dettifoss IT Solutions said...

Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting.
Mulesoft training in hyderabad

SEO Company in India said...

We are known as the best website design company in hyderabad. You can connect with us if you are interested to build your website for your business

seo company in noida said...

Are you looking for the best smartphone insurance? If yes then connect with Assure India, we are providing the best offers and services. Connect with us soon and get your best insurance offer on your smartphone and iphone insurance.

seo company in noida said...

The very nice and appreciated blog you shared in this blog. Thanks for posting these informative blogs. I'm happy to read it.
Tent Supplier in UAE

AL Mumtaz Group said...

Are you looking for the best tent service provider in Dubai, Ajman, and Sharjah? If yes then connect with AL mumtaz to get the best best designing & fabric tents that will make your party and events more impressive.
Car parking shades Dubai

Gaurav's Blog said...

I recommend that css founder is the best company for website design and development. It is known as the best website designing company.
Web Designing Company in Bahrain

Customer Support | Live Chat Service said...

Why is Yahoo Mail App Not Working?

If you are using Yahoo mail with Windows 10 application and you are unable to make use of it and you are unable to make use of it and then facing the issue then you need to follow the solution properly. We have solution for Yahoo mail app not working on Windows 10 mail app, Yahoo mail is not syncing with windows 10 mail app, unable to view emails on Yahoo, and lastly, unable to setup Yahoo on Windows 10 mail app.

Read More:- Yahoo mail won't sync

Gerry Max said...

How to disable Incognito Mode on Mac?

If you want to disable incognito Chrome mode on Mac, start by opening the 'Terminal.' Luckily, you can do this by using 'Spotlight.' Then press 'Cmd+Space' together and search for 'Terminal.' After that open it on your computer, and then type the command defaults write 'com.google.chrome IncognitoModeAvailability -integer 1' and press 'Enter' button from your keyboard. You can do the same procedure to disable incognito mode Chrome iPhone
. After that, restart your device. Now, you cannot find the incognito mode option in the Google Chrome browser. To revert the change, you just need to change the integer value to '0.'

Aquapro said...

You are providing such a piece of nice information to us. Keep it up!
Brackish Water Desalination 170000 GPD R.O. System Djibouti

Vedasrivastu said...

You have shared really very nice information. Please keep posting like this so that we can get knowledge from your blog. I hope I will read your new blog soon.
Vastu consultant in Dubai

Gaurav's Blog said...

Nice blog..! I really loved reading through this article. Thanks for sharing such a amazing post
Destination wedding in rishikesh

Gaurav's Blog said...

Nice blog..! I really loved reading through this article. Thanks for sharing such a amazing post
best destination wedding planner in Rishikesh

akashpromotedial said...

Are you looking for a good and honest web design company, we tell you about our website design company which we think is the best in the business if you are interested to judge about our company contact us,
Website design company Lod

Css Founder PVT. LTD. Web Design said...

Your blog is fabulous, superior give good results
Website design company in Mysore

Akash Kanaujiya said...

You want your customer to find your website first in their search for your website, we take care of this at every stage of designing. We direct our efforts to bring sustainable development to our projects. To get rid of any problem related to the website, contact the CSS Founder.
Website design company Eidhoven

PMP Course in Malaysia said...

I was just examining through the web looking for certain information and ran over your blog.It shows how well you understand this subject. Bookmarked this page, will return for extra. PMP Course in Malaysia

digital marketing 01 said...

I would like to say that this blog really convinced me to do it! Thanks, very good post. Digital Marketing Company in jalgaon

Promotedial said...

Promotedial is the best SEO company in Sharjah. If you are looking for a SEO company so you should connect with us. We can provide you better result.

PROMOTEDIAL said...

I appreciate you sharing this article post. Really thank you! Keep writing.
UV LAMP AQUAPRO 12GPM, 40W UV12GPM-L

PROMOTEDIAL said...

I am actually getting ready to across this information, is very helpful. Thanks a lot for sharing. digital marketing agency in rome

thorndalemedicalclinic said...

Thank you so much for sharing such a nice information. Walk in clinic near me

Akash Kanaujiya said...

We are the best website design company that provides services in this digital world, if you want to increase your business through a website, and you need the best website design and development company then without delay contact us. Go to the given link Website design company in Winterthur

website company said...

“Think about what the user is going to type” website design company in milan

turkeysvisa said...

“Jobs fill your pockets, adventures fill your soul.” Turkey visa apply

bhanu said...


Thanks For the Great Content.
ServiceNow Training in Ameerpet
ServiceNow Online Training in Hyderabad

thorndalemedicalclinic said...

“Do your best. One day, you will be someone’s hero.” Best GP in Dublin - Thorndale Medical Clinic

dubaifuturetourism said...

Thanks for your nice blog. Peace, love, and desert dust. Desert safari in Ajman

CSS Founder said...

Do you want to connect with the best and trustworthy Website Design Company in Kolkata? If yes then connect with CSS Founder. We have been leading this company since 2014 and have created too many websites at an affordable price. We can be the right choice for you. Contact us today.

E Visa Dubai said...

Dubai Visa Apply Online : Just connect with E Visa Dubai and get all types of visas from us. We have 99% success rate. We are a big and reliable team who is working and following all guidelines. Connect with us and get your visa soon.

RSM Enterprises said...

A Feasible Remedy for Erectile Dysfunction & Sexual Performance Using Snovitra 20mg
Vardenafil 20 Pills for Mens Health
Contact : +91 92163-25377

aquapro said...

Germs do not belong in your stomach Polypropylene Spun Filter - PP Spun Filter 10 Micron

7 Hotel Hills and Resorts | BlogSpot said...

" Thank you for a lovely, comfortable stay &excellent hospitality. Best wishes to you both." Resorts in Lansdowne Contact us:- 7 Hills Hotel & Resort 189, Village Fatehpur, Lansdowne Road, Pauri Garhwal, Uttarakhand. Mob 1: (+91) 9911125253 Mob 2: (+91) 9457587878 ld7hills@gmail.com

Rio Resort Lansdowne said...

Thanks for nice article .If you are looking for best hotel & resort in lansdowne then Rio-Resort is the best choice for you. lansdowne hotels Contact Mob No. +91- 9810623298, 9319749090 Email id:- rioresort.ld@gmail.com info@rioresort.club

CSS Bangalore said...

Nice Blog! To move your business on high level, checkout the best Website Design Company in Bangalore . CSS Founder is using many technology to provide you great experince at lowest prace range. You can also check our website calculator for get a estimated cost for your business.

Ijraset International Journal & Research Paper Publisher said...

IJRASET is a great platform for academics to publish their research papers and advance their careers through indexing and strengthening research skills. Best Journal for Scientific and Research Publications

cssfoundergurgaon said...

If you want to connect with the best website designing company Gurgaon then you should connect with CSS Founder.

Anonymous said...

Hi.

Thank you for sharing this information. It was a great blog, this blog gave good information about coding, thanks a lot I learn some new concepts from this blog and thanks for sharing this blog with us.
Here is sharing some Oracle Project Accounting information may be its helpful to you.

Oracle Project Accounting Training

DKverma said...

Want to get a website designing company in Rajkot? CSS Founder is one of the best website designing company in Rajkot. They deal in Website designing, Website development, App development and Digital marketing. We have a great team with the expertise of different IT Solutions.

PS Digital World said...

Are you looking for the best ? If yes then connect with PS Digital World.

Dubai Visa Apply Online said...

If you are looking for the best and trusted agent and company to apply for a Dubai Visa then E Dubai Tourism can be the right choice for you. Dubai Visa Apply Online

E visa Dubai said...

If you are a citizen of Thailand and planning to visit Dubai, you may be wondering about the visa requirements and application process. Thankfully, applying for a Dubai visa for Thailand passport is a straightforward process with the help of E Visa Dubai company.

Vedasrivastu said...

Very helpful content! Do you want a vastu consultant in Sharjah ? Vedasrivastu is here to assist you.

Saudi Arabia Visa Onine said...

If you're planning a trip to Saudi Arabia, applying for a visa is an essential step in the process. Fortunately, the visa application process for Saudi Arabia has been made incredibly convenient with the option to apply online. Visit Saudi Arabia Visa Company offers a streamlined, efficient, and secure online application system that allows travelers to apply for their visa from the comfort of their own home. They will guide you through the step-by-step process of Saudi Arabia Visa Apply Online, ensuring a stress-free and hassle-free experience.

Aquapro said...

Aquapro is a high-performance water filtration system that removes impurities from tap water, leaving you with clean, fresh, and healthy drinking water. The Aquapro system uses a combination of reverse osmosis, ultraviolet light, and carbon filtration to remove contaminants such as bacteria, viruses, heavy metals, and chemicals. The result is water that is safe and delicious to drink, and that is also good for your health.

Vishal Tomar said...

One of the most important things is to get a visa for India. However, the traditional process of obtaining a visa can be time-consuming and frustrating, often resulting in rejection. Thankfully, there are now online visa services available that provide a faster and more efficient way of applying for an Indian visa. Your best option is to choose a visits visa company for your India visa application, which offers shorter processing times and a lower risk of rejection. , So, if you are planning a trip to India, keep reading to know more about the benefits of Dubai visa apply online.

India Visa said...

India visa apply online can be a lengthy and time-consuming process, especially for those who are not familiar with the requirements and procedures. This is where a reliable and efficient visa service company comes in. By choosing Visits Visa Company to handle your India visa application online, you can save time, avoid unnecessary hassle, and increase your chances of being approved.

Prince Kumar said...

You can check our website price calculator to check the Website Development Cost in India. You can get roughly price for website design & development cost.

Roperro said...

Make your look better at party time with Roperro's Chanel Sling bags. Click on the link and select a bag for you or your's one.

businessadv said...

Clear the beginner code challenges by connecting withh Codewars. We are the best educatinal platform.

kosmik said...

Thank you for sharing this information. It was a great blog, this blog gave good information about coding, thanks a lot I learn some new concepts from this blog and thanks for sharing this blog with us.
java-full-stack-developer-training-in-hyderabad

Use an image as your UIBarButtonItem

Using an image as your UIBarButtonItem in your navigationcontroller bar can only be achieved by using a common UIButton as the BarButtonItem...