This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UIViewController (JTCAddition) | |
+(instancetype) viewControllerFromSameNameStoryboard; | |
+(UINavigationController*) viewControllerFromSameNameStoryboardInNavigationController; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
self.view.translatesAutoresizingMaskIntoConstraints = NO; | |
if (self.traitCollection.userInterfaceIdiom == UIUserInterfaceIdiomPad) { | |
self.portraitHeightRate = [UIScreen mainScreen].bounds.size.width * .4 / [UIScreen mainScreen].bounds.size.height; | |
}else{ | |
if (([UIScreen mainScreen].bounds.size.width + [UIScreen mainScreen].bounds.size.height)>1100) { | |
self.portraitHeightRate = [UIScreen mainScreen].bounds.size.width * .6 / [UIScreen mainScreen].bounds.size.height; | |
} else if (([UIScreen mainScreen].bounds.size.width + [UIScreen mainScreen].bounds.size.height)>950) { | |
self.portraitHeightRate = [UIScreen mainScreen].bounds.size.width * .75 / [UIScreen mainScreen].bounds.size.height; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef DEBUG | |
//# define LOG(...) NSLog(@"%@", __VA_ARGS__) | |
//# define LOG_METHOD NSLog(@"%s", __func__) | |
//# define LOG_FORMAT(...) NSLog(__VA_ARGS__) | |
# define LOG(...) ; | |
# define LOG_METHOD ; | |
# define LOG_FORMAT(...) ; | |
#else | |
# define LOG(...) ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface NSString (url) | |
- (NSMutableArray*) extractURLs ; | |
@end | |
@implementation NSString (url) | |
- (NSMutableArray*) extractURLs { | |
NSString* source = self; | |
NSDataDetector* detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:nil]; | |
NSArray* matches = [detector matchesInString:source options:0 range:NSMakeRange(0, [source length])]; | |
LOG([matches description]); | |
NSMutableArray* urls = [NSMutableArray arrayWithCapacity:0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.m | |
// test | |
// | |
// Created by Tomohisa Takaoka on 10/12/11. | |
// Copyright (c) 2011 __MyCompanyName__. All rights reserved. | |
// | |
#import "ViewController.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// need to restart app | |
languages = [NSArray arrayWithObjects:@"en",@"ja",nil]; | |
[[NSUserDefaults standardUserDefaults] setObject:languages forKey:@"AppleLanguages"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tableTweet.autoresizingMask = UIViewAutoresizingNone; | |
CGRect area2 = {0,adView.frame.origin.y+adviewHeight,self.view.bounds.size.width,self.view.bounds.size.height-(adviewHeight)}; | |
CGPoint center = CGPointMake(area2.origin.x+area2.size.width/2, area2.origin.y+area2.size.height/2); | |
tableTweet.frame = CGRectMake(0, 0,area2.size.width, area2.size.height); | |
tableTweet.center = center; | |
tableTweet.transform = CGAffineTransformMakeRotation(M_PI *(-90) / 180.0f); | |
tableTweet.center = center; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tableTweet.autoresizingMask = UIViewAutoresizingNone; | |
CGRect area2 = {0,adView.frame.origin.y+adviewHeight,self.view.bounds.size.width,self.view.bounds.size.height-(adviewHeight)}; | |
tableTweet.transform = CGAffineTransformMakeRotation(M_PI *(-90) / 180.0f); | |
tableTweet.frame=area2; | |
tableHeight = TOVData.columnWidth; | |
tableWidth = tableTweet.frame.size.height; | |
[TOVTweetView setMaximumHeight:tableWidth]; | |
tweetViews = [NSMutableArray arrayWithCapacity:0]; | |
[self renewNodes]; | |
[tableTweet reloadData]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *str = [NSString stringWithFormat:@"twitter://user?screen_name=%@", bstr]; | |
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:str]]) { | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]; | |
}else { | |
UIAlertView*alert = [[UIAlertView alloc] initWithTitle:@"Tweetoverview" message:NSLocalizedString(@"Can not open twitter app. Please install twitter app to send tweet.", @"Can not open twitter app. Please install twitter app to send tweet.") delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil]; | |
[alert show]; | |
} |
OlderNewer