Skip to content

Commit

Permalink
Changed some method names and bumped version number to 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sascha committed Oct 19, 2014
1 parent cd7a2fe commit 5840017
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion SSCWhatsAppActivity.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SSCWhatsAppActivity"
s.version = "1.1"
s.version = "1.2"
s.summary = "A UIActivity subclass for sharing images and messages with WhatsApp."
s.homepage = "https://github.com/sascha/SSCWhatsAppActivity"
s.screenshots = "https://raw.github.com/sascha/SSCWhatsAppActivity/master/screenshot.png"
Expand Down
2 changes: 1 addition & 1 deletion SSCWhatsAppActivity/SSCWhatsAppActivity.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ extern NSString * const SSCActivityTypePostToWhatsApp;

@interface SSCWhatsAppActivity : UIActivity

-(id)initWithPreferText:(BOOL)prefer;
- (instancetype)initWithTextPreferred:(BOOL)preferText;

@end
16 changes: 8 additions & 8 deletions SSCWhatsAppActivity/SSCWhatsAppActivity.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ @interface SSCWhatsAppActivity () <UIDocumentInteractionControllerDelegate>
@property (nonatomic, strong) UIDocumentInteractionController *documentInteractionController;
@property (nonatomic, strong) NSMutableArray *stringsToShare;
@property (nonatomic, strong) UIImage *imageToShare;
@property BOOL preferText;
@property (nonatomic, assign, getter=isTextPreferred) BOOL textPreferred;

@end

@implementation SSCWhatsAppActivity

#pragma mark - Accessors

