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
// | |
// OCXML.swift | |
// Created by Marco Arment on 9/23/24. | |
// | |
// Released into the public domain. Do whatever you'd like with this. | |
// No guarantees that it'll do anything, or do it correctly. Good luck! | |
// | |
import Foundation |
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
#import <objc/runtime.h> | |
@interface DebuggingOverlay: NSObject | |
@end | |
@implementation DebuggingOverlay | |
+ (void)toggleOverlay { | |
id debugInfoClass = NSClassFromString(@"UIDebuggingInformationOverlay"); |
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
- (void)drawTextInRect:(CGRect)rect | |
{ | |
[super drawTextInRect:rect]; | |
CGContextRef ctx = UIGraphicsGetCurrentContext(); | |
NSString *fontName = self.font.fontName; | |
CGFloat fontSize = self.font.pointSize; | |
CTFontRef font = CTFontCreateWithName((__bridge CFStringRef)fontName, fontSize, NULL); |