Skip to content

Instantly share code, notes, and snippets.

Yuichi Fujishige nakiwo

Block or report user

Report or block nakiwo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nakiwo
nakiwo / MyButton.swift
Created Oct 6, 2017
関連づけられたラベルの色をステートに合わせて変えるUIButton。ハイライト時のフェードアニメーション付き
View MyButton.swift
import UIKit
class MyButton: UIButton {
@IBOutlet weak var associatedLabel: UILabel? {
didSet {
associatedLabel?.textColor = currentTitleColor
}
}
View instantiateFromStoryboard.swift
// Swift 3
import UIKit
class TestViewController: UIViewController {
var text: String!
static func create(with text: String) -> Self {
let vc = instantiateFromStoryboard()
@nakiwo
nakiwo / gist:afc59f05147d9526d7d5
Created Mar 25, 2015
dump mobileprovision as text
View gist:afc59f05147d9526d7d5
openssl asn1parse -inform DER -in foo.mobileprovision
@nakiwo
nakiwo / gist:c7c8d56cfb1c64c8617e
Created Aug 19, 2014
embedded.mobileprovisionにあるplistを取得
View gist:c7c8d56cfb1c64c8617e
- (NSDictionary *)embeddedMobileprovisionPlist
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"];
if (!path) {
return nil;
}
NSData *profileData = [NSData dataWithContentsOfFile:path];
if (!profileData) {
return nil;
View gist:e5e28124afbe4d32b490
@import SystemConfiguration;
#import <SystemConfiguration/CaptiveNetwork.h>
- (NSString *)currentSSID
{
NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces());
if (!interfaceNames.count) {
return nil;
}
View isEqual
BOOL isEqual(NSObject *a, NSObject *b)
{
if (a) {
if (b) {
return [a isEqual:b];
}
} else { // a == nil
if (!b) {
return YES;
}
@nakiwo
nakiwo / gist:5500639
Created May 2, 2013
rubycocoaでplist生成
View gist:5500639
require 'osx/cocoa'
data = OSX::NSPropertyListSerialization.dataWithPropertyList_format_options_error_(obj, OSX::NSPropertyListBinaryFormat_v1_0, 0, nil)
data.writeToFile_atomically_(path, true)
@nakiwo
nakiwo / gist:3179598
Created Jul 26, 2012
Xcode4.4 iOS SDKで @yES,@no,array[...],dictionary[...]を使う
View gist:3179598
// Xcode4.4
// llvm4の機能のうち一部が、
// iOS 5.1 SDK で使えない
//
NSNumber *b = @YES; // error
NSArray *array = @[ @1, @2, @3 ];
NSNumber *n = array[1]; // error
@nakiwo
nakiwo / gist:3174351
Created Jul 25, 2012
subviewだけtouchできるview
View gist:3174351
@interface TestView : UIView
@end
@implementation TestView
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
UIView *view = [super hitTest:point withEvent:event];
if(view == self) {
return nil;
You can’t perform that action at this time.