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
- (NSAttributedString *)bounusString:(NSString *)bounusText | |
{ | |
NSMutableAttributedString *msg = [[NSMutableAttributedString alloc] init]; | |
UIFont *textFont = [UIFont fontWithName:@"Roboto-Regular" size:13]; | |
NSTextAttachment *dimondAttachment = [[NSTextAttachment alloc] init]; | |
dimondAttachment.image = [UIImage imageNamed:@"ico_dimond"]; | |
dimondAttachment.bounds = CGRectMake(0, 0, 13, 13); | |
NSAttributedString *dimondatrri = [NSAttributedString attributedStringWithAttachment:dimondAttachment]; | |
[msg appendAttributedString:dimondatrri]; |
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
# 增大点击区域 | |
pod 'TouchAreaInsets', '1.1.0' | |
# popup tips 弹出黄色箭头提示 | |
pod 'CMPopTipView', '2.3.2' |
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
#import <UIKit/UIKit.h> | |
NS_ASSUME_NONNULL_BEGIN | |
//渐变蒙层 | |
@interface HTVGradientLayer : UIView | |
@end | |
NS_ASSUME_NONNULL_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
[self.KVOController observe:self.xxxx keyPath:FBKVOKeyPath(((UITableView *)_chatView).contentSize) options:NSKeyValueObservingOptionNew block:^(id _Nullable observer, id _Nonnull object, NSDictionary<NSString *,id> * _Nonnull change) { | |
UITableView *xxxx1 = (UITableView *)object; | |
CGFloat heightT = xxxx1.contentSize.height; | |
CGFloat maxHeight = 200; | |
if (heightT > maxHeight) { | |
heightT = maxHeight; | |
} | |
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
git cherry-pick |
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
CGRect rect = self.bounds; | |
// Create the path | |
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:rect | |
byRoundingCorners:corners | |
cornerRadii:CGSizeMake(radius, radius)]; | |
// Create the shape layer and set its path | |
CAShapeLayer *maskLayer = [CAShapeLayer layer]; | |
maskLayer.frame = rect; |
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
// 指安装最新 指定安装源 | |
$ sudo gem install cocoapods --source http://rubygems.org | |
// 指定版本安装 指定安装源 | |
$ sudo gem install cocoapods --source http://rubygems.org -v 1.5.3 | |
查看pod版本 | |
pod --version | |
查看有哪个pod | |
gem list pod |
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
// create | |
- (NSInvocation*)createInvocationWithSelector:(SEL)selector { | |
NSMethodSignature *signature = [self methodSignatureForSelector:selector]; | |
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; | |
invocation.target = self; | |
invocation.selector = selector; | |
return invocation; | |
} | |
//invoke |
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
- (NSInteger)methodSync { | |
NSLog(@"methodSync Begin"); | |
__block NSInteger result = 0; | |
//使用信号量dispatch_semaphore | |
dispatch_semaphore_t sema = dispatch_semaphore_create(0); | |
[self methodAsync:^(NSInteger value) { | |
result = value; | |
dispatch_semaphore_signal(sema); | |
}]; |
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
//反射调用 | |
Class <#your class#> = NSClassFromString(<#your class#>); | |
id <#instance#>= [[<#your class#> alloc] init]; | |
SEL selector = NSSelectorFromString(<#CallFunc#>); | |
[<#instance#> performSelector:selector withObject:nil]; |
OlderNewer