iOS SDK 开发整理

iOS SDK基础

What?

SDK 开发就是写一堆代码,然后将这些代码打包成一个二进制文件,配合头文件和资源文件,给到别人直接使用。

Why?

  • 对外输出 SDK

如OCR技术、面部识别、声纹识别等功能含有大量专利、商业机密代码,需要打包、混淆后才能提供给外部集成。

  • 内部组件化

依赖管理、加速编译。

- 阅读剩余部分 -

Cocoapods 私有化踩坑

整理完记录下来。

各种文件路径错误

- ERROR | [iOS] file patterns: The `vendored_libraries` pattern did not match any file.

- ERROR | [iOS] file patterns: The `vendored_frameworks` pattern did not match any file.

- ERROR | [iOS] file patterns: The `resources` pattern did not match any file.

...

- 阅读剩余部分 -

来张渐变色的圆角图吧

可以控制垂直或者水平方向渐变, 其实给角度也可以, 先放着吧.

UIImage+LinearGradientColor.h

+ (UIImage *)as_imageWithLinearGradientColors:(NSArray *)colors;
+ (UIImage *)as_imageWithLinearGradientColors:(NSArray *)colors vertical:(BOOL)vertical;
+ (UIImage *)as_imageWithLinearGradientColors:(NSArray *)colors size:(CGSize)size;
+ (UIImage *)as_imageWithLinearGradientColors:(NSArray *)colors postions:(NSArray *)positions size:(CGSize)size;
+ (UIImage *)as_imageWithLinearGradientColors:(NSArray *)colors size:(CGSize)size vertical:(BOOL)vertical;
+ (UIImage *)as_imageWithLinearGradientColors:(NSArray *)colors postions:(NSArray *)positions size:(CGSize)size vertical:(BOOL)vertical;
+ (UIImage *)as_imageWithLinearGradientColors:(NSArray *)colors postions:(NSArray *)positions size:(CGSize)size vertical:(BOOL)vertical cornerRadius:(CGFloat)cornerRadius borderColor:(UIColor *)borderColor borderWidth:(CGFloat)borderWidth corners:(UIRectCorner)corners;

- 阅读剩余部分 -

TRON iOS Objective-C address generate

Related Document: TRON公链概览

引用文件来源于这里: PocketEOS-IOS

Secrect Key Generation:

#import <Security/Security.h>
#import "NSObject+Extension.h"
#import "sha3.h"

#include "libbase58.h"
#include "sha2.h"
#include "uECC.h"

...

int length = 32;
uint8_t randomBytes[length];
int randomResult = SecRandomCopyBytes(kSecRandomDefault, length, randomBytes);
if(randomResult == 0) {
    NSMutableString *randomSecrect =
    [[NSMutableString alloc] initWithCapacity:length * 2];

    for(NSInteger index = 0; index < length; index++){
        [randomSecrect appendFormat:@"%02x", randomBytes[index]];
    }

}

- 阅读剩余部分 -