Skip to content

Commit

Permalink
Added Cash App cell
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobcxdev committed Mar 9, 2020
1 parent 8996002 commit 13742c2
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: com.jacobcxdev.fbspnosor
Name: FBSpNOsor
Depends: mobilesubstrate
Version: 1.2.1
Version: 1.2.2
Architecture: iphoneos-arm
Description: A tweak to remove sponsored and suggested posts, videos, etc. from Facebook.
Maintainer: JacobCXDev
Expand Down
6 changes: 6 additions & 0 deletions fbspnosorpreferences/FBPCashAppCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#import "FBPLinkCell.h"

@interface FBPCashAppCell : FBPLinkCell {
NSString *_cashTag;
}
@end
23 changes: 23 additions & 0 deletions fbspnosorpreferences/FBPCashAppCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#import "FBPCashAppCell.h"

@implementation FBPCashAppCell
+ (NSURL *)cashAppURLForUsername:(NSString *)cashTag {
cashTag = [cashTag stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
return [NSURL URLWithString:[@"https://cash.app/" stringByAppendingString:cashTag]];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
if (!specifier.properties[@"avatarImageSystemName"]) specifier.properties[@"avatarImageSystemName"] = @"dollarsign.circle.fill";
if (!specifier.properties[@"accessoryImageSystemName"]) specifier.properties[@"accessoryImageSystemName"] = @"link.circle";
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];
if (self) {
_cashTag = specifier.properties[@"cashTag"];
if (!_cashTag) return self;
self.detailTextLabel.text = [@"cash.app/" stringByAppendingString:_cashTag];
_avatarURL = [NSURL URLWithString:@"https://is1-ssl.mzstatic.com/image/thumb/Purple114/v4/88/54/42/88544217-121a-cc19-8db6-5c0da87095e1/AppIcon-0-1x_U007emarketing-0-0-GLES2_U002c0-512MB-sRGB-0-0-0-85-220-0-0-0-7.png/87x0w.png"];
_linkURL = [self.class cashAppURLForUsername:_cashTag];
[self setCellEnabled:true];
[self loadAvatarIfNeeded];
}
return self;
}
@end
12 changes: 11 additions & 1 deletion fbspnosorpreferences/Resources/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,22 @@
<key>cellClass</key>
<string>FBPPayPalCell</string>
<key>label</key>
<string>Donate to me :)</string>
<string>Donate to me via PayPal</string>
<key>username</key>
<string>jacobcxdev</string>
<key>shouldDisplayAvatar</key>
<true/>
</dict>
<dict>
<key>cellClass</key>
<string>FBPCashAppCell</string>
<key>label</key>
<string>Donate to me via CashApp</string>
<key>cashTag</key>
<string>£JacobCXDev</string>
<key>shouldDisplayAvatar</key>
<true/>
</dict>
<dict>
<key>cellClass</key>
<string>FBPMailCell</string>
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 13742c2

Please sign in to comment.