diff --git a/SSCWhatsAppActivity.podspec b/SSCWhatsAppActivity.podspec index 311c069..f948007 100644 --- a/SSCWhatsAppActivity.podspec +++ b/SSCWhatsAppActivity.podspec @@ -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" diff --git a/SSCWhatsAppActivity/SSCWhatsAppActivity.h b/SSCWhatsAppActivity/SSCWhatsAppActivity.h index 9d909c3..8f3c6fa 100644 --- a/SSCWhatsAppActivity/SSCWhatsAppActivity.h +++ b/SSCWhatsAppActivity/SSCWhatsAppActivity.h @@ -12,6 +12,6 @@ extern NSString * const SSCActivityTypePostToWhatsApp; @interface SSCWhatsAppActivity : UIActivity --(id)initWithPreferText:(BOOL)prefer; +- (instancetype)initWithTextPreferred:(BOOL)preferText; @end diff --git a/SSCWhatsAppActivity/SSCWhatsAppActivity.m b/SSCWhatsAppActivity/SSCWhatsAppActivity.m index a37fa1c..ee76803 100644 --- a/SSCWhatsAppActivity/SSCWhatsAppActivity.m +++ b/SSCWhatsAppActivity/SSCWhatsAppActivity.m @@ -15,7 +15,7 @@ @interface SSCWhatsAppActivity () @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 @@ -23,11 +23,11 @@ @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; } @@ -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"]; } } @@ -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:@" "]]; diff --git a/SSCWhatsAppActivity/SSCWhatsAppIcon.png b/SSCWhatsAppActivity/SSCWhatsAppIcon-iOS7.png similarity index 100% rename from SSCWhatsAppActivity/SSCWhatsAppIcon.png rename to SSCWhatsAppActivity/SSCWhatsAppIcon-iOS7.png diff --git a/SSCWhatsAppActivity/SSCWhatsAppIcon@2x.png b/SSCWhatsAppActivity/SSCWhatsAppIcon-iOS7@2x.png similarity index 100% rename from SSCWhatsAppActivity/SSCWhatsAppIcon@2x.png rename to SSCWhatsAppActivity/SSCWhatsAppIcon-iOS7@2x.png diff --git a/WhatsAppActivityDemo.xcodeproj/project.pbxproj b/WhatsAppActivityDemo.xcodeproj/project.pbxproj index 15b118b..9e0b112 100644 --- a/WhatsAppActivityDemo.xcodeproj/project.pbxproj +++ b/WhatsAppActivityDemo.xcodeproj/project.pbxproj @@ -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 /* SSCWhatsAppIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1F005818B0FF9500242DE9 /* SSCWhatsAppIcon@2x.png */; }; + 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 /* SSCWhatsAppIcon-iOS6@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1F005C18B1014100242DE9 /* SSCWhatsAppIcon-iOS6@2x.png */; }; 2B7A0AD019B3458F008DF6A6 /* shareImage.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 2B7A0ACF19B3458F008DF6A6 /* shareImage.jpg */; }; @@ -42,8 +42,8 @@ 2B1F005118B0FED300242DE9 /* SSCRootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSCRootViewController.m; sourceTree = ""; }; 2B1F005418B0FF8B00242DE9 /* SSCWhatsAppActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SSCWhatsAppActivity.h; path = SSCWhatsAppActivity/SSCWhatsAppActivity.h; sourceTree = ""; }; 2B1F005518B0FF8B00242DE9 /* SSCWhatsAppActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SSCWhatsAppActivity.m; path = SSCWhatsAppActivity/SSCWhatsAppActivity.m; sourceTree = ""; }; - 2B1F005718B0FF9500242DE9 /* SSCWhatsAppIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = SSCWhatsAppIcon.png; path = SSCWhatsAppActivity/SSCWhatsAppIcon.png; sourceTree = ""; }; - 2B1F005818B0FF9500242DE9 /* SSCWhatsAppIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "SSCWhatsAppIcon@2x.png"; path = "SSCWhatsAppActivity/SSCWhatsAppIcon@2x.png"; sourceTree = ""; }; + 2B1F005718B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "SSCWhatsAppIcon-iOS7.png"; path = "SSCWhatsAppActivity/SSCWhatsAppIcon-iOS7.png"; sourceTree = ""; }; + 2B1F005818B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "SSCWhatsAppIcon-iOS7@2x.png"; path = "SSCWhatsAppActivity/SSCWhatsAppIcon-iOS7@2x.png"; sourceTree = ""; }; 2B1F005B18B1014000242DE9 /* SSCWhatsAppIcon-iOS6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "SSCWhatsAppIcon-iOS6.png"; path = "SSCWhatsAppActivity/SSCWhatsAppIcon-iOS6.png"; sourceTree = ""; }; 2B1F005C18B1014100242DE9 /* SSCWhatsAppIcon-iOS6@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "SSCWhatsAppIcon-iOS6@2x.png"; path = "SSCWhatsAppActivity/SSCWhatsAppIcon-iOS6@2x.png"; sourceTree = ""; }; 2B7A0ACF19B3458F008DF6A6 /* shareImage.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = shareImage.jpg; sourceTree = ""; }; @@ -124,8 +124,8 @@ children = ( 2B1F005418B0FF8B00242DE9 /* SSCWhatsAppActivity.h */, 2B1F005518B0FF8B00242DE9 /* SSCWhatsAppActivity.m */, - 2B1F005718B0FF9500242DE9 /* SSCWhatsAppIcon.png */, - 2B1F005818B0FF9500242DE9 /* SSCWhatsAppIcon@2x.png */, + 2B1F005718B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7.png */, + 2B1F005818B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7@2x.png */, 2B1F005B18B1014000242DE9 /* SSCWhatsAppIcon-iOS6.png */, 2B1F005C18B1014100242DE9 /* SSCWhatsAppIcon-iOS6@2x.png */, 7C734FFF19F01D1300C7F93C /* SSCWhatsAppIcon-iOS8.png */, @@ -193,10 +193,10 @@ 7C73500319F01D1300C7F93C /* SSCWhatsAppIcon-iOS8@2x.png in Resources */, 2B1F005D18B1014100242DE9 /* SSCWhatsAppIcon-iOS6.png in Resources */, 2B7A0AD019B3458F008DF6A6 /* shareImage.jpg in Resources */, - 2B1F005A18B0FF9500242DE9 /* SSCWhatsAppIcon@2x.png in Resources */, + 2B1F005A18B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7@2x.png in Resources */, 7C73500219F01D1300C7F93C /* SSCWhatsAppIcon-iOS8.png in Resources */, 7C73500419F01D1300C7F93C /* SSCWhatsAppIcon-iOS8@3x.png in Resources */, - 2B1F005918B0FF9500242DE9 /* SSCWhatsAppIcon.png in Resources */, + 2B1F005918B0FF9500242DE9 /* SSCWhatsAppIcon-iOS7.png in Resources */, 2B1F003318B0FE1C00242DE9 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/WhatsAppActivityDemo/Images.xcassets/AppIcon.appiconset/Contents.json b/WhatsAppActivityDemo/Images.xcassets/AppIcon.appiconset/Contents.json index a396706..33ec0bc 100644 --- a/WhatsAppActivityDemo/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/WhatsAppActivityDemo/Images.xcassets/AppIcon.appiconset/Contents.json @@ -14,6 +14,11 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" } ], "info" : {