Skip to content

Instantly share code, notes, and snippets.

- (void) hoge
{
MyActionSheet *actionSheet = [MyActionSheet actionSheet];
[actionSheet addDestructButtonWithText:@"削除" onTapped:^(void){
NSLog(@"削除");
}];
[actionSheet addButtonWithText:@"編集" onTapped:^(void){
NSLog(@"編集");
}];
[actionSheet addCancelButtonWithText:@"キャンセル" onTapped:^(void){
- (void) hoge
{
SuperAlertView *alertView = [SuperAlertView alertViewWithTitle:@"タイトル"
message:@"メッセージ"];
[alertView addButtonWithLabel:@"OK"
onTapped:^(void){
NSLog(@"OK");
}];
[alertView addCancelButtonWithLabel:@"CANCEL"
onTapped:^(void){
@interface MyClass() <UIAlertViewDelegate>
@end
@implementation MyClass
- (void) hoge
{
UIAlertView *alert = [[UIAlertView alloc] init];
alert.delegate = self;
alert.title = @"タイトル";
@akitsukada
akitsukada / gist:213a2302cebcce502183
Last active August 29, 2015 14:02
Storyboard ID by string
// 文字列で Storyboard ID を指定
MyViewController *viewController
= [storyboard
instantiateViewControllerWithIdentifier:@"MyViewController"];
/**
* よくある Segue のサンプルコード
*/
- (void)hoge {
// Storyboard で設定した Segue を文字列で指定して実行
[self performSegueWithIdentifier:@"next" sender:self];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
@akitsukada
akitsukada / setup.rb
Created January 22, 2012 18:01
wordpress_dummy_data
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'active_record'
require 'pp'
require 'cgi'
class Configs# {{{
attr_reader :table_prefix, :db_adapter, :db_host,
@akitsukada
akitsukada / suite_file_parser
Created October 15, 2011 11:17
つかだのめも_phpファイル内のarrayパース
#!/usr/bin/env ruby
# -*- coding:UTF-8 -*-
def parse(suite)
realpath = File::expand_path suite
if !File.exists?(realpath)
puts '与えられたsuiteファイルは存在しません'
puts '=>[' + realpath + ']'
@akitsukada
akitsukada / Apurenthisu
Created July 12, 2011 17:13
2011/7/12 GenesisLightningTalksで発表したLT資料
let s:Presentation = { 'slides' : [], 'current' : 0, 'max' : 0 }
function! s:Presentation.load()
let self.slides = [
\ {
\ 'title' : 'Apurenthisu',
\ 'contents' : [
\ '* いつまで見習ってるつもりですか',
\ '* 2011/07/10',
\ '* @akitsukada',
@akitsukada
akitsukada / presentation
Created July 10, 2011 14:55
karaage.vim.tsukada
let s:Presentation = { 'slides' : [], 'current' : 0, 'max' : 0 }
function! s:Presentation.load()
let self.slides = [
\ {
\ 'title' : 'karaage.vim',
\ 'contents' : [
\ '* vimrc晒しとカーソル移動系コマンド紹介',
\ '* 2011/07/10',
\ '* @akitsukada',
@akitsukada
akitsukada / money.rb
Created July 9, 2011 09:02
2011/7/9 TDDBC Tokyo で高井さんに教えてもらいながら一緒に書いたコード
# -*- coding: utf-8 -*-
class Money
def initialize amount = 0
@amount = amount
end
def to_i
@amount
end