Objective-C: Show dictionary definition on UITextField

By chance i founded this tricks that permit to show a “Dictionary definition” for the selected word in a UITextField on a hidden menu.

Menu contains these actions:

  • cut
  • copy
  • select
  • select all
  • paste
  • suggest
  • definition
  • indent left
  • indent right

It’s a cool tricks, that show an hidden menu with a lot of options, that i never see before!

Watch this:

And this is the dictionary definition for pizza on simulator:

How?

Subclass UITextField and override:

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
  return [super canPerformAction:action withSender:sender];
}

Instead, if you want to block one or more actions from menu, add sel_isEqual

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
  if ( sel_isEqual(action, @selector(paste:)) ) return NO;
  if ( sel_isEqual(action, @selector(copy:)) ) return NO;
  // [...] etc etc

  return [super canPerformAction:action withSender:sender];
}

that’s all!

 

[iOS] Technical Interview possible question – 01

Suppose that we have a ViewController.h and .m like this:

Read More

 

Win a Paid GitHub Account!

Great idea!
Follow this link: http://appsumo.com/~_z6T and you can win a paid account for Github!

Read More

 

[SHELL] Count lines of code in all files recursively

Here a unix command line script to count code lines for your project (or something else!).

Read More

 

Google Graph

And do you know this?
Typing in google “x/3, (x/2)^2” for example or another functions it draw a scrollable graph like Google Maps!

Cool!

http://goo.gl/x1RAs

 

[Mobile] Stencil to mock up your prototypes

Wow!!!
A cool stencil to easy make wireframes prototypes!

The stencils are for iPhone / iPad / Android / Honeycomb!

Read More

 

[Objective-C] Use Google speech on iPhone

Do you want use google speech api to recognize text from a dictate?

Read More

 

[Wp7] Matrix Time Clock

Download now!

A simple matrix time clock with current data.

Created by an inspiration to my matrix clock on desk!
You can open it and watch clock all the night, it prevent your phone from sleep.
Enjoy.

 

[iPhone/iPad] Cutaway App v1.0.3

Cutaway App for iPhone/iPod/iPad 3.2+. [cutaway.it]


CutAway - CutAway SRL
New release 1.0.3 – bug fix.


Cutaway app mobile iphone ipadCutAway - CutAway SRL

 

Google+ Plus Arduino Notifier

A very easy project this morning!

A robotic – automatic notifier for google plus with an arduino, a servo motor and an… icecream box! (plus.google.com)!


arduino google plus notifier

Read More