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
// 読み上げオブジェクト | |
AVSpeechSynthesizer * synthesizer = [[AVSpeechSynthesizer alloc] init]; | |
// 読み上げる内容 | |
AVSpeechUtterance * utterance = [[AVSpeechUtterance alloc] initWithString:NSLocalizedString(@"Welcome to Tweet Overview ", nil)]; | |
// 読み上げる言語の設定 | |
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"ja-JP"]; | |
utterance.pitchMultiplier = 1.0; | |
// 読み上げる | |
[synthesizer speakUtterance:utterance]; |
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 ALAssetsLibrary (JTCCommon) | |
-(ALAsset*) getSyncAssetFromURL:(NSURL*)url; | |
-(UIImage*) getSyncFullScreenImageFromURL:(NSURL*)url; | |
-(UIImage*) getSyncFullResolutionImageFromURL:(NSURL*)url; | |
-(UIImage*) getSyncThumbnailImageFromURL:(NSURL*)url; | |
-(UIImage*) getSyncAspectThumbnailImageFromURL:(NSURL*)url; | |
@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
AFHTTPClient *client = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:domain]]; | |
[client registerHTTPOperationClass:[AFHTTPRequestOperation class]]; | |
NSMutableDictionary* dicParam = [parameters mutableCopy]; | |
NSMutableURLRequest *request = [client requestWithMethod:@"POST" path:@"/api/path" parameters:dicParam]; | |
[request setTimeoutInterval:20]; | |
AFHTTPRequestOperation *operation = [client HTTPRequestOperationWithRequest:request success:^{...} failure:^{...}]; | |
[client enqueueHTTPRequestOperation:operation]; |
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 | |
// TestUIWebView | |
// | |
// Created by Tomohisa Takaoka on 11/5/12. | |
// Copyright (c) 2012 Tomohisa Takaoka. 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
-(IBAction) compose:(id)sender{ | |
TWTweetComposeViewController *tweet = [[TWTweetComposeViewController alloc] init]; | |
[tweet setInitialText:[@" #test"]]; | |
int64_t delayInSeconds = 0.5; | |
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); | |
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ | |
[self searchSubviewRecursive:[[UIApplication sharedApplication] keyWindow]]; | |
}); | |
[[TOVAppDelegate sharedDelegate].viewController presentModalViewController:tweet animated:YES]; | |
} |
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)didReceiveMemoryWarning { | |
if([self isViewLoaded] && [self.view window] == nil) { | |
[photoMap removeAllObjects]; | |
self.view = nil; | |
self.photoImageView = nil; | |
} | |
} |
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)test{ | |
__weak MyViewController* wself=self; | |
dispatch_async(dispatch_get_main_queue(),^{ | |
// Error on llvm 4.0 | |
wself->_mycount = 2; | |
}); | |
} |
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
#pragma mark - help functions | |
-(void) addChildViewControllerWithIdentifier:(NSString*)identifier inArea:(CGRect)rect closeOtherChildView:(BOOL)isClose toView:(UIView*) toView{ | |
if (isClose) { | |
for (UIViewController* vc in self.childViewControllers) { | |
[vc.view removeFromSuperview]; | |
[vc removeFromParentViewController]; | |
} | |
} | |
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
// | |
// NSArray+IndexHelper.h | |
// C_POS | |
// | |
// Created by Tomohisa Takaoka on 6/14/12. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
#import <Foundation/Foundation.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
// add child view | |
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"]; | |
[self addChildViewController:controller]; | |
controller.view.frame = CGRectMake(0, 44, 320, 320); | |
[self.view addSubview:controller.view]; | |
[controller didMoveToParentViewController:self]; | |
// remove child view | |
UIViewController *vc = [self.childViewControllers lastObject]; | |
[vc.view removeFromSuperview]; |