Skip to content

Instantly share code, notes, and snippets.

View jiro's full-sized avatar

Jiro Nagashima jiro

View GitHub Profile

Greetings, NSHipsters!

As we prepare to increment our NSDateComponents -year by 1, it's time once again for NSHipster end-of-the-year Reader Submissions! Last year, we got some mind-blowing tips and tricks. With the release of iOS 7 & Mavericks, and a year's worth of new developments in the Objective-C ecosystem, there should be a ton of new stuff to write up for this year.

Submit your favorite piece of Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!

Here are a few examples of the kind of things I'd like to see:

  • Using NSStringFromSelector(@selector()) as a safer way to do KVC / KVO / NSCoding.
  • Panic's [rather surprising discovery about the internals of the Lightning Digital AV Adapter](http://www.panic.com/blog/the-lightning-di
@ryugoo
ryugoo / iOS7Yahoo.md
Created October 7, 2013 12:40
iOS 7 エンジニア勉強会 @yahoo - 2013/10/07
  • Yahoo! 株式会社
  • 2013/10/07
  • 資料は後ほどシェア

iOS 7 でアプリ開発はどう変わる (佐野さん)

  • iOS 7 のデザイン原則
    • UI はコンテンツに従順 * Safari が分かりやすい
  • ナビゲーションバーが殆ど消える
@ole
ole / update_storyboard_strings.sh
Last active April 4, 2022 06:11
Automatically extract translatable strings from Xcode storyboards and update .strings files. Original version by MacRumors forum user mikezang (http://forums.macrumors.com/showpost.php?p=16060008&postcount=4). Slightly updated by Ole Begemann. NOTE: this Gist moved to a regular repo at https://github.com/ole/Storyboard-Strings-Extraction.
# (File moved to https://github.com/ole/Storyboard-Strings-Extraction)
@shunirr
shunirr / README.md
Created August 30, 2012 04:07 — forked from laiso/README
Jenkins をOS X のログインユーザー権限のデーモンで自動起動しておく設定

Jenkins をOS X のログインユーザー権限のデーモンで自動起動しておく設定

必要なもの

うっかり jenkins.pkg を入れてしまった人はアンインストールする

@danielres
danielres / README.markdown
Created July 22, 2012 00:19
Using Font Awesome with Octopress
  1. Download Font Awesome (source)
  2. Take the file sass/font-awesome.sass and put it in your octopress sass folder
  3. Rename it to _font-awesome.sass
  4. Create a directory 'octpress/source/fonts' and put there the 4 font files (ttf, svg, eot and woff).
  5. In your stylesheet:
  • $fontAwesomePath: "fontawesome-webfont"
  • @import font-awesome

Done !

@tomohisa
tomohisa / gist:2897676
Created June 8, 2012 19:20
Add and Remove ChildViewController
// 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];
@kaz29
kaz29 / MyTestSegue.m
Created June 4, 2012 04:47
StoryBoard sample
//
// MyTestSegue.m
// StoryBoardTest
//
#import "MyTestSegue.h"
@implementation MyTestSegue
- (void)perform
@kishikawakatsumi
kishikawakatsumi / gist:2757488
Created May 20, 2012 09:32
merge managed context in CoreData
// バックグラウンドでGoogle Calendarからイベントを受信して保存するクラス
- (void)main {
if (!self.isCancelled) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (!self.isCancelled) {
NSManagedObjectContext *managedObjectContext = [self managedObjectContext];
[managedObjectContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy];
SPEventStore *eventStore = [SPEventStore defaultEventStore];
events = [[eventStore searchEventsWithPredicate:predicate] retain];
}
@setoh2000
setoh2000 / gist:1953420
Created March 1, 2012 21:39
UITableViewでスクロール停止時に表示されるセルを予想する iOS5以降
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{
UITableView *tableView = (UITableView *)scrollView;
int n = tableView.frame.size.height / _cellHeight;
if ((int)tableView.frame.size.height % (int)_cellHeight) n++;
for (int i = 0; i <= n; i++) {
NSIndexPath *indexPath = [tableView indexPathForRowAtPoint:CGPointMake(0, targetContentOffset->y + i * _cellHeight)];
@laiso
laiso / README
Created January 16, 2012 05:12
jenkins をOS X のログインユーザー権限のデーモンで自動起動しておく設定
launchctl load -wF -D user ~/Library/LaunchAgents/jenkins.plist
launchctl list | grep jenkins
# 58066 - jenkins
launchctl start jenkins
open http://localhost:8080/