Place a view to the centre of the layout in iOS Autolayout
Below code explains how you can place a view to the centre of the layout using Autolayout in iOS.
Below code explains how you can place a view to the centre of the layout using Autolayout in iOS.
Here is a simple programs that creates two buttons programatically and sets its constraints.
Below functions takes the current date and time and formats it to give a date-time string. You can customise it in the way you want. The string that the below function generates will be like this – 23-Dec-2014 4:23 PM Use “MMMM” for “December” and “MMM” for “Dec” in month.
This article covers how do you create a tab based application in an ISOS Application. At first you Create a new Project and Click on Single View Application and name it accordingly. After creation of the project, open the storyboard and you can see a single view controller which is connected to class ViewController. Just… Read More »
Hey all, In Today’s article you will study about the implementation of UICollectionView in iOS. It is similar to GridView in Android. First drag a UICollectionView [Not the Collection View Controller] in your interface and let it be there. we will come back to it later. We are going to create a UICollectionView with custom… Read More »
The goal of @property directive in iOS is to create the getters and setters for that object so that you can access it in your program. It allows you to specify the behavior of a public property on a semantic level, and it takes care of the implementation details for you. This article also tells… Read More »
Hi all, Today I will show you how you can download an image showing complete progress. Make sure that you have an interface like the below image. You should link all the interface views with the corresponding variables in ViewController.h ViewController.h ViewController.m You can download the complete source code from here.
First we will write a class that extends UIView to create a Custom PopUp Create a Cocoa file and name it CustomPopUp You should get two files CustomPopUp.h and CustomPopUp.m CustomPopUp.h CustomPopUp.m I have a sample interface like this. Now the ViewController.m MAKE SURE YOU HOOK UP THE BUTTONS TO THEIR CORRESPONDING FUNCTIONS. You can… Read More »
Make sure you setup the server and have gone through this post before reading this article. You can read more about NSURLConnection Class from here. https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/index.html#//apple_ref/occ/instm/NSURLConnection/ Here In this article I am going to select an image from the gallery and upload to a server using 1. Synchronous method 2. Asynchronous method – different ways.… Read More »
Hey all, This is a simple post showing how you can open the “Gallery” or “Photos” application in iOS. ViewController.m ViewController.m We add “UINavigationControllerDelegate,UIImagePickerControllerDelegate” to get the events after selecting the image from the Gallery. The below function is called after selecting image from Gallery – (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo You can… Read More »
First Make sure you have this kind of layout and you have linked all the views to their respective variables. For server side I am using XAMPP for Localhost for now and My php file will be residing in Applications ▸ XAMPP ▸ xamppfiles ▸ htdocs You can download “XAMPP For Mac” from this link.… Read More »
Hey everyone, Today we will see how we can use storyboards in an application. First we will Create a sample project named “StoryBoardDemo” Now we will Add the Navigation Controller For that Go To Menu -> Editor >Embed In -> NavigationController Now Double Click on the Title Bar and Add the title “Companies” Now Drag… Read More »
If you are trying to access a file (PHP or java) residing in your server in your own machine, then you have to use a specific IP to access it. If it is public, then use the other System’s IP 1. If it is localhost, In Android you use it as 10.0.2.2 The localhost refers… Read More »
This example shows how to Open Camera, Take Photo, Save it, Load it in iOS. Before this make sure that you have two buttons and one imageview in the Interface (image above) and link them to appropriate actions and variables ViewController.h” ViewController.m
Hi all, In today’s tutorial we will study how we can customize a UITableView using “Prototype Cells” in iOS which was introduced in XCode 5.0. First Create a new Project and Name it “CustomTBLView”. Now you will get the Main.storyBoard file with other ViewController and Delegate Files. Open Main.storyBoard and “Drag” a TableView on to… Read More »
Hi All, In Todays article we will see how we can handle files in Objective C. The list of the methods used for accessing and manipulating files are listed below. Here you have to replace the FilePath1, FilePath2 and FilePath strings to our required full file paths to get the desired action. Comparing two file… Read More »
Adding button action function.
This sample code generates a random number and checks whether its already present in the array. If yes then it will not add else it will add, thus generating a random array without duplicates. Please leave your valuable comments if you found this post useful.
This method downloads the image from the specified URL and stores in the documents directory and then shown in an ImageView. Make sure you have an imageview linked with the outlet in the UserInterface. Please leave your comments if you found this code useful.
Here is a sample code that creates a radiobutton group inside a scrollview. Please make sure you have a scrollview in your UI and its linked. // This function adds the radio buttons inside the scrollview. Here I am using some of my variables to generate the count of radio buttons. Please make sure to… Read More »
Here is a simple code that does this.. After splitting the string with “componentsSeparatedByString” the parts are added to a NSMutableArray using addObject.
A court in China has ordered Apple to pay compensation to eight Chinese writers and two companies for violating their copyrights. They had claimed that unlicensed electronic versions of their books had been sold on Apple’s online store. The court ordered Apple to pay them 1.03m yuan ($165,000; £100,000) in compensation, according to the official… Read More »
This is so simple 1. Go to your Google + account (https://plus.google.com/). 2. Click on the Profile icon on the Left. 3. If you look at the URL in the address bar, it should look something like this: https://plus.google.com/104653270154306099169/posts 4. The long numerical string in the URL is your Google+ ID. Here is CoderzHeaven’s from… Read More »
This is a sample code to move a body in Box2D . First you have to make a body with variable name “moving_rec” and call the below function in a schedular at regular intervals. -(void) moveBody{ b2Vec2 force = b2Vec2(0,0); force = b2Vec2(0,3); //Giving the x an y to negative will move the body in… Read More »
Hi, For pausing a cocos2D game, then use the following line of code. For resuming a cocos2D game, then use this line of code.