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 showCouponAlertView]; | |
#pragma mark- 优惠弹框 | |
- (void)showCouponAlertView { | |
UIView *contentView = [[UIView alloc] initWithFrame:CGRectZero]; | |
contentView.backgroundColor = UIColorRed; |
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)setupUI { | |
UIView *lastOne = nil; | |
NSInteger count = 16; | |
for (NSInteger i = 0; i < count; i++) { | |
SYPersonGraphOneManView *one = [[SYPersonGraphOneManView alloc] init]; |
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.jianshu.com/p/5c3883bdfd7e | |
let startLabel = UICreateTools.createLabel(frame: .zero, text: "string_start".localization, font: UIFont.mainFont(size: 12, weight: .heavy), textColor: .white, alignment: .right) | |
// startLabel.addBorder(1, color: UIColor(red: 62, green: 0, blue: 255)) | |
self.view.addSubview(startLabel) | |
startLabel.snp.makeConstraints { make in | |
make.centerY.equalTo(startDate24Button) | |
make.trailing.equalTo(startDate24Button.snp.leading).offset(-4) | |
} | |
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
------------------------------------------------------- | |
// push receive 情况 | |
if topVC is LiveShowDetailController && LiveShowService.shared.currentChannel?.host.id == AuthAccount.current?.id{ | |
canDisplay = false | |
} | |
if topVC is MainTabViewController { | |
if let child = UIApplication.getChildViewController(parent: topVC), child is LiveShowDetailController { |
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
let layer = CAGradientLayer() | |
layer.frame = self.tabBarBottomView.bounds | |
layer.startPoint = CGPoint.zero | |
layer.endPoint = CGPoint(x: 0, y: 1) | |
layer.colors = [UIColor(red: 78, green: 78, blue: 78, transparency: 0).cgColor, UIColor(red: 0, green: 0, blue: 0, transparency: 0.5).cgColor] | |
self.tabBarBottomView.layer.addSublayer(layer) |
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
//这个以 utc +0000 | |
服务器是 utc 0 的时间 | |
config的配置信息里也是 utc 0 时间(关键这里是计算出来的,当前时间零点+start) | |
所以此刻,所有人的倒计时都应该是一样的 |
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://juejin.cn/post/6844904007769522183 | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
lottieView.frame = CGRect(x: 0, y: 0, width: 400, height: 400) | |
lottieView.center = self.view.center | |
lottieView.animation = Animation.named(“lottieJson“)//绑定Lottie动画 | |
lottieView.loopMode = .loop//动画效果 执行单次、多次 | |
lottieView.contentMode = .scaleAspectFit |
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
// iOS App如何清除badge并保留通知中心的消息 | |
//https://medium.com/@jasonyuh/ios-app%E5%A6%82%E4%BD%95%E6%B8%85%E9%99%A4badge%E5%B9%B6%E4%BF%9D%E7%95%99%E9%80%9A%E7%9F%A5%E4%B8%AD%E5%BF%83%E7%9A%84%E6%B6%88%E6%81%AF-e4d9f35f9ef5 | |
//https://www.jianshu.com/p/59878fd8053c | |
func applicationDidBecomeActive(_ application: UIApplication) { | |
// MARK: 角标重置 | |
application.applicationIconBadgeNumber = -1 | |
// MARK: 移除所有远程通知 |
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
let descString = "delete_account_check_des".localization as NSString | |
let range = descString.range(of: "DELETE") | |
let attributes = NSMutableAttributedString(string: descString as String) | |
attributes.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(red: 255, green: 0, blue: 8), range: range) | |
deleteTyptDescLable.attributedText = attributes |
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://juejin.cn/post/6844904142045970445#heading-2 | |
func notificationAuthorization() { | |
let camera = AVCaptureDevice.authorizationStatus(for: .video) | |
if camera == .notDetermined { | |
return | |
} | |
let location = CLLocationManager.authorizationStatus() | |
if location == .notDetermined { |
NewerOlder