Skip to content

Instantly share code, notes, and snippets.

View kishikawakatsumi's full-sized avatar
🏠
Working from home

Kishikawa Katsumi kishikawakatsumi

🏠
Working from home
View GitHub Profile
@kishikawakatsumi
kishikawakatsumi / ReorderingRealmResultsInTableView.swift
Created July 27, 2016 04:51
Reorder Realm Results in UITableView
import UIKit
import RealmSwift
class Data: Object {
dynamic var name = ""
...
dynamic var order = 0 // 並べ替えのためのカラムが必要
}
@kishikawakatsumi
kishikawakatsumi / gist:be87a6bf6992f815aa18
Created March 31, 2015 09:08
Register custom download font
#import "ViewController.h"
@import CoreText;
@interface ViewController ()
@end
@implementation ViewController
@kishikawakatsumi
kishikawakatsumi / .travis.yml
Last active August 29, 2015 13:56
.travis.yml for Ubiregi iPad App
language: objective-c
cache:
directories:
- vendor/bundle
- Pods
install:
- bundle install --path=vendor/bundle --binstubs=vendor/bin
- bundle exec pod install
script:
- '[ ! -z $(echo ${TRAVIS_BRANCH} | grep "^release.*$") ] && CONFIG=release || CONFIG=adhoc'
@kishikawakatsumi
kishikawakatsumi / Rakefile
Last active August 29, 2015 13:56
Rakefile for testing, building and uploading to Testflight/Crittercism
require "rubygems/version"
require "rake/clean"
require "date"
require 'time'
require "json"
require "open3"
# Application info
APP_NAME = "Ubiregi2"
SDK = "iphoneos"
@kishikawakatsumi
kishikawakatsumi / main.m
Created January 14, 2014 18:52
One-line fix for UITextView on iOS 7
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"UIDisableLegacyTextView"];
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
@kishikawakatsumi
kishikawakatsumi / gist:7430173
Created November 12, 2013 12:39
Generate license description from podspec automatically.
platform :ios, '5.0'
pod 'SVProgressHUD'
pod 'FFCircularProgressView'
pod 'JLRoutes'
pod 'NLCoreData'
pod 'Evernote-SDK-iOS'
pod 'Dropbox-iOS-SDK'
pod 'UrbanAirship-iOS-SDK'
pod 'Helpshift'
@kishikawakatsumi
kishikawakatsumi / gist:6072953
Created July 24, 2013 18:03
Set Max Character Length UITextField (works with Japanese input method)
...
[textField addTarget:self action:@selector(editingChanged:) forControlEvents:UIControlEventEditingChanged];
...
#define MAXLENGTH 3
- (IBAction)editingChanged:(id)sender
{
UITextField *textField = sender;
@interface UIScrollView (MyGestureRecognizer)
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
@end
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gr
shouldReceiveTouch:(UITouch *)touch
{
if (gr != myGestureRecognizer) {
if ([super respondsToSelector:@selector(gestureRecognizer:shouldReceiveTouch:)]) {
return [super gestureRecognizer:gr shouldReceiveTouch:touch];
} else {
return YES;
}
}
//
// HTTPLoader.h
//
#import <Foundation/Foundation.h>
typedef void(^ HTTPLoaderCompletionBlock)(NSData *data, NSError *erorr);
@interface HTTPLoader : NSObject