Skip to content
This repository has been archived by the owner on Nov 22, 2020. It is now read-only.

Singleton and Localization #19

Merged
merged 13 commits into from Apr 7, 2013
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Harpy/Harpy.bundle/ja.lproj/HarpyLocalizable.strings
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
48 changes: 44 additions & 4 deletions Harpy/Harpy.h
Expand Up @@ -8,7 +8,47 @@

#import <Foundation/Foundation.h>

@interface Harpy : NSObject <UIAlertViewDelegate>
@protocol HarpyDelegate <NSObject>

@optional
- (void)harpyDidShowUpdateDialog;
- (void)harpyUserDidLaunchAppStore;
- (void)harpyUserDidSkipVersion;
- (void)harpyUserDidCancel;

@end

typedef NS_ENUM(NSUInteger, HarpyAlertType)
{

HarpyAlertTypeForce, // Forces user to update your app
HarpyAlertTypeOption, // (DEFAULT) Presents user with option to update app now or at next launch
HarpyAlertTypeSkip // Presents User with option to update the app now, at next launch, or to skip this version all together

};

@interface Harpy : NSObject

/**
The harpy delegate can be used to know when the update dialog is shown and which action a user took.
See the @protocol declaration above.
*/
@property (weak, nonatomic) id<HarpyDelegate> delegate;

/**
The app id of your app.
*/
@property (strong, nonatomic) NSString *appID;

/**
The alert type to present to the user when there is an update. See the `HarpyAlertType` enum above.
*/
@property (nonatomic) enum HarpyAlertType alertType;

/**
The shared Harpy instance.
*/
+ (id)sharedInstance;

/**
Checks the installed version of your application against the version currently available on the iTunes store.
Expand All @@ -24,20 +64,20 @@
Perform check for new version of your app
Place in application:didFinishLaunchingWithOptions: AFTER calling makeKeyAndVisible on your UIWindow iVar
*/
+ (void)checkVersion;
- (void)checkVersion;

/*
Perform daily check for new version of your app
Useful if user returns to you app from background after extended period of time
Place in applicationDidBecomeActive:
*/
+ (void)checkVersionDaily;
- (void)checkVersionDaily;

/*
Perform weekly check for new version of your app
Useful if user returns to you app from background after extended period of time
Place in applicationDidBecomeActive:
*/
+ (void)checkVersionWeekly;
- (void)checkVersionWeekly;

@end