Skip to content

Instantly share code, notes, and snippets.

View jagreenwood's full-sized avatar
💭
⛰️

Jeremy Greenwood jagreenwood

💭
⛰️
  • Mobelux
  • Richmond, VA
View GitHub Profile
@jagreenwood
jagreenwood / AppVersionBundle.md
Last active February 26, 2018 16:17
Version Settings Bundle

This Gist explains how to set up an Xcode proj to show the app version and the last six characters of the lastest git commit message.

  1. Add contents of SettingsAccess.swift to the Xcode project.
  2. Add a Settings bundle to the app, then configure Root.plist like displayed here.
  3. Add a Run Script build phase to the Xcode project. Copy the contents of CommitHash.sh to phase.

Keybase proof

I hereby claim:

  • I am jagreenwood on github.
  • I am jagreenwood (https://keybase.io/jagreenwood) on keybase.
  • I have a public key whose fingerprint is 398F 6329 D4DF 73D0 21DC 170C C05B 82FE 86F8 5070

To claim this, I am signing this object:

@jagreenwood
jagreenwood / GCD Timer.m
Last active March 15, 2019 19:38
GCD timer
static dispatch_source_t CreateDispatchTimer(uint64_t interval, uint64_t leeway, dispatch_queue_t queue, dispatch_block_t block) {
dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER,
0, 0, queue);
if (timer) {
dispatch_source_set_timer(timer, dispatch_walltime(NULL, 0), interval, leeway);
dispatch_source_set_event_handler(timer, block);
dispatch_resume(timer);
}
return timer;
}