Skip to content

Instantly share code, notes, and snippets.

View ifournight's full-sized avatar
👾
Alona!

Song Hui ifournight

👾
Alona!
View GitHub Profile
@ifournight
ifournight / STabControl.h
Last active December 16, 2015 02:09
SToolkitController and Company class.
//
// STabControl.h
// Xcode Reader
//
// Created by Song Hui 2013-4-15
// Copyright(C)Song Hui. All rights reserved.
#import <UIKit/UIKit.h>
@class STabControl;
@ifournight
ifournight / DirectionPanGestureRecognizer.h
Created April 16, 2013 03:24
DirectionPanGestureRecognizer From http://goo.gl/H65QC
#import <Foundation/Foundation.h>
#import <UIKit/UIGestureRecognizerSubclass.h>
typedef enum {
DirectionPangestureRecognizerVertical,
DirectionPanGestureRecognizerHorizontal
} DirectionPangestureRecognizerDirection;
@interface DirectionPanGestureRecognizer : UIPanGestureRecognizer {
BOOL _drag;
@ifournight
ifournight / SDirectionPanGestureRecognizer.h
Last active December 16, 2015 07:49
SRevealSideController and company class.
#import <Foundation/Foundation.h>
#import <UIKit/UIGestureRecognizerSubclass.h>
typedef NS_ENUM(NSUInteger, SDirectionPanGestureRecognizerDirection) {
SDirectionPanGestureRecognizerDirectionHorizontal,
SDirectionPanGestureRecognizerDirectionVertical
};
// Subclass of UIPanGestureRecognizer that only enable one direction pan gesture.
// The intended direction should be set by the property direction.
#import <Cocoa/Cocoa.h>
@interface GetPathsOperation : NSOperation
- (id)initWithRootURL:(NSURL *)url queue:(NSOperationQueue *)qq scanCount:(NSInteger)scanCount;
@end
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
// SNode class is one of the two most important objects throughout the entire Xcode Reader Project.
// Because all documents in every Apple's documentation library, are categorized into two category: Token and Node, and stored in Core Data.
// Token represents reference/ API: OBC C++ Class, Protocol, Method, Enum, Struct, Constant, Function, Macro, Notification...
// Node represents guide/ sample code and all the articles.
// They all have many properties and a graphic stored in Core Data's NSManagedObjectModel.
// Throughout Xcode Reader's workflow, tokens and node will be prefetched into memory from Core Data.
// And Their properties may be used in different context.
#import <Foundation/Foundation.h>
#import "SSearchManager.h"
#import "SSearchNode.h"
// An operation that search all search manager's nodes based on its search string.
@interface SNodeSearchOperation : NSOperation
// Search string.
@property (nonatomic, copy) NSString *searchString;
#import <Foundation/Foundation.h>
// Relative path for library's info.plist.
UIKIT_EXTERN NSString *kLibraryInfoPlistPath;
// Relative path for library's NSManagedObjectStore.
UIKIT_EXTERN NSString *kLibraryStorePath;
// Relative path where all library's documents locate.
UIKIT_EXTERN NSString *kLibraryDocumentPath;
#import <Foundation/Foundation.h>
#import "SDocumentCell.h"
#import "SDocumentTag.h"
// Encapsulate all needed datas of Document Cell.
@interface SDocumentCellData : NSObject
// Main label's attributedText.
@property (nonatomic, strong) NSAttributedString *mainAttributedText;
@ifournight
ifournight / UISearchbarTextAligment.m
Last active October 3, 2019 23:05
UISearchbar Text Aligment
self.searchbar = [[UISearchBar alloc] initWithFrame:CGRectMake(5.0, 0.0, 310.0, 44.0)];
self.searchbar.autocorrectionType = UITextAutocorrectionTypeNo;
self.searchbar.showsCancelButton = YES;
self.searchbar.spellCheckingType = UITextSpellCheckingTypeNo;
[self.searchbar setImage:[UIImage imageNamed:@"SearchBarIcon-Search.png"]
forSearchBarIcon:UISearchBarIconSearch
state:UIControlStateNormal];
[self.searchbar setImage:[UIImage imageNamed:@"SearchBarIcon-Clear.png"]
forSearchBarIcon:UISearchBarIconClear
state:UIControlStateNormal];
@ifournight
ifournight / gist:5941943
Created July 7, 2013 01:48
Remove UIWebView Shadow
for (UIView* shadowView in [webView.scrollView subviews])
{
if ([shadowView isKindOfClass:[UIImageView class]]) {
[shadowView setHidden:YES];
}
}