Skip to content

Instantly share code, notes, and snippets.

View JonnyBeeGod's full-sized avatar

Jonas Reichert JonnyBeeGod

View GitHub Profile
@JonnyBeeGod
JonnyBeeGod / CountdownTests.swift
Created December 25, 2019 06:41
This code allows for testing UNNotificationCenter and UNNotificationSettings
func testNotifications() {
// map all authorizationStatus with expected Result
let authorizationStatusMap: [UNAuthorizationStatus: Int] = [.authorized: 1, .denied: 0, .notDetermined: 0, .provisional: 1]
UNNotificationSettings.swizzleAuthorizationStatus()
authorizationStatusMap.forEach { (key: UNAuthorizationStatus, value: Int) in
UNNotificationSettings.fakeAuthorizationStatus = key
let mockCenter = UserNotificationCenterMock()
let mockCoder = MockNSCoder()
@JonnyBeeGod
JonnyBeeGod / icons-generator.sh
Last active September 16, 2018 06:57 — forked from beny/icons-generator.sh
Icon sizes generator for iOS/watchOS/iMessage apps.
#!/bin/bash
# Sizes from https://developer.apple.com/library/ios/#qa/qa1686/_index.html
# Requirements: ImageMagick
function resize {
GREEN='\033[0;32m'
BLUE='\033[0;34m'
DEFAULT='\033[0m'
echo -e "Generating ${BLUE}$3${DEFAULT} at size ${GREEN}$2 ${DEFAULT}"
convert $1 -resize $2 $3