Skip to content

Instantly share code, notes, and snippets.

View KaneBuckthorpe's full-sized avatar

Kane Buckthorpe KaneBuckthorpe

View GitHub Profile
enum AsyncResult<Data> {
case loading
case success(Data)
case failure(Error)
}
@KaneBuckthorpe
KaneBuckthorpe / TagItem.swift
Last active October 18, 2022 07:15
SwiftUI - WrappedHStack + example TagsView
//
// TagItem.swift
// ChalkUp
//
// Created by kane buckthorpe on 13/03/2021.
//
import Foundation
class TagItem: ObservableObject {
#import <UIKit/UIKit.h>
@interface KBForceTouchGestureRecognizer : UIGestureRecognizer
@property (nonatomic) NSUInteger numberOfTouchesRequired;
@property (nonatomic, readonly) CGFloat currentForce;
@end
@interface _UILinearForceLevelClassifier :NSObject
-(double)standardThreshold;
-(void)updateView{
WeatherPreferences* wPrefs = [%c(WeatherPreferences) sharedPreferences];
City* city = [wPrefs localWeatherCity];
if (city){
[self.referenceView removeFromSuperview]; // Moved this into the if statement so it doesnt remove unless its guaranteed going to add back
self.referenceView = [[%c(WUIWeatherConditionBackgroundView) alloc] initWithFrame:self.frame];
[self.referenceView.background setCity:city];
@KaneBuckthorpe
KaneBuckthorpe / SBIconModel+SBIconView.m
Created November 7, 2018 01:34
SBIconModel useful methods + function for SBIconView Badges
/////THANKS @Tonyk766
///SBIconModel
-(void)deleteIconState;
Resets all icons states (which means removes folders and resets to default icons in dock and sorted the stock way)
-(BOOL)sortsIconsAlphabetically;
If true and then refresh/update/reload icons, apps will be sorted in alphabetical order
-(SBIcon *)leafIconForIdentifier:(NSString *)arg1;