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
- (void)layoutSubviews { | |
[super layoutSubviews]; | |
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.shopLabel.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)]; | |
CAShapeLayer *shape = [CAShapeLayer new]; | |
[shape setPath:maskPath.CGPath]; | |
self.shopLabel.layer.mask = shape; | |
} |
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
override func awakeFromNib() { | |
super.awakeFromNib() | |
// Initialization code | |
let shapeLayer = CAShapeLayer() | |
shapeLayer.strokeColor = UIColor(rgb: 0xEEEEEE).cgColor | |
shapeLayer.lineWidth = 1 | |
// passing an array with the values [2,3] sets a dash pattern that alternates between a 2-user-space-unit-long painted segment and a 3-user-space-unit-long unpainted segment | |
shapeLayer.lineDashPattern = [2,3] |
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
if (@available(iOS 11, *)) { | |
// Use iOS 11 APIs. | |
} else { | |
// Alternative code for earlier versions of iOS. | |
} |
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
Application | |
Extensions | |
Categories | |
Utils | |
Controllers |
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 frame = self.view.frame; | |
frame.size.width = UIScreen.mainScreen.bounds.size.width; | |
self.view.frame = frame; | |
[self.view layoutIfNeeded]; | |
// 单元格自适应屏幕宽度 | |
CGRect frame = self.frame; | |
frame.size.width = UIScreen.mainScreen.bounds.size.width; | |
self.frame = frame; |
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
- 优化产品体验 | |
- 修复了一些问题 | |
https://www.liuniukeji.com | |
2019 Liuniu Inc |
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
// 监听通知 | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveCartDataChangedNotification:) name:@"CartDataChangedNotification" object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveAlipayResultNotification:) name:@"AlipayResultNotification" object:nil]; | |
- (void)dealloc { | |
[[NSNotificationCenter defaultCenter] removeObserver:self]; | |
} | |
/// 接收到购物车数据改变 |
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
UIScrollView *scrollView = UIScrollView.new; | |
for (UIView *view in [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(Test1VC.class) owner:self options:nil]) { | |
[scrollView addSubview:view]; | |
view.frame = CGRectMake(0, scrollView.contentSize.height, view.frame.size.width, view.frame.size.height); | |
scrollView.contentSize = CGSizeMake(view.frame.size.width, scrollView.contentSize.height + view.frame.size.height); | |
} | |
self.view = scrollView; |
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
- (void)upgrade { | |
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; | |
NSString *url = @"Api/PublicApi/getVersion"; | |
NSMutableDictionary *params = [NSMutableDictionary new]; | |
[[[LNNetWorkAPI alloc] initWithUrl:url parameters:params] startWithBlockSuccess:^(__kindof LCBaseRequest *request) { | |
[SVProgressHUD dismiss]; | |
id json = request.responseJSONObject; | |
if ([json[@"status"] integerValue] != 1) { |
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
[[SDWebImageManager sharedManager] loadImageWithURL:FullImageUrl(self.model.goods_gallery.firstObject.image_path) options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { | |
} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) { | |
}]; |
NewerOlder