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
NSString *language = [[NSLocale preferredLanguages] firstObject]; | |
NSString *languageCode = [language componentsSeparatedByString:@"-"].firstObject; |
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
NSString *url = @"/shopUpdate/aliPay/aliAppPay.do"; | |
NSMutableDictionary *params = [NSMutableDictionary new]; | |
params[@"total_amount"] = self.amount; | |
params[@"out_trade_no"] = self.orderNo; | |
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; | |
AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:configuration]; | |
manager.responseSerializer = [AFHTTPResponseSerializer serializer]; | |
[SVProgressHUD show]; |
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)chatWithQQ:(NSString *)qq { | |
if (!qq.length) { | |
[SVProgressHUD showInfoWithStatus:@"QQ号码不存在"]; | |
return; | |
} | |
if (![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"mqq://"]]) { | |
[SVProgressHUD showInfoWithStatus:@"您尚未安装QQ应用"]; | |
return; | |
} | |
NSString *url = [NSString stringWithFormat:@"mqq://im/chat?chat_type=wpa&uin=%@&version=1&src_type=web", qq]; |
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
// | |
// StudyHelpDetailVC.m | |
// LNMobileProject | |
// | |
// Created by Liu Cheng on 2019/7/10. | |
// | |
#import "StudyHelpDetailVC.h" | |
#import <WebKit/WebKit.h> |
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
/// 导航返回时跳过的控制器数目 | |
@property (assign, nonatomic) NSInteger navSkipCount; | |
- (BOOL)navigationShouldPopOnBackButton { | |
NSArray *navStack = self.navigationController.viewControllers; | |
[self.navigationController popToViewController:navStack[navStack.count - 2 - self.navSkipCount] animated:YES]; | |
return NO; | |
} |
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 "TTTAttributedLabel.h" | |
@interface StudyServiceVC () <TTTAttributedLabelDelegate> | |
@property (weak, nonatomic) IBOutlet TTTAttributedLabel *labelTip; | |
self.labelTip.linkAttributes = @{NSForegroundColorAttributeName:HEXCOLOR(0x22CB91), NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle)}; | |
self.labelTip.enabledTextCheckingTypes = NSTextCheckingTypeLink; | |
self.labelTip.delegate = self; | |
self.labelTip.text = @"如果服务地址有误,请通过意见反馈发给我们,方便我们修改!"; |
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
@interface PostLoanVC () <HXPhotoViewDelegate> | |
@property (weak, nonatomic) IBOutlet HXPhotoView *photoView; | |
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintPhotoViewHeight; | |
self.photoView.addImageName = @"detail_button_add"; | |
self.photoView.lineCount = 5; | |
self.photoView.delegate = self; | |
self.photoView.manager.configuration.restoreNavigationBar = YES; | |
self.photoView.manager.configuration.albumShowMode = HXPhotoAlbumShowModePopup; |
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 "HXPhotoPicker.h" | |
@property (strong, nonatomic) HXPhotoManager *manager; | |
- (HXPhotoManager *)manager { | |
if (!_manager) { | |
_manager = [[HXPhotoManager alloc] initWithType:HXPhotoManagerSelectedTypePhoto]; | |
_manager.configuration.restoreNavigationBar = YES; | |
_manager.configuration.albumShowMode = HXPhotoAlbumShowModePopup; |
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 "WZLBadgeImport.h" | |
- (void)viewDidAppear:(BOOL)animated { | |
[super viewDidAppear:animated]; | |
self.messageButtonItem.badgeCenterOffset = CGPointMake(-10, 5); | |
self.messageButtonItem.badgeFont = [UIFont systemFontOfSize:12]; | |
self.messageButtonItem.badgeBgColor = HEXCOLOR(0xFF7159); | |
self.messageButtonItem.badgeTextColor = HEXCOLOR(0xFFFFFF); | |
[self.messageButtonItem showBadgeWithStyle:WBadgeStyleNumber value:333 animationType:WBadgeAnimTypeNone]; |
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 <Reachability.h> | |
@property (strong, nonatomic) Reachability *internetReachableFoo; | |
// Checks if we have an internet connection or not | |
- (void)testInternetConnection | |
{ | |
self.internetReachableFoo = [Reachability reachabilityWithHostname:@"www.bing.com"]; | |
// Internet is reachable |