This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *const PSPDFApplicationDidReceiveMemoryWarningNotification = @"PSPDFApplicationDidReceiveMemoryWarningNotification"; | |
// Test with sudo memory_pressure -l critical. Don't forget to re-set afterwards! | |
__attribute__((constructor)) static void PSPDFInstallLowMemoryNotificationWarningMac(void) { | |
static dispatch_source_t source; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_WARN|DISPATCH_MEMORYPRESSURE_CRITICAL, dispatch_get_main_queue()); | |
dispatch_source_set_event_handler(source, ^{ | |
dispatch_source_memorypressure_flags_t pressureLevel = dispatch_source_get_data(source); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original Source: http://www.tuicool.com/articles/jMF773 | |
# Another Source: https://groups.google.com/forum/#!topic/cocoaheadsau/FE5rr30ydBY | |
xcodebuild -showBuildSettings | \ | |
sed -e '1d;s/^[ ]*/export /;s/ = \([^"].*\)/="\1"/;s/ = /=/;s/export UID.*//' > /tmp/xcodebuild-var.tmp | |
source /tmp/xcodebuild-var.tmp | |
rm /tmp/xcodebuild-var.tmp | |
# Example Usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AsyncOperation.swift | |
// TopoLock | |
// | |
// Created by VonCannon Tech, Inc. on 8/13/23. | |
// | |
import Foundation | |
//Originally taken fromm: https://gist.github.com/Sorix/57bc3295dc001434fe08acbb053ed2bc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSManagedObjectContext+Extensions.swift | |
// Topo Lock Maps | |
// | |
// Created by VonCannon Technology, Inc. on 12/8/23. | |
// | |
import Foundation | |
import UIKit | |
import CoreData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MainMapLibreViewRepresentation.swift | |
// Topo Lock Maps | |
// | |
// Created by VonCannon Technology, Inc. on 6/20/23. | |
// | |
import SwiftUI | |
import Foundation | |
import Mapbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MapLibreCoordinator.swift | |
// Topo Lock Maps | |
// | |
// Created by VonCannon Technology, Inc. on 9/19/23. | |
// | |
import Foundation | |
import SwiftUI | |
import Mapbox |