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
@interface ArchivesEasy: NSObject <NSCoding> | |
@end | |
@implementation ArchivesEasy | |
-(id)initWithCoder:(NSCoder *)aDecoder | |
{ | |
if (self = [super init]) { | |
[self enumeratePropertiesWithBlock:^(NSString *key, id value) { | |
[self setValue:[aDecoder decodeObjectForKey:key] forKey:key]; |
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
#define GET_MACRO(_1, _2, _3, _4, NAME, ...) NAME | |
#define FOR_EACH_1(_what_, _separator_, X) _what_(X) | |
#define FOR_EACH_2(_what_, _separator_, X, ...) _what_(X) _separator_ FOR_EACH_1(_what_, _separator_, __VA_ARGS__) | |
#define FOR_EACH_3(_what_, _separator_, X, ...) _what_(X) _separator_ FOR_EACH_2(_what_, _separator_, __VA_ARGS__) | |
#define FOR_EACH_4(_what_, _separator_, X, ...) _what_(X) _separator_ FOR_EACH_3(_what_, _separator_, __VA_ARGS__) | |
#define FOR_EACH_SEP(_action_, _separator_, ...) GET_MACRO(__VA_ARGS__, FOR_EACH_4, FOR_EACH_3, FOR_EACH_2, FOR_EACH_1)(_action_, _separator_, __VA_ARGS__) | |
#define FOR_EACH(_action_, ...) FOR_EACH_SEP(_action_, ;, __VA_ARGS__) |
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
tell application "Xcode" | |
set workspaceFile to file of active workspace document | |
tell active workspace document | |
set res to (clean it) | |
repeat | |
if completed of res is true then | |
exit repeat | |
end if | |
delay 1.0 | |
end repeat |
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 Combine | |
private let docsDirURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! | |
@propertyWrapper | |
struct Persisted<Value: Codable> { | |
let fileName: String | |
let defaultValue: Value |
OlderNewer