• 大小: 34.03MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-07-04
  • 语言: 其他
  • 标签:

资源简介

1 类似于美丽说,一款电商App,使用语言:Swift2.0,开发工具: Xcode 7.1; 2 你可能从其他渠道获得这个代码,但这一个是我亲自编译过的; 3 注意:如果用的是swift2以上的版本编译本代码,请注意XCdoe的biuld 里swift版本一项YES; 4 顺利即可一次通过,本代码对IOS开发App有极好的参考意义,且是swift的,代表了IOS开发的新趋势; 5 对分享本源码的程序表示敬意!

资源截图

代码片段和文件信息

//
// Created by Fabrice Aneche on 06/01/14.
// Copyright (c) 2014 Dailymotion. All rights reserved.
//

#import “NSData+ImageContentType.h“


@implementation NSData (ImageContentType)

+ (NSString *)sd_contentTypeForImageData:(NSData *)data {
    uint8_t c;
    [data getBytes:&c length:1];
    switch (c) {
        case 0xFF:
            return @“image/jpeg“;
        case 0x89:
            return @“image/png“;
        case 0x47:
            return @“image/gif“;
        case 0x49:
        case 0x4D:
            return @“image/tiff“;
        case 0x52:
            // R as RIFF for WEBP
            if ([data length] < 12) {
                return nil;
            }

            NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0 12)] encoding:NSASCIIStringEncoding];
            if ([testString hasPrefix:@“RIFF“] && [testString hasSuffix:@“WEBP“]) {
                return @“image/webp“;
            }

            return nil;
    }
    return nil;
}

@end


@implementation NSData (ImageContentTypeDeprecated)

+ (NSString *)contentTypeForImageData:(NSData *)data {
    return [self sd_contentTypeForImageData:data];
}

@end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         343  2016-11-20 00:31  关于代码.txt
     目录           0  2016-07-25 03:12  Swift-BanTang-master\
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\
     文件      101887  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\project.pbxproj
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\project.xcworkspace\
     文件         157  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\project.xcworkspace\contents.xcworkspacedata
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\project.xcworkspace\xcuserdata\
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\project.xcworkspace\xcuserdata\jiachenmu.xcuserdatad\
     文件       40854  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\project.xcworkspace\xcuserdata\jiachenmu.xcuserdatad\UserInterfaceState.xcuserstate
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\xcuserdata\
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\xcuserdata\jiachenmu.xcuserdatad\
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\xcuserdata\jiachenmu.xcuserdatad\xcdebugger\
     文件          91  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\xcuserdata\jiachenmu.xcuserdatad\xcdebugger\Breakpoints_v2.xcbkptlist
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\xcuserdata\jiachenmu.xcuserdatad\xcschemes\
     文件        4257  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\xcuserdata\jiachenmu.xcuserdatad\xcschemes\BeautifulDay.xcscheme
     文件         664  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcodeproj\xcuserdata\jiachenmu.xcuserdatad\xcschemes\xcschememanagement.plist
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcworkspace\
     文件         230  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcworkspace\contents.xcworkspacedata
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcworkspace\xcuserdata\
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcworkspace\xcuserdata\jiachenmu.xcuserdatad\
     文件      243456  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcworkspace\xcuserdata\jiachenmu.xcuserdatad\UserInterfaceState.xcuserstate
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcworkspace\xcuserdata\jiachenmu.xcuserdatad\xcdebugger\
     文件        2135  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay.xcworkspace\xcuserdata\jiachenmu.xcuserdatad\xcdebugger\Breakpoints_v2.xcbkptlist
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay\
     文件       21353  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay\1872
     文件       19022  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay\1898
     文件        8907  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay\AppDelegate.swift
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay\Assets.xcassets\
     目录           0  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay\Assets.xcassets\AppIcon.appiconset\
     文件        1163  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay\Assets.xcassets\AppIcon.appiconset\Contents.json
     文件          62  2016-07-25 03:12  Swift-BanTang-master\BeautifulDay\Assets.xcassets\Contents.json
............此处省略799个文件信息

评论

共有 条评论

相关资源