Skip to content

Instantly share code, notes, and snippets.

// MARK: - Menus
override func buildMenu(with builder: UIMenuBuilder) {
super.buildMenu(with: builder)
builder.insertChild(AppDelegate.fileMenu(), atStartOfMenu: .file)
builder.insertChild(AppDelegate.viewMenu(), atStartOfMenu: .view)
builder.remove(menu: .format)
builder.remove(menu: .toolbar)
builder.remove(menu: .help)
<html>
<head>
<style>
:root {
color-scheme: light dark;
}
body {
font-family: -apple-system;
font-size: 10pt;
@vtourraine
vtourraine / clean_booted_sim_status_bar
Last active November 20, 2019 11:51
Clean the iOS Simulator status bar for the currently booted simulator
xcrun simctl status_bar `xcrun simctl list devices | grep "Booted" | sed -e 's/.* (\(.*\)) (Booted.*/\1/'` override --time "9:41" --batteryState charged --batteryLevel 100 --cellularBars 4
@vtourraine
vtourraine / CloudsView.swift
Created August 23, 2018 08:37
View with clouds floating by.
//
// CloudsView.swift
//
// Swift 4.2
//
import UIKit
@available(iOS 10.0, *)
class CloudsView: UIView {
@vtourraine
vtourraine / NetworkManager.h
Created March 8, 2018 16:09
Test block as parameter with OCMock
//
// NetworkManager.h
//
@import Foundation;
@interface NetworkManager : NSObject
- (void)fetchDataCompletion:(void(^)(NSString *))completion;
- (void)GET:(NSString *)path completion:(void(^)(NSData *))completion;
@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
@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 / 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 / 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 / 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