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
#import <XCTest/XCTest.h> | |
#import "Files.h" | |
@interface Files_Tests : XCTestCase | |
{ | |
NSString *testFileName; | |
} | |
@end | |
@implementation Files_Tests |
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
import Foundation | |
import UIKit | |
public extension String { | |
func urlEncode() -> String? { | |
return self.addingPercentEncoding(withAllowedCharacters: CharacterSet(charactersIn: "!*'();:@&=+$,/?%#[]{} ").inverted) | |
} | |
func urlDecode() -> String? { | |
return self.removingPercentEncoding |
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
#import <Foundation/Foundation.h> | |
NS_ASSUME_NONNULL_BEGIN | |
@interface NSString (Extensions) | |
- (NSString *)urlEncode; | |
- (NSString *)urlDecode; | |
@end | |
NS_ASSUME_NONNULL_END |
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
#import "NSObject+Extensions.h" | |
#import <objc/runtime.h> | |
@implementation NSObject (Extensions) | |
- (void)tickWithName:(NSString *)name { | |
NSDate *startDate = objc_getAssociatedObject(self, CFBridgingRetain(name)); | |
if (startDate) { | |
NSLog(@"Tick (%@): nil", name); | |
return; |