Skip to content

Instantly share code, notes, and snippets.

View 0xstragner's full-sized avatar
👾

Adam Stragner 0xstragner

👾
View GitHub Profile
@0xstragner
0xstragner / UIButton+SUI.m
Created March 11, 2024 21:35
Trigger UIMenu programmatically
//
// Created by Anton Spivak
//
#import "UIButton+SUI.h"
@import Objective;
@import ObjectiveC.runtime;
@import ObjectiveC.message;
@0xstragner
0xstragner / gist:d1537ba5357af1dab57832f80c0cd1fd
Last active August 26, 2023 20:51
An example of an iOS application's content switching
#!/bin/sh
WORKING_DIRECTORY="${PWD}/.motch"
BUILDED_IPA_PATH="${TARGET_IPA_PATH}"
EMBEDDED_IPA_PATH="${PWD}/Artifacts/Embedded.ipa"
EMBEDDED_CONTENTS_PATH="${WORKING_DIRECTORY}/embedded"
rm -rf "${WORKING_DIRECTORY}" || true
@0xstragner
0xstragner / UISheetPresentationController_3.m
Last active October 20, 2022 15:39
Medium/UISheetPresentationController/3.m
typedef NSString *SASheetPresentationControllerDetendIdentifier NS_TYPED_EXTENSIBLE_ENUM
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos);
UIKIT_EXTERN const SASheetPresentationControllerDetendIdentifier SASheetPresentationControllerDetentIdentifierMaximum
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos);
UIKIT_EXTERN const SASheetPresentationControllerDetendIdentifier SASheetPresentationControllerDetentIdentifierLarge
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos);
UIKIT_EXTERN const SASheetPresentationControllerDetendIdentifier SASheetPresentationControllerDetentIdentifierMedium
@0xstragner
0xstragner / UISheetPresentationController_2.m
Last active October 20, 2022 15:47
Medium/UISheetPresentationController/2.m
//
// SAPatternReference
//
@interface SAPatternReference : NSObject
@property (nonatomic, readonly, strong) NSString *name;
@property (nonatomic, readonly, assign) Class klass;
- (instancetype)init NS_UNAVAILABLE;
@0xstragner
0xstragner / UISheetPresentationController_1.m
Last active October 20, 2022 15:12
Medium/UISheetPresentationController/1.m
//
// SA13SheetPresentationController
//
static Class _SA13SheetPresentationControllerKlass = nil;
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos) NS_SWIFT_UI_ACTOR
@interface SUI13SheetPresentationController : NSObject
@property (nonatomic, assign) BOOL shouldFullscreen;
@0xstragner
0xstragner / UISheetPresentationController_0.m
Last active October 20, 2022 14:19
Medium/UISheetPresentationController/0
@interface ViewController : UIViewController <UIViewControllerTransitioningDelegate>
@end
@implementation ViewController
- (instancetype)init
{
self = [super init];
if (self)
@0xstragner
0xstragner / Object.h
Created November 14, 2017 14:55 — forked from CodaFi/Object.h
The headers of the oldest version of the Objective-C runtime I could still find. Extracted from an old NeXT image.
#ident "@(#) Object.h, Rev 2.10, 96/08/02"
//
// Copyright (c) 1995-1996, Sun Microsystems, Inc.
// portions (c) Copyright 1988, 1989 NeXT, Inc.
// All rights reserved.
#ifndef _OBJC_OBJECT_H_
#define _OBJC_OBJECT_H_
#import <objc/objc.h>