-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8996002
commit 13742c2
Showing
6 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#import "FBPLinkCell.h" | ||
|
||
@interface FBPCashAppCell : FBPLinkCell { | ||
NSString *_cashTag; | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.