南南唐语_个人页

个人头像照片 南南唐语
0
21
0

个人介绍

暂无个人介绍

擅长的技术

  • Java
  • 前端开发
获得更多能力
通用技术能力:

暂时未有相关通用技术能力~

云产品技术能力:

阿里云技能认证

详细说明
暂无更多信息

2019年12月

2019年11月

正在加载, 请稍后...
暂无更多信息
  • 提交了问题 2019-12-06

    CallKit来电隐藏到后台

  • 提交了问题 2019-12-06

    iOS的某些设备上未显示UILabel文本

  • 提交了问题 2019-12-04

    通过Xcode 11.2.1将iOS App登录与Facebook集成

  • 提交了问题 2019-12-04

    Swift IOS中月份和年份中两个NSData差异

  • 回答了问题 2019-12-04

    Swift IOS中月份和年份中两个NSData差异

    可以按照以下方式进行操作: let strStartDate = 'September 2019' let strEndDate = 'December 2019' //create date formatter let formatter = DateFormatter() formatter.dateFormat = 'MMMM yyyy' //convert string into date object guard let startDate = formatter.date(from: strStartDate) else { print('invalid start date') return } //convert string into date object guard let endDate = formatter.date(from: strEndDate) else { print('invalid end date time') return } //calculate the month from end date and that should not exceed the start date for month in 1...6 { if let dt = Calendar.current.date(byAdding: .month, value: -month, to: endDate) { if dt.compare(startDate) == .orderedAscending { break } print(formatter.string(from: dt!)) } } 这是一种方法: let monthsCount = Calendar.current.dateComponents([.month], from: start, to: end).month! - 1 guard monthsCount > 0 else { return [] } return (1...monthsCount).map { var monthYear = start monthYear.month! += $0 let date = Calendar.current.date(from: monthYear)! let formatter = DateFormatter() formatter.dateFormat = 'MMMM yyyy' return formatter.string(from: date) } } 您应该DateComponents只将月份和年份组成部分传入此方法。您可以从这样的DateComponents对象中获取仅包含月份和年份的对象Date:```Calendar.current.dateComponents([.month, .year], from: someDate)
    踩0 评论0
  • 提交了问题 2019-12-03

    在iOS 13中在图像上绘制文本?

  • 提交了问题 2019-12-03

    如何对数组中的日期进行分组?

  • 回答了问题 2019-12-03

    在iOS 13中在图像上绘制文本?

    在IOS 13 上工作:```_imgView.image = [self drawFront:[UIImage imageNamed:@'chain_image.jpeg'] text:@'SANKET VAGHELA' atPoint:CGPointMake(50, 50)]; 打开function``` -(UIImage*)drawFront:(UIImage*)image text:(NSString*)text atPoint: (CGPoint)point { UIFont *font = [UIFont systemFontOfSize:20]; UIGraphicsBeginImageContext(image.size); [image drawInRect:CGRectMake(0,0,image.size.width,image.size.height)]; CGRect rect = CGRectMake(point.x, (point.y - 5), image.size.width, image.size.height); [[UIColor whiteColor] set]; NSMutableAttributedString* attString = [[NSMutableAttributedString alloc] initWithString:text]; NSRange range = NSMakeRange(0, [attString length]); [attString addAttribute:NSFontAttributeName value:font range:range]; [attString addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:range]; NSShadow* shadow = [[NSShadow alloc] init]; shadow.shadowColor = [UIColor darkGrayColor]; shadow.shadowOffset = CGSizeMake(1.0f, 1.5f); [attString addAttribute:NSShadowAttributeName value:shadow range:range]; [attString drawInRect:CGRectIntegral(rect)]; UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return newImage; }
    踩0 评论0
  • 回答了问题 2019-12-03

    如何对数组中的日期进行分组?

    1:假设您有以下数据 2:使日期组```let dictGroupDate = Dictionary(grouping: arrDates) { (strdate) -> String in let df = DateFormatter() df.dateFormat = 'yyyy-MM-dd'T'HH:mm:ss.SSSZZZZ' let date = df.date(from: strdate) df.dateFormat = 'yyyy-MM-dd' return df.string(from: date!) } 3:获取所有节日期并对它们进行排序```let arrDateKey = Array(dictGroupDate.keys).sorted { (strdate1, strdate2) -> Bool in let df = DateFormatter() df.dateFormat = 'yyyy-MM-dd' let date1 = df.date(from: strdate1) let date2 = df.date(from: strdate2) return date1!.compare(date2!) == .orderedAscending } 4:为每个日期排序时间并创建新字典``` var newGroupedDates = String : [String] for strKey in arrDateKey { let sortedTime = dictGroupDate[strKey]?.sorted(by: { (strdate1, strdate2) -> Bool in let df = DateFormatter() df.dateFormat = 'yyyy-MM-dd'T'HH:mm:ss.SSSZZZZ' let date1 = df.date(from: strdate1) let date2 = df.date(from: strdate2) return date1!.compare(date2!) == .orderedAscending }) newGroupedDates[strKey] = sortedTime! } 5:显示数据 UITABLEVIEW```// NumberOfSections arrDateKey.count //NumberOfRows let key = arrDateKey[indexPath.section] newGroupedDates[key]?.count // CellForRow // To get correct date and Time let key = arrDateKey[indexPath.section] let item = newGroupedDates[key]![indexPath.row] // Now item is the date string, and do whatever you wanted to do. 我正在迅速进行中,希望您能在obj-c中进行管理 假设您有以下数据 let arrDates = [ '2019-12-03T05:58:11.317Z ', '2019-12-03T05:58:10.317Z ', '2019-12-03T05:58:01.317Z ', '2019-12-03T05:55:12.448Z ', '2019-12-03T05:48:11.317Z ', '2019-12-03T05:28:11.317Z ', '2019-12-03T05:11:24.004Z ', '2019-12-03T05:28:11.317Z ', '2019-12-03T05:55:12.965Z ', '2019-12-02T15:09:35.408Z ', '2019-12-02T15:09:38.187Z ', '2019-12-02T15:43:02.118Z ', '2019-12-02T15:44:09.344Z ', '2019-12-02T17:07:55.038Z ', '2019-12-02T16:42:16.649Z ', '2019-12-01T16:42:16.649Z '] 使日期组 let dictGroupDate = Dictionary(grouping: arrDates) { (strdate) -> String in let df = DateFormatter() df.dateFormat = 'yyyy-MM-dd'T'HH:mm:ss.SSSZZZZ' let date = df.date(from: strdate) df.dateFormat = 'yyyy-MM-dd' return df.string(from: date!) } 获取所有节日期并对它们进行排序 let arrDateKey = Array(dictGroupDate.keys).sorted { (strdate1, strdate2) -> Bool in let df = DateFormatter() df.dateFormat = 'yyyy-MM-dd' let date1 = df.date(from: strdate1) let date2 = df.date(from: strdate2) return date1!.compare(date2!) == .orderedAscending } 为每个日期排序时间并创建新字典 var newGroupedDates = String : [String] for strKey in arrDateKey { let sortedTime = dictGroupDate[strKey]?.sorted(by: { (strdate1, strdate2) -> Bool in let df = DateFormatter() df.dateFormat = 'yyyy-MM-dd'T'HH:mm:ss.SSSZZZZ' let date1 = df.date(from: strdate1) let date2 = df.date(from: strdate2) return date1!.compare(date2!) == .orderedAscending }) newGroupedDates[strKey] = sortedTime! } 显示数据 UITABLEVIEW // NumberOfSections arrDateKey.count //NumberOfRows let key = arrDateKey[indexPath.section] newGroupedDates[key]?.count // CellForRow // To get correct date and Time let key = arrDateKey[indexPath.section] let item = newGroupedDates[key]![indexPath.row] // Now item is the date string, and do whatever you wanted to do. 输出量 最后的newGroupedDate```['2019-12-03': ['2019-12-03T05:11:24.004Z ', '2019-12-03T05:28:11.317Z ', '2019-12-03T05:28:11.317Z ', '2019-12-03T05:48:11.317Z ', '2019-12-03T05:55:12.448Z ', '2019-12-03T05:55:12.965Z ', '2019-12-03T05:58:01.317Z ', '2019-12-03T05:58:10.317Z ', '2019-12-03T05:58:11.317Z '], '2019-12-02': ['2019-12-02T15:09:35.408Z ', '2019-12-02T15:09:38.187Z ', '2019-12-02T15:43:02.118Z ', '2019-12-02T15:44:09.344Z ', '2019-12-02T16:42:16.649Z ', '2019-12-02T17:07:55.038Z '], '2019-12-01': ['2019-12-01T16:42:16.649Z ']]
    踩0 评论0
  • 提交了问题 2019-12-02

    如何编写正则表达式过滤:{key:value}字符串

  • 提交了问题 2019-12-02

    长按键时如何在键盘上拓展上使用popview功能键?

  • 提交了问题 2019-12-02

    按下gps按钮后,如何获取用户位置

  • 提交了问题 2019-12-02

    C-枚举数组转换为NSrray

  • 提交了问题 2019-12-02

    如何提高读取UPC-A条码速度?

  • 提交了问题 2019-11-30

    在 CrashReporter中如何静态连接macOS?

  • 提交了问题 2019-11-30

    CAMetalLayer与NSView如何使用一起使用?

  • 提交了问题 2019-11-30

    NSManagedObjectContext不保存或获取不同于UIViewController自定类

  • 提交了问题 2019-11-30

    UICollectionView中的cellForItemAtIndexPath中无法获得正确类型

  • 提交了问题 2019-11-30

    如何在iOS React Native中修复NSNull类型的JSON值'<null>'转换问题

  • 回答了问题 2019-11-30

    NSManagedObjectContext不保存或获取不同于UIViewController自定类

    [context save:&error]在代码中正常工作得很好。这就是为什么错误为空的原因。问题仅在于你的逻辑落后:实际上保存成功时,你将转到“ false”分支。
    踩0 评论0
正在加载, 请稍后...
滑动查看更多
正在加载, 请稍后...
暂无更多信息