https://github.com/DamRsn/NeuralNote
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
public extension FileManager { | |
/// This method calculates the accumulated size of a directory on the volume in bytes. | |
/// | |
/// As there's no simple way to get this information from the file system it has to crawl the entire hierarchy, | |
/// accumulating the overall sum on the way. The resulting value is roughly equivalent with the amount of bytes | |
/// that would become available on the volume if the directory would be deleted. | |
/// | |
/// - note: There are a couple of oddities that are not taken into account (like symbolic links, meta data of | |
/// directories, hard links, ...). |
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 arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] | |
extension Array { | |
func splitBy(subSize: Int) -> [[Element]] { | |
return 0.stride(to: self.count, by: subSize).map { startIndex in | |
let endIndex = startIndex.advancedBy(subSize, limit: self.count) | |
return Array(self[startIndex ..< endIndex]) | |
} | |
} | |
} |
获取应用的 Bundle ID 方法:在 iTools 下,找到 app 名字命名的文件夹 xxx.app,找到 Info.plist,导出,Xcode 打开。
得到 Bundle ID 如:
com.tencent.mipadqq iPad 版 QQ 4.1
com.tencent.xin 微信 5.3.1.17
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
######################### | |
# .gitignore file for Xcode5 | |
# | |
# NB: if you are storing "built" products, this WILL NOT WORK, | |
# and you should use a different .gitignore (or none at all) | |
# This file is for SOURCE projects, where there are many extra | |
# files that we want to exclude | |
# | |
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# and https://gist.github.com/adamgit/3786883 |
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
@implementation XCDUUID | |
+ (void) load | |
{ | |
// query runtime if NSUUID class already exists, if so => done | |
if (objc_getClass("NSUUID")) | |
{ | |
return; | |
} | |