Permalink
Browse files

framework v0.3 release

  • Loading branch information...
1 parent 6122f19 commit 0859e6b4f642f1bc4dd23daa70472c19a8204e60 @passslot committed Nov 18, 2012
View
@@ -1,3 +1,9 @@
+###0.3 - November 18, 2012
+* Support for custom images per pass
+* Support for custom error handler
+* Fixed issue when using Reachability in your own app
+
+
###0.2.1 - September 22, 2012
* Bugfix for special characters in pass template names
@@ -397,7 +397,6 @@
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
- "\"$(SRCROOT)/../../../Downloads/passslot-passslot-ios-sdk-5f1ce8e/sdk\"",
"\"$(SRCROOT)/../../sdk\"",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -414,7 +413,6 @@
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
- "\"$(SRCROOT)/../../../Downloads/passslot-passslot-ios-sdk-5f1ce8e/sdk\"",
"\"$(SRCROOT)/../../sdk\"",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -0,0 +1,70 @@
+//
+// PSImage.h
+// PassSlot
+//
+// Created by Pascal Brogle on 17.11.12.
+// Copyright (c) 2012 PassSlot. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+typedef NS_ENUM(NSUInteger, PSImageType) {
+ PSImageTypeIcon = 1,
+ PSImageTypeBackground = 2,
+ PSImageTypeLogo = 3,
+ PSImageTypeThumbnail = 4,
+ PSImageTypeFooter = 5,
+ PSImageTypeStrip = 6
+};
+
+typedef NS_ENUM(NSUInteger, PSImageResolution) {
+ PSImageResolutionNormal = 1,
+ PSImageResolutionHigh = 2
+};
+
+
+/** This class represents an Image
+ */
+@interface PSImage : NSObject
+
+/** @name Creating an Image */
+
+/** Creates and returns an image containing image data
+
+ @param name The name of the file. The methods looks for name.png and name@2x.png in the application’s main bundle.
+ @param type Type of the image
+ @return A PSImage with contents of name.png and name@2x.png if available
+ */
++ (PSImage*) imageNamed:(NSString *)name ofType:(PSImageType)type;
+
+
+/** Creates and returns an empty image
+
+ @param type Type of the image
+ @return A PSImage
+ */
++ (PSImage*) imageOfType:(PSImageType)type;
+
+/** @name Access and modify image*/
+
+
+/** Returns the image type
+ @return The image type
+ */
+- (PSImageType) type;
+
+/** Sets image data for the image
+
+ @param image Image data
+ @param resolution Image resolution
+ */
+- (void) setImage:(UIImage*)image forResolution:(PSImageResolution)resolution;
+
+/** Get image data of the image
+
+ @param resolution Image resolution
+ @return UIImage if image data for resolution is available, nil otherwise
+ */
+- (UIImage*) image:(PSImageResolution)resolution;
+@end
@@ -45,4 +45,13 @@
*/
- (NSDictionary*) values;
+/** Returns the images
+
+ If you create a pass using passWithPassType:serialNumber: you first have to retrieve the images from the server using [PassSlot imagesForPass:pass:] otherwise this method will return nil
+
+
+ @return An NSArray of PSImage of the pass or nil if they were not yet retrieved from the server
+ */
+- (NSArray*) images;
+
@end
@@ -11,11 +11,13 @@
#import <PassSlot/PSPass.h>
#import <PassSlot/PSPassTemplate.h>
+#import <PassSlot/PSImage.h>
typedef void (^PSPassBlock)(PSPass* pass);
typedef void (^PSTemplateListBlock)(NSArray* templateList);
typedef void (^PSCompletion)(void);
+typedef void (^PSErrorBlock)(NSError *error);
/** This class is the core of PassSlot.
@@ -56,7 +58,7 @@ typedef void (^PSCompletion)(void);
+ (NSString*) appKey;
-/** @name Creating a Pass */
+/** @name Creating a pass */
/** Create a pass from a template and request the installation of the pass
@param template PassTemplate that is used to create the pass
@@ -66,20 +68,47 @@ typedef void (^PSCompletion)(void);
*/
+ (void) createPassFromTemplate:(PSPassTemplate*)template withValues:(NSDictionary*)values andRequestInstallation:(UIViewController*)viewController completion:(PSCompletion)completion;
-/** Create a pass from a template
+/** Create a pass from a template name and request the installation of the pass
+ @param templateName PassTemplate that is used to create the pass
+ @param values Placeholder values that will be filled in
+ @param viewController The UIViewController that will be used to present the PKAddPassesViewController
+ @param completion A block object to be executed when the pass was added to passbook. This block takes no parameters and has no return value.
+ */
++ (void) createPassFromTemplateWithName:(NSString*)templateName withValues:(NSDictionary*)values andRequestInstallation:(UIViewController*)viewController completion:(PSCompletion)completion;
+
+/** Create a pass from a template and request the installation of the pass
@param template PassTemplate that is used to create the pass
@param values Placeholder values that will be filled in
- @param passBlock A block object to be executed when the pass was created. This block has no return value and takes a single PSPass argument which is the created pass
+ @param images Array of PSImage for the pass
+ @param viewController The UIViewController that will be used to present the PKAddPassesViewController
+ @param completion A block object to be executed when the pass was added to passbook. This block takes no parameters and has no return value.
*/
-+ (void) passFromTemplate:(PSPassTemplate*)template withValues:(NSDictionary*)values pass:(PSPassBlock)passBlock;
++ (void) createPassFromTemplate:(PSPassTemplate*)template withValues:(NSDictionary*)values withImages:(NSArray*)images andRequestInstallation:(UIViewController*)viewController completion:(PSCompletion)completion;
/** Create a pass from a template name and request the installation of the pass
@param templateName PassTemplate that is used to create the pass
@param values Placeholder values that will be filled in
+ @param images Array of PSImage for the pass
@param viewController The UIViewController that will be used to present the PKAddPassesViewController
@param completion A block object to be executed when the pass was added to passbook. This block takes no parameters and has no return value.
*/
-+ (void) createPassFromTemplateWithName:(NSString*)templateName withValues:(NSDictionary*)values andRequestInstallation:(UIViewController*)viewController completion:(PSCompletion)completion;
++ (void) createPassFromTemplateWithName:(NSString*)templateName withValues:(NSDictionary*)values withImages:(NSArray*)images andRequestInstallation:(UIViewController*)viewController completion:(PSCompletion)completion;
+
+/** Create a pass from a template
+ @param template PassTemplate that is used to create the pass
+ @param values Placeholder values that will be filled in
+ @param passBlock A block object to be executed when the pass was created. This block has no return value and takes a single PSPass argument which is the created pass
+ */
++ (void) passFromTemplate:(PSPassTemplate*)template withValues:(NSDictionary*)values pass:(PSPassBlock)passBlock;
+
+/** Create a pass from a template
+ @param template PassTemplate that is used to create the pass
+ @param values Placeholder values that will be filled in
+ @param images Array of PSImage for the pass
+ @param passBlock A block object to be executed when the pass was created. This block has no return value and takes a single PSPass argument which is the created pass
+ */
++ (void) passFromTemplate:(PSPassTemplate*)template withValues:(NSDictionary*)values withImages:(NSArray*)images pass:(PSPassBlock)passBlock;
+
/** Create a pass from a template name
@param templateName PassTemplate that is used to create the pass
@@ -88,8 +117,16 @@ typedef void (^PSCompletion)(void);
*/
+ (void) passFromTemplateWithName:(NSString*)templateName withValues:(NSDictionary*)values pass:(PSPassBlock)passBlock;
+/** Create a pass from a template name
+ @param templateName PassTemplate that is used to create the pass
+ @param values Placeholder values that will be filled in
+ @param images Array of PSImage for the pass
+ @param passBlock A block object to be executed when the pass was created. This block has no return value and takes a single PSPass argument which is the created pass
+ */
++ (void) passFromTemplateWithName:(NSString*)templateName withValues:(NSDictionary*)values withImages:(NSArray*)images pass:(PSPassBlock)passBlock;
+
-/** @name Modifing an Pass Instance*/
+/** @name Modifing a pass instance*/
/** Update the values of an existing pass
@param values Placeholder values that will be filled in
@@ -104,6 +141,19 @@ typedef void (^PSCompletion)(void);
*/
+ (void) valuesForPass:(PSPass*)pass pass:(PSPassBlock)passBlock;
+/** Update the images of an existing pass
+ @param images NSArray of PSImage that will be used for the pass
+ @param pass Existing PSPass that should be updated
+ @param passBlock A block object to be executed when the pass was updated. This block has no return value and takes a single PSPass argument which is the updated pass
+ */
++ (void) setImages:(NSArray*)images forPass:(PSPass*)pass updatedPass:(PSPassBlock)passBlock;
+
+/** Get the images of an existing pass
+ @param pass PSPass for which the images should be retrieved
+ @param passBlock A block object to be executed when the pass values were retrieved. This block has no return value and takes a single PSPass argument with the retrieved values
+ */
++ (void) imagesForPass:(PSPass*)pass pass:(PSPassBlock)passBlock;
+
/** @name Downloading Passes */
@@ -134,5 +184,14 @@ typedef void (^PSCompletion)(void);
*/
+ (void) listTemplates:(PSTemplateListBlock)templates;
+/** @name Error handling */
+
+/** Sets the error handler
+
+ @param errorHandler A block object that handles errors
+*/
++ (void) setErrorHandler:(PSErrorBlock)errorHandler;
+
+
@end
Binary file not shown.
Oops, something went wrong.

0 comments on commit 0859e6b

Please sign in to comment.