Giter Club home page Giter Club logo

ios-tips's People

Contributors

brookswon avatar cimain avatar halohily avatar kangzubin avatar lefex avatar mactive avatar notfound9 avatar soapyigu avatar southpeak avatar techtinyset avatar wang9262 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-tips's Issues

PHAsset 无法获取照片路径

获取相册图片信息时
-requestImageDataForAsset:options:resultHandler:

resultHandler 里面的 info 中不在包含 文件路径[捂脸]
即不在包含Key PHImageFileURLKey

iOS13 新提供的API 也没有返回文件路径
requestImageDataAndOrientationForAsset:options:resultHandler:

Adaptation for iOS 13 - [MPRemoteCommand add: target:] crash

Example:

- (void)playAction:(MPRemoteCommand *)sender {
    // do something
}

- (void)func {
    MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter];
    // crash here
    [commandCenter.playCommand addTarget:self action:@selector(playAction:)];
}

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unsupported action method signature. Must return MPRemoteCommandHandlerStatus or take a completion handler as the second argument.'

https://forums.developer.apple.com/thread/121540

Fix in iOS 13:

- (MPRemoteCommandHandlerStatus)playAction:(MPRemoteCommand *)sender {
    // do something
    return MPRemoteCommandHandlerStatusSuccess;
}

Subject: Crash

公司使用bugly来统计Crash,有些bug 无法解决,Sigxxx 等类型的bug

SwiftTips99选题

选自:swift-algorithm-club

public class RBTreeNode<T: Comparable>: Equatable {
}

类定义泛型和协议的使用

一点建议

这帮人整些没什么软用的东西。还以为好伟大。“知识小集”点子不错,初衷不错,内容太一般。

SwiftTips99选题

选自:swift-algorithm-club

public convenience init(key: T?) {
self.init(key: key, leftChild: RBNode(), rightChild: RBNode(), parent: RBNode())
}

初始化方法的使用(convenience)

Subject:iOS安全防护

iOS代码混淆 防反编译 防渗透等安全方面的实用方案 和实例.现在除了商业化的,貌似一些免费的在这方面的支持内容过旧和过少了比如ios-class-guard,PPiOS-Rename等

判断是否在主队列运行的另一种方式

在「10」的「9. 判断是否在主队列运行」中也可以用如下方法判断,对比 queuelabel

BOOL IsMainQueue() {
  return strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(dispatch_get_main_queue())) == 0;
}

自编译libobjc.A.dylib并做为依赖后,不调用libobjc.dylib?

来自 @姚七六

编译了libobjc.A.dylib库,然后创建一个debug的target依赖这个运行时库的target,然后在debug程序的代码中调用runtime方法就会调用自己编译的库里面的方法,这样来调试运行时库。问题是为什么没有调用系统libobjc.dylib库?是没有链接系统运行时库,还是系统运行时库被自己编译的这个库替换掉了?

2018目录编排中,问题位置的小错误

首先,感谢各位大神的分享,分享精神**!

2018年总目录下
有个 "利用 Custom event 解决一个小问题" 这个问题归为2月份,但是实际解答在1月份合集的倒数第二个,貌似是跟 "使用AVCaptureSession踩的一个坑" 的位置颠倒了.

不影响阅读,但是我有强迫症...😂

Subject: CloudKit

希望各位大牛们能介绍一些 CloudKit 使用技巧,非常感谢!

NSData 的 description 方法在 iOS 13 的一个小问题

微博网友 @钟冬V5 投稿,

问题:NSData 的 description 方法在 iOS 13之前可以把data转成string,iOS 13就不行了

解决方法

- (NSString *)hexadecimalString: (NSData *)data {
    const unsigned char *dataBuffer = (const unsigned char *)[data bytes];

    if (!dataBuffer) {
        return [NSString string];
    }

    NSUInteger dataLength  = [data length];
    NSMutableString *hexString  = [NSMutableString stringWithCapacity:(dataLength * 2)];

    for (int i = 0; i < dataLength; ++i) {
        [hexString appendFormat:@"%02x", (unsigned int)dataBuffer[i]];
    }

    return [NSString stringWithString:hexString];
}

NSRecursiveLock在Playground里还是死锁

let lock = NSRecursiveLock()
var recursiveMethod: ((Int) -> Void)! = nil

recursiveMethod = { value in

defer {
lock.unlock()
}

lock.lock()

guard value > 0 else {
return
}

print(value)
sleep(2)
recursiveMethod(value - 1)
}

DispatchQueue.global().async {

print("start")
recursiveMethod(5)
print("end")
}

Compatible for iOS 13 - UISegmentControl

There is now a selectedSegmentTintColor on UISegmentedControl. If you want to change the color of the selected segment, you should use selectedSegmentTintColor on iOS 13. setTintColor will not work.

eg:

 if #available(iOS 13.0, *) {
       segmentControl.selectedSegmentTintColor = UIColor.white
       segmentControl.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.black], for: .normal)
 } else {
        tabBar.tintColor = UIColor.white
 }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.