Skip to content

Instantly share code, notes, and snippets.

/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
@vtourraine
vtourraine / merge-ochamcrest.sh
Created December 8, 2011 16:44
Copy OCHamcrest headers into a single folder in order to use it as a framework with the static library
mkdir -p OCHamcrest
cp -f ../OCHamcrest/Source/OCHamcrest.h OCHamcrest/;
find ../OCHamcrest/Source/Core/ -type f -name '*.h' -exec cp -f {} OCHamcrest/ \;
find ../OCHamcrest/Source/Library/ -type f -name '*.h' -exec cp -f {} OCHamcrest/ \;
+ (void)customizeAppearance
{
UIColor *lightColor = [UIColor lightGrayColor];
UIColor *darkColor = [UIColor darkGrayColor];
// Navigation bar
UIGraphicsBeginImageContext(CGSizeMake(1, 1));
UIBezierPath *rectBezierPath = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 1, 1)];
[lightColor setFill];
[rectBezierPath fill];
@vtourraine
vtourraine / DashboardViewController.swift
Created February 17, 2016 10:20
ResearchKit dashboard controller with activity completion pie chart
//
// DashboardViewController.swift
// MyStudyApp
//
// Created by Vincent Tourraine on 2/16/16.
// Copyright © 2016 Shazino. All rights reserved.
//
import UIKit
import ResearchKit
@vtourraine
vtourraine / MedicationController.swift
Created February 23, 2016 11:00
AppCore / Medication
let vc = APCMedicationTrackerCalendarViewController(nibName: "APCMedicationTrackerCalendarViewController", bundle: NSBundle(identifier: "org.researchkit.APCAppCore"))
vc.step = ORKStep(identifier: "medstep")
let navController = UINavigationController(rootViewController: vc)
navController.navigationBar.translucent = false
// window().rootViewController?.presentViewController(navController, animated: true, completion: nil)
@vtourraine
vtourraine / ActivitiesViewController.swift
Created February 25, 2016 15:40
ResearchKit activities controller managing a survey.
//
// ActivitiesViewController.swift
// MyStudyApp
//
// Created by Vincent Tourraine on 2/8/16.
// Copyright © 2016 Shazino. All rights reserved.
//
import UIKit
import ResearchKit
@vtourraine
vtourraine / Interface.storyboard
Created March 8, 2016 21:12
Games Keeper for Apple Watch
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="AgC-eL-Hgc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="9515"/>
</dependencies>
<scenes>
<!--Games-->
<scene sceneID="aou-V4-d1y">
<objects>
@vtourraine
vtourraine / OnboardingViewController.swift
Created March 23, 2016 12:51
ResearchKit onboarding controller managing consent.
//
// OnboardingViewController.swift
// MyStudyApp
//
// Created by Vincent Tourraine on 2/8/16.
// Copyright © 2016 Shazino. All rights reserved.
//
import UIKit
import ResearchKit
@vtourraine
vtourraine / keybase.md
Created April 6, 2016 21:08
Keybase verification

Keybase proof

I hereby claim:

  • I am vtourraine on github.
  • I am vtourraine (https://keybase.io/vtourraine) on keybase.
  • I have a public key whose fingerprint is 700B 4ED7 8DA6 260B E442 FF05 EF05 AC72 1024 1BA4

To claim this, I am signing this object:

@vtourraine
vtourraine / sync_versions.sh
Last active February 16, 2018 12:37
Run Script: Sync Version and Build Numbers
PLISTBUDDY="/usr/libexec/PlistBuddy"
MAIN_APP_PLIST_PATH="###/Info.plist"
EXTENSIONS_PLIST_PATHS=("###/Info.plist" "###/Info.plist")
BUNDLEVERSION=`${PLISTBUDDY} -c "Print :CFBundleVersion" "$MAIN_APP_PLIST_PATH"`
BUNDLEVERSIONSTRING=`${PLISTBUDDY} -c "Print :CFBundleShortVersionString" "$MAIN_APP_PLIST_PATH"`
for EXTENSIONS_PLIST_PATH in "${EXTENSIONS_PLIST_PATHS[@]}"
do