-(id)initWithPreferText:(BOOL)prefer{
self = [super init];
if(self){
self.preferText = prefer;
- (instancetype)initWithTextPreferred:(BOOL)preferText {
if ((self = [super init])) {
_textPreferred = preferText;
}

return self;
}

Expand All @@ -53,8 +53,8 @@ - (UIImage *)activityImage {
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
return [UIImage imageNamed:@"SSCWhatsAppIcon-iOS6"];
} else if(floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_7_1){
return [UIImage imageNamed:@"SSCWhatsAppIcon"];
}else {
return [UIImage imageNamed:@"SSCWhatsAppIcon-iOS7"];
} else {
return [UIImage imageNamed:@"SSCWhatsAppIcon-iOS8"];
}
}
Expand Down Expand Up @@ -99,7 +99,7 @@ - (void)prepareWithActivityItems:(NSArray *)activityItems {
}

- (void)performActivity {
if (self.imageToShare && !self.preferText) {
if (self.imageToShare && !self.isTextPreferred) {
[self sendImageToDocumentInteractionController:self.imageToShare];
} else {
[self sendStringToWhatsApp:[self.stringsToShare componentsJoinedByString:@" "]];
Expand Down
File renamed without changes
File renamed without changes
16 changes: 8 additions & 8 deletions WhatsAppActivityDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
2B1F003318B0FE1C00242DE9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2B1F003218B0FE1C00242DE9 /* Images.xcassets */; };
2B1F005218B0FED300242DE9 /* SSCRootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B1F005118B0FED300242DE9 /* SSCRootViewController.m */; };
2B1F005618B0FF8B00242DE9 /* SSCWhatsAppActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B1F005518B0FF8B00242DE9 /* SSCWhatsAppActivity.m */; };
2B1F005918B0FF9500242DE9 /* SSCWhatsAppIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1F005718B0FF9500242DE9 /* SSCWhatsAppIcon.png */; };
2B1F005A18B0FF9500242DE9 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 2B1F005818B0FF9500242DE9 /* [email protected] */; };
2B1F005918B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1F005718B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7.png */; };
2B1F005A18B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1F005818B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7@2x.png */; };
2B1F005D18B1014100242DE9 /* SSCWhatsAppIcon-iOS6.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1F005B18B1014000242DE9 /* SSCWhatsAppIcon-iOS6.png */; };
2B1F005E18B1014100242DE9 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 2B1F005C18B1014100242DE9 /* [email protected] */; };
2B7A0AD019B3458F008DF6A6 /* shareImage.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 2B7A0ACF19B3458F008DF6A6 /* shareImage.jpg */; };
Expand All @@ -42,8 +42,8 @@
2B1F005118B0FED300242DE9 /* SSCRootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSCRootViewController.m; sourceTree = "<group>"; };
2B1F005418B0FF8B00242DE9 /* SSCWhatsAppActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SSCWhatsAppActivity.h; path = SSCWhatsAppActivity/SSCWhatsAppActivity.h; sourceTree = "<group>"; };
2B1F005518B0FF8B00242DE9 /* SSCWhatsAppActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SSCWhatsAppActivity.m; path = SSCWhatsAppActivity/SSCWhatsAppActivity.m; sourceTree = "<group>"; };
2B1F005718B0FF9500242DE9 /* SSCWhatsAppIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = SSCWhatsAppIcon.png; path = SSCWhatsAppActivity/SSCWhatsAppIcon.png; sourceTree = "<group>"; };
2B1F005818B0FF9500242DE9 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "SSCWhatsAppActivity/[email protected]"; sourceTree = "<group>"; };
2B1F005718B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "SSCWhatsAppIcon-iOS7.png"; path = "SSCWhatsAppActivity/SSCWhatsAppIcon-iOS7.png"; sourceTree = "<group>"; };
2B1F005818B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "SSCWhatsAppIcon-iOS7@2x.png"; path = "SSCWhatsAppActivity/SSCWhatsAppIcon-iOS7@2x.png"; sourceTree = "<group>"; };
2B1F005B18B1014000242DE9 /* SSCWhatsAppIcon-iOS6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "SSCWhatsAppIcon-iOS6.png"; path = "SSCWhatsAppActivity/SSCWhatsAppIcon-iOS6.png"; sourceTree = "<group>"; };
2B1F005C18B1014100242DE9 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "SSCWhatsAppActivity/[email protected]"; sourceTree = "<group>"; };
2B7A0ACF19B3458F008DF6A6 /* shareImage.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = shareImage.jpg; sourceTree = "<group>"; };
Expand Down Expand Up @@ -124,8 +124,8 @@
children = (
2B1F005418B0FF8B00242DE9 /* SSCWhatsAppActivity.h */,
2B1F005518B0FF8B00242DE9 /* SSCWhatsAppActivity.m */,
2B1F005718B0FF9500242DE9 /* SSCWhatsAppIcon.png */,
2B1F005818B0FF9500242DE9 /* [email protected] */,
2B1F005718B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7.png */,
2B1F005818B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7@2x.png */,
2B1F005B18B1014000242DE9 /* SSCWhatsAppIcon-iOS6.png */,
2B1F005C18B1014100242DE9 /* [email protected] */,
7C734FFF19F01D1300C7F93C /* SSCWhatsAppIcon-iOS8.png */,
Expand Down Expand Up @@ -193,10 +193,10 @@
7C73500319F01D1300C7F93C /* [email protected] in Resources */,
2B1F005D18B1014100242DE9 /* SSCWhatsAppIcon-iOS6.png in Resources */,
2B7A0AD019B3458F008DF6A6 /* shareImage.jpg in Resources */,
2B1F005A18B0FF9500242DE9 /* [email protected] in Resources */,
2B1F005A18B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7@2x.png in Resources */,
7C73500219F01D1300C7F93C /* SSCWhatsAppIcon-iOS8.png in Resources */,
7C73500419F01D1300C7F93C /* [email protected] in Resources */,
2B1F005918B0FF9500242DE9 /* SSCWhatsAppIcon.png in Resources */,
2B1F005918B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7.png in Resources */,
2B1F003318B0FE1C00242DE9 /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
Expand Down

0 comments on commit 5840017

Please sign in to comment.