Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Thunor's full-sized avatar

Eric Freitas Thunor

View GitHub Profile
@mbinna
mbinna / podforceupdate.sh
Created December 4, 2012 09:43
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active March 10, 2024 19:23
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
@mkuliszkiewicz
mkuliszkiewicz / UIView+GetColor.swift
Last active May 28, 2023 13:22
UIView extension which allows to get colour of any point inside
//
// UIView+GetColor.swift
// SwiftPick
//
// Created by Maciej Banasiewicz, Michał Apanowicz on 06/07/14.
//
//
import UIKit
import SwiftUI
import os
@main
struct ios14DemoApp: App {
@StateObject var notificationCenter = NotificationCenter()
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate
var body: some Scene {
WindowGroup {
@kosso
kosso / background_demo.js
Created March 12, 2011 17:55
Background Service notification for Titanium
/* Kosso : March 12th 2011
This the only way I managed to do this without the app crashing on resume.
Done slightly differently to the KS example, since they unregister the service and
do not use a setInterval timer.
*/
//############ in app.js :
// test for iOS 4+
@hjerpbakk
hjerpbakk / TimePicker24HRenderer.cs
Last active June 15, 2017 16:51
Custom renderer for Xamarin.Forms TimePicker on iOS. This will make the TimePicker always show time using 24H format (aka no AM or PM).
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using PersonalTrainer.iOS.View.Controls;
[assembly: ExportRenderer (typeof (TimePicker), typeof (TimePicker24HRenderer))]
namespace YourNamespace.iOS.View.Controls {
public class TimePicker24HRenderer : TimePickerRenderer {