Instantly share code, notes, and snippets.

@markd2 /activity.m
Last active Feb 25, 2017

Embed
What would you like to do?
#import "ViewController.h"
#import <os/activity.h>
#import <os/log.h>
@interface ViewController ()
@end // extension
static os_activity_t g_appActivity;
@implementation ViewController
+ (void) load {
[super load];
} // load
- (void) viewDidLoad {
[super viewDidLoad];
// Tried putting these in +load too
g_appActivity = os_activity_create("appActivity",
OS_ACTIVITY_CURRENT,
OS_ACTIVITY_FLAG_DEFAULT);
assert(g_appActivity);
} // viewDidLoad
- (void) ook {
os_log(OS_LOG_DEFAULT, "I fall upon the thorns of life! I skin my knees!");
os_activity_label_useraction("knees");
os_trace("knees1");
NSLog(@"BORK");
assert(!"die");
} // ook
- (IBAction) thing1 {
os_activity_scope(g_appActivity);
os_activity_label_useraction("verb");
os_trace("verb1");
os_log(OS_LOG_DEFAULT, "I seem to be a verb");
} // thing1
- (IBAction) thing2 {
os_activity_scope(g_appActivity);
os_activity_label_useraction("pez");
os_trace("pez1");
os_log(OS_LOG_DEFAULT, "I smell like Pez");
[self ook];
} // thing2
@end // ViewController
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment