Tuesday, 23 April 2013

iPhone4 and iPhone5 set scroll view



[scroll setContentSize:CGSizeMake(320, 530)];
    scroll.autoresizingMask = UIViewAutoresizingFlexibleHeight;

Thursday, 18 April 2013

CATransition Animation


    
    CATransition *tr=[CATransition  animation];
    tr.duration=1.0;
    tr.timingFunction=[CAMediaTimingFunction        functionWithName:kCAMediaTimingFunctionLinear];
    tr.type=kCATransitionPush;
    tr.subtype=kCATransitionFromBottom;
    tr.delegate=self;
    [self.view.layer addAnimation:tr forKey:nil];

Saturday, 13 April 2013

Thursday, 11 April 2013

new link

http://www.idiscoverlearning.com/ios-external-links/

Splash Screen Animation



AppDelegate.h

#import <UIKit/UIKit.h>

@class ViewController;



@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
    UIImageView *splashView;
}

@property (strong, nonatomic) UIWindow *window;

@property (strong, nonatomic) ViewController *viewController;

- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context;

@end

AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    
    // Make this interesting.
    
    splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
    splashView.image = [UIImage imageNamed:@"Default.png"];
    [self.window addSubview:splashView];
   [self.window bringSubviewToFront:splashView];
    [UIView beginAnimations:@"yourAnim" context:nil];
    [UIView setAnimationDuration:2.0];
   [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.window cache:YES];
   [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
    splashView.alpha = 0.0;
    splashView.frame = CGRectMake(-60, -85, 440, 635);
    //[UIView commitAnimations];
    
    return YES;
}

- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
    [splashView removeFromSuperview];
}

Type 2:



- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    
    // Make this interesting.
  
   splashView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]];
    [splashView sizeToFit];
    
    UIViewController* tmpVC = [UIViewController new];
    [tmpVC.view setFrame:splashView.bounds];
    [tmpVC.view addSubview:splashView];
    
    // just by instantiating a UIWindow, it is automatically added to the app.
    UIWindow *keyWin = [UIApplication sharedApplication].keyWindow;
    UIWindow *hudWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0.0f, -20.0f, keyWin.frame.size.width, keyWin.frame.size.height)];
    
    [hudWindow setBackgroundColor:[UIColor clearColor]];
    [hudWindow setRootViewController:tmpVC];
    [hudWindow setAlpha: 1.0];
    [hudWindow setWindowLevel:UIWindowLevelStatusBar+1];
    [hudWindow setHidden:NO];
    
    UIWindow *_hudWin = hudWindow;
    
    [UIView animateWithDuration:2.0f animations:^{
        [_hudWin setAlpha:0.f];
    } completion:^(BOOL finished) {
        [_hudWin removeFromSuperview];
        
    }];
    
    return YES;
}

Tuesday, 9 April 2013

Post the data server in HTTP format


NSURL *url = [NSURL URLWithString:@"http://192.168.1.13:8081/rm/CustomerRegistrationServlet"];
        
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url
                                                               cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
        
        
        NSData *requestData = [NSData dataWithBytes:[jsonRequest UTF8String] length:[jsonRequest length]];
        
        [request setHTTPMethod:@"POST"];
        [request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
        [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
        [request setValue:[NSString stringWithFormat:@"%d", [requestData length]] forHTTPHeaderField:@"Content-Length"];
        [request setHTTPBody: requestData];
        NSError *error1;
        NSURLResponse *response;
        
        NSData *uData=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error1];
        NSString *data=[[NSString alloc]initWithData:uData encoding:NSUTF8StringEncoding];
        //
        NSMutableDictionary *temp = [data JSONValue];
        //
        NSLog(@"%@",temp);

Monday, 8 April 2013

App Store Review Guidelines

https://developer.apple.com/appstore/resources/approval/guidelines.html

view class to view classs transition with animation



TYPE 1:

Aboutus *second = [[Aboutus alloc] initWithNibName:nil bundle:nil];
 second.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
 [self presentModalViewController:second animated:YES];

Type 2:


[UIView transitionWithView:self.view duration:1.0 options:UIViewAnimationOptionTransitionFlipFromRight animations:^{
                 Aboutus *second1 = [[Aboutus alloc] init];
                 [self presentModalViewController:second1 animated:YES];
                } completion:YES];