This file contains hidden or 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
| // | |
| // MNGCountryData.swift | |
| // | |
| // | |
| // Created by Tommie N. Carter, Jr., MBA on 2/4/16. | |
| // Copyright © 2016 MING Technology. All rights reserved. | |
| // | |
| import Foundation |
This file contains hidden or 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
| // | |
| // MNGContactsManager.swift | |
| // | |
| // | |
| // Created by Tommie N. Carter, Jr., MBA on 8/1/15. | |
| // Copyright © 2015 MING Technology. All rights reserved. | |
| // | |
| import UIKit | |
| import ContactsUI |
This file contains hidden or 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
| // | |
| // IO.swift | |
| // | |
| // | |
| // Created by Tommie N. Carter, Jr., MBA on 2/12/16. | |
| // Copyright © 2016 MING Technology. All rights reserved. | |
| // | |
| // Based on work of: | |
| // | |
| // Swift.IO |
This file contains hidden or 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
| // | |
| // ExceptionCatcher.h | |
| // | |
| #import <Foundation/Foundation.h> | |
| NS_INLINE NSException * _Nullable tryBlock(void(^_Nonnull tryBlock)(void)) { | |
| @try { | |
| tryBlock(); | |
| } |
This file contains hidden or 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
| extension NSInputStream { | |
| func read<T : Integer>() -> T? { | |
| var buffer : T = 0 | |
| let n = withUnsafePointer(&buffer) { (p) in | |
| self.read(UnsafePointer<UInt8>(p), maxLength: sizeof(T)) | |
| } | |
| if n > 0 { |
This file contains hidden or 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
| import Foundation | |
| let bufferSize = 1024*1024 | |
| enum Error: ErrorType { | |
| case UnknownArgument(String) | |
| case MissingValue(String) | |
| case MissingPassword | |
| case ShortWrite | |
| case ReadError(NSError?) |
This file contains hidden or 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
| // | |
| // JSON.swift | |
| // Swerver | |
| // | |
| // Created by Julius Parishy on 12/12/15. | |
| // Copyright © 2015 Julius Parishy. All rights reserved. | |
| // | |
| import Foundation |
This file contains hidden or 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
| import Foundation | |
| extension NSObject { | |
| var isPublicClass: Bool { | |
| return self.dynamicType.isPublicClass | |
| } | |
| class var isPublicClass: Bool { | |
| return _PUBLIC_IOS_CLASSES.contains(NSStringFromClass(self)) | |
| } |
This file contains hidden or 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
| // Given array of 2-tuples, return two arrays | |
| func unzip<T, U>(array: [(T, U)]) -> ([T], [U]) { | |
| var t = Array<T>() | |
| var u = Array<U>() | |
| for (a, b) in array { | |
| t.append(a) | |
| u.append(b) | |
| } | |
| return (t, u) | |
| } |
This file contains hidden or 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
| // | |
| // MNGStreamReaderWriter.swift | |
| // ths | |
| // | |
| // Created by Tommie N. Carter, Jr., MBA on 2/14/16. | |
| // Copyright © 2016 MING Technology. All rights reserved. | |
| // | |
| import Foundation | |
| import Darwin.Mach.mach_time |