Authorsurjit.joshi

Get SIM card details of iPhone

G

Here is the code to get SIM card details of iPhone 1) Add CoreTelephony framework 2) Import following libraries #import <CoreTelephony/CTCarrier.h> #import <CoreTelephony/CTTelephonyNetworkInfo.h> 3) Use this code to get details CTTelephonyNetworkInfo* info = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier* carrier = info.subscriberCellularProvider; NSString *carrierName = carrier...

Can we create flashing red/blue circle around user location in mapview in iPhone ?

C

Yes we can create with a simple UIView animation & few images. 1) Add the MapView MKMapView *mapView = [[MKMapView alloc] initWithFrame:yourFrameFrame]; mapView.mapType = MKMapTypeStandard; mapView.delegate = self; [mapView setShowsUserLocation:YES]; [self.view addSubview:mapView];   2) In viewForAnnotation method – (MKAnnotationView *)mapView:(MKMapView *)mapview...

Using FBGraph in iPhone

U

The FBGraph API is bit complex, but much useful than any other ways for accessing contents of Facebook. INTRODUCTION ============ Object Output: { “name”: “Facebook Platform”, “type”: “page”, “website”: “;, “username”: “platform”, “founded”: “May 2007”, “company_overview”:...

Draw a line by touch On UIImageView in iPhone

D

Its much useful for drawing something on screen by touch. 1) Declare 4 objects in .h file CGPoint lastPoint; BOOL mouseSwiped; int mouseMoved; UIImageView *signImage; 2) First create a UIImageView object ie. a blank image in viewDidLoad signImage = [[UIImageView alloc ] initWithFrame:CGRectMake(15, 60, 290, 320)]; signImage.image = nil; signImage.tag = 1000; signImage.layer.borderWidth = 3.0;...

Simple Custom UITabBarController with UINavigationController in iPhone/iPad programatically

S

//In AppDelegate.h file UITabBarController *tabBarController; @property (strong, nonatomic) UITabBarController *tabBarController;   //In AppDelegate.h.m file @synthesize tabBarController = _tabBarController;     self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];   NSMutableArray *tabBarViewControllers = [[NSMutableArray alloc] init];...

Play YouTube video using UIWebView on iPhone

P

Hi, Sometimes it gets very difficult to find a way to do simple things. Playing videos on iPhone is a simple thing, using UIWebView. Just need to embed the URL to HTML tags, and then load the HTML in UIWebView. Here is the code to do so. Pass you URL of YouTube Video in “urlStr”. //In .h file UIWebView *videoView; // In .m file videoView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320...

Five ways to pull yourself out of workaholism

F

‘In sickness and in health and till death do us part’ – if these are the vows your family and friends think you have exchanged with your Blackberry/keyboard/iPad, then you are a certified workaholic. The symptoms are many, but some of the significant ones are that you punch away nonstop, receive every call from office and take your meals at odd hours to finish that extra bit at...

How to create iPhone/iPad’s “Slide to Unlock” animation ?

H

This is how Apple implemented “Slider to Unlock” or “Slide to Power off” animation. In .h file UISlider *slider; BOOL touchIsDown; CALayer *textLayer;     – (void)viewDidLoad { self.view.layer.backgroundColor = [[UIColor grayColor] CGColor]; UIImageView *sliderBackView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@”SliderBack1.png”]]; sliderBackView.frame =...

How to Create UILocalNotification, repeating every minute ?

H

There are two types of notifications in iOS, One is Local notification & other is PUsh notification. Added code to create Local notification. // creating notification NSDate *newDate = [NSDate dateWithTimeIntervalSinceNow:60]; // where 60 = seconds, so add your seconds here Class cls = NSClassFromString(@”UILocalNotification”); if (cls != nil) { UILocalNotification *notification =...

Category