Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
int count = 0;
BOOL isDark = NO;
void (^updateUI)(void) = ^{
NSLog(@"Counter: %d", count);
NSLog(@"Theme: %@", isDark ? @"Dark" : @"Light");
};
void (^increment)(void) = ^{ count++; updateUI(); };
void (^decrement)(void) = ^{ count--; updateUI(); };
void (^reset)(void) = ^{ count = 0; updateUI(); };
void (^toggleTheme)(void) = ^{ isDark = !isDark; updateUI(); };
// Simulate actions
updateUI();
increment();
increment();
toggleTheme();
decrement();
reset();
}
return 0;
}Coding works best on desktop or with an external keyboard.