Skip to content

Instantly share code, notes, and snippets.

@shingohry
shingohry / with-declarative-html.html
Last active April 29, 2017 14:18
LivePhotosKit JS Samples
<!DOCTYPE html>
<html>
<head>
<title>With Declarative HTML</title>
<meta charset="utf-8">
<!-- [1]LivePhotosKit JSのスクリプトを埋め込み -->
<script src="https://cdn.apple-livephotoskit.com/lpk/1/livephotoskit.js"></script>
</head>

Fabric: Copyright 2016 Twitter, Inc. All Rights Reserved. Use of this software is subject to the terms and conditions of the Fabric Software and Services Agreement located at https://fabric.io/terms. Crashlytics Kit: Copyright 2016 Crashlytics, Inc. All Rights Reserved. Use of this software is subject to the terms and conditions of the Crashlytics Terms of Service located at http://try.crashlytics.com/terms/terms-of-service.pdf and the Crashlytics Privacy Policy located at http://try.crashlytics.com/terms/privacy-policy.pdf. OSS: http://get.fabric.io/terms/opensource.txt

@shingohry
shingohry / gist:c11002561f188780d55c
Last active October 8, 2016 06:37
use AVAudioFile
// Open the file
NSError *error = nil;
AVAudioFile *audioFile = [[AVAudioFile alloc]
initForReading: fileURL
commonFormat: AVAudioPCMFormatFloat32
interleaved: NO
error: &error];
// Fetch and print basic info
NSLog(@“File URL: %@\n”, fileURL.absoluteString);
@shingohry
shingohry / gist:8d7cb98b6323598ab2a6
Created September 4, 2014 04:44
limit textView text length
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
// すでに入力されているテキストを取得、今回編集されたテキストをマージ
NSMutableString *textViewText = [textView.text mutableCopy];
[textViewText replaceCharactersInRange:range withString:text];
// 結果が文字数をオーバーしていないならYES,オーバーしている場合はNO
if ([textViewText length] <= self.maxTextLength) {
// 最大文字数以下
return YES;
@shingohry
shingohry / gist:6fc8033763608bb02995
Last active August 29, 2015 14:06
use textView inputAccessoryView
- (void)awakeFromNib
{
// Initialization code
self.textView.delegate = self;
UIToolbar *tipToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
tipToolbar.barStyle = UIBarStyleBlackOpaque;
tipToolbar.items = [NSArray arrayWithObjects:
[[UIBarButtonItem alloc] initWithTitle:@"Calculate"
@shingohry
shingohry / gist:11202255
Last active August 29, 2015 14:00
UITableView grouped label settings for iOS6/5
static double const kFontSizeForTitleLabel = 17.0;
static NSString * const kColorHexStringForHeaderTitleLabel = @"#52586b";
- (void)settingLabelForLessThaniOS7
{
CGRect labelRect = self.label.frame;
self.label.frame = CGRectMake(19, labelRect.origin.y, labelRect.size.width, labelRect.size.height);
self.label.backgroundColor = [UIColor clearColor];
self.label.font = [UIFont boldSystemFontOfSize:kFontSizeForTitleLabel];
self.label.shadowColor = [UIColor colorWithWhite:1.0 alpha:1];
@shingohry
shingohry / file0.txt
Created March 17, 2014 11:03
dyld: Symbol not found: _OBJC_CLASS_$_UICollectionReusableView エラーの原因 ref: http://qiita.com/hirayaCM/items/8b7ddadbfd850bd7a328
dyld: Symbol not found: _OBJC_CLASS_$_UICollectionReusableView
Referenced from: /var/mobile/Applications/yyyyyyyy-aaaa-nnnn-oooo-zzzzzzzzzzzz/Xxxx.app/Xxxx
Expected in: /System/Library/Frameworks/UIKit.framework/UIKit