Wednesday, 29 January 2014

TTCounterLabel for iOS



A custom UILabel that acts as a time counter, counting up or down and formatting the string to hours, minutes, seconds and milliseconds. Designed to accept a value in milliseconds that is then displayed it in a time friendly format. Currently the controls supports up-to a maximum value of 99 hours 59 minutes 59 seconds and 999 milliseconds, which should be enough for most uses. The control automatically removes any leading zeros and centralises the result. It also supports different fonts for each unit division.


TTCounterLabel

A custom UILabel that acts as a time counter, counting up or down and formatting the string to hours, minutes, seconds and milliseconds. Designed to accept a value in milliseconds that is then displayed it in a time friendly format. Currently the controls supports up-to a maximum value of 99 hours 59 minutes 59 seconds and 999 milliseconds, which should be enough for most uses. The control automatically removes any leading zeros and centralises the result. It also supports different fonts for each unit division.
Alt text

Setup

Installing with CocoaPods
If you're unfamiliar with CocoaPods there is a great tutorial here to get you up to speed.
  1. In Terminal navigate to the root of your project.
  2. Run 'touch Podfile' to create the Podfile.
  3. Open the Podfile using 'open -e Podfile'
  4. Add the pod TTCounterLabel to your Podfile.
    platform :ios
    pod 'TTCounterLabel'
    
  5. Run pod install.
  6. Open your app's .xcworkspace file to launch Xcode and start using the control!
Installing manually from GitHub
  1. Download the TTCounterLabel.h and TTcounterLabel.m files and add them to your Xcode project.
  2. #import TTCounterLabel.h wherever you need it.
  3. Follow the included sample project to get started.
Running the sample project
Check out the sample project included in the repository. Just open the '.xcworkspace' file in the Sample folder and the project should build correctly.

Author(s)

Licence

Distributed under the MIT License.



Download source code from here

CircularTimer


CircularTimer

CircularTimer is a class that creates a custom circular timer, showing the percentage completed between two dates.

Installation

Drop the files CircularTimer.h and CircularTimer.m into your Xcode project.

Usage

In your ViewController import the header file CircularTimer.h, and create a CircularTimer property to keep a reference:
@property (nonatomic, strong) CircularTimer *circularTimer;
Then, to create the object use a code like this:
self.circularTimer = 
[[CircularTimer alloc] initWithPosition:CGPointMake(0.0f, 0.0f)
                                 radius:radius
                         internalRadius:internalRadius
                      circleStrokeColor:circleStrokeColor
                activeCircleStrokeColor:activeCircleStrokeColor
                            initialDate:initialDate
                              finalDate:finalDate
                          startCallback:^{
                              //do something
                          }
                            endCallback:^{
                                //do something
                            }];
and add it as subview
[self.view addSubview:self.circularTimer];

Methods

Create a CircularTimer using:
- (id)initWithPosition:(CGPoint)position
                radius:(float)radius
        internalRadius:(float)internalRadius
     circleStrokeColor:(UIColor *)circleStrokeColor
activeCircleStrokeColor:(UIColor *)activeCircleStrokeColor
           initialDate:(NSDate *)initialDate
             finalDate:(NSDate *)finalDate
         startCallback:(void (^)(void))startBlock
           endCallback:(void (^)(void))endBlock;       
You can see the meaning of radiusinternalRadiuscircleStrokeColor and activeCircleStrokeColorin this image:
image
- (BOOL)isRunning;
Indicates if the CircularTimer is currently running.
- (BOOL)willRun;
Indicates if the CircularTimer will run (in other words, if the current time is smaller than the CircularTimerfinalDate).
- (void)stop;
Stops the CircularTimer.
- (NSTimeInterval)intervalLength;
Returns the interval between the initialDate and the finalDate.
- (NSTimeInterval)runningElapsedTime;
Returns the interval of time elapsed since the CircularTimer started running.

Demo

You can find a demo project in this repository. Meanwhile, you can watch a teaser:

About us

CROWD STUDIO

Licence

Copyright (C) 2013 CROWD STUDIO
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Download Source Code from here

Saturday, 25 January 2014

Download Images Asynchronously



Hi this is a simple code that used to download images from url in background.

  
    
    dispatch_queue_t imageLoadQueue = dispatch_queue_create("com.gmm.test",NULL);
    
    dispatch_async(imageLoadQueue, ^{
//Wait for 5 seconds...
        usleep(1000000);
        docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
        
        
        for(int k=0; k <[allImage count] ;k++){
            
           
            imgURL = [allImage objectAtIndex:k];
            [imagePreview addObject:imgURL];
            imgData=[NSData dataWithContentsOfURL:[NSURL URLWithString:imgURL]];
           
            
            [imgData writeToFile:[NSString stringWithFormat:@"%@/%@", docPath, [imgURL lastPathComponent]] atomically:YES];
            
            
        }
//reload ur viewcontroller or tableview or collectionview  if necessary           
        
     
    });

    

Adding Google Analytics to your iOS App

Hi..Anyone heard about google analytics??? hope most of you guys know about it.

http://www.google.co.in/analytics/

Your customers go everywhere; shouldn't your analytics? Google Analytics shows you the full customer picture across ads and videos, websites and social tools, tablets and smartphones. That makes it easier to serve your current customers and win new ones.


Know your audience

No two people think exactly alike. Google Analytics helps you analyze visitor traffic and paint a complete picture of your audience and their needs, wherever they are along the path to purchase.


Trace the customer path

Where customers are can be as critical as who they are. Tools like Traffic Sources and Visitor Flow help you track the routes people take to reach you, and the devices they use to get there, so you can meet them where they are and improve the visitor experience.

See what they're up to

Do some types of people give you better results? You'll find out with tools like In-Page Analytics, which lets you make a visual assessment of how visitors interact with your pages. Learn what they're looking for and what they like, then tailor all your marketing activities — from your site to your apps to your ad campaigns — for maximum impact.



How to setup a Google Analytics account??

Please follow the link


to know more about Analytics account please check this video