QuickLook framework is one of the best framework by Apple. It can be used to preview files such as iWork, MS Office, RTF, CSV documents, pdf, text files, Images. You can use this framework to implement image zooming and sharing feature. We don’t need to write this zooming and sharing code ourself. QuickLook framework provides this all awesome functionality. Let’s start implementing...
Animated Launch Screen
Basically when we want to set an image for LaunchScreen then we use LaunchScreen.storyboard for setting an image, but as this file does not have any class file (eg .swift or .h & .m) so we can not write code for animating that image at runtime. To achieve this we need to use main.storyboard Steps to implement animated Launch Screen : – 1) Click on project name on ProjectNavigatorPanel ...
NSSortDescriptor in swift 3
To sort an json array using NSSortDescriptor in swift3 NSSortDescriptor : A sort descriptor describes a comparison used to sort a collection of objects. You create an instance of NSSortDescriptor that specifies the property key to be sorted, and whether the comparison should be in ascending, or descending order. A sort descriptor can also specify a method to use when comparing the property...
iOS – Image Downloader helper class (Swift 3)
Image Downloader Class written in Swift 3 to download images. class Downloader { class func downloadImageWithURL(_ url:String) -> UIImage? { let data = try? Data(contentsOf: URL(string: url)!) if let imgData = data { return UIImage(data: imgData) } else { print(“\n\nThis image url may be wrong : \n \(url)”) ...
Make future payment using Braintree payment gateway
This tutorial is for those who are developing a mobile application and they want to charge a customer(one or more time) in future. In this tutorial I am going to explain backend functionality in details. Most of the time we need charge to customer in future. Some developers may store details in the database but this is not the best way when it comes to security. Fortunately this feature is...
UIAlertView Deprecated in Xcode6.0
Hi All, Everybody is curious about changes made by Apple in Xcode 6 and newly added functionalities, here is the one noticeable change which is nothing but UIAlertView and UIActionsheet is deprecated. Now Apple has introduced a new class for replacement of those – UIAlertController. Let see how it can be used for displaying alertview : UIAlertController *alertController = [UIAlertController...
Guide for screen sizes for ios and android
We always gets confused about screen sizes of mobile devices of ios and android. So created simplified guide for screen sizes for ios and android.
How to combine two images?
UIImageView *certImgView; – (IBAction)combineimages:(id)sender { UIImage *combinedImg=[self combineTwoImagesFirst:self.certImgView.image andSecond:[UIImage imageNamed:@”1.jpeg”]]; certImgView.image=combinedImg; } -(UIImage *)combineTwoImagesFirst:(UIImage *)cardImg andSecond:(UIImage *)faceImg { UIImage *bottomImage = faceImg; //background image UIImage *image = cardImg;...
Easy loading image in UIImageView.
Replace – SelectedThemesController— (replace your class name) [SelectedThemesController processImageDataWithURLString:imgUrl andBlock:^(NSData *imageData) { if (self.view.window) { UIImage *image = [UIImage imageWithData:imageData]; if (!image) //not found show default image { pofferimg.image=[UIImage imageNamed:@”11_240X240.png”]; } else //found { NSArray *subviewArray =...
Customise UIImageView with circular shape and borders ?
UIImageView *customImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 100, 50, 50)];
customImage.backgroundColor = [UIColor blackColor];
customImage.layer.cornerRadius = 25.0f;
customImage.layer.masksToBounds = YES;
[[customImage layer] setBorderWidth:3.0f];
[[customImage layer] setBorderColor:[UIColor whiteColor].CGColor];
[self.view addSubview:customImage];