Skip to content

Instantly share code, notes, and snippets.

Avatar

matsuyoro matsuyoro

View GitHub Profile
View file0.swift
var str:NSString = "ABCDEFGHIJKLMNOP"
var pos = NSMakeRange(4,4) // 位置
println(str.stringByReplacingCharactersInRange(pos, withString: "hoge"))
@matsuyoro
matsuyoro / file1.txt
Created Feb 6, 2015
swift 指定の文字列の位置を最後から検索 ref: http://qiita.com/matsuyoro/items/b7146ae0d79abf845989
View file1.txt
pos 9223372036854775807
View file0.swift
// アプリバージョンをStringで
let version: String! = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString") as? String
// 指定URLと文字連結
var myUrlStr:String = "http://hooogeee.com?v=" + version
// NSURL型に変換するなら
var myUrl:NSURL = NSURL(string:myUrlStr)!
@matsuyoro
matsuyoro / file0.txt
Last active Nov 13, 2015
iOSアプリ等でwebviewを表示する際に、拡大はするがユーザーがピンチで拡大や、スクロールができないようにする。 ref: http://qiita.com/matsuyoro/items/2240b29e14d23bda102f
View file0.txt
_webView.scalesPageToFit = YES;
@matsuyoro
matsuyoro / file0.cs
Created Mar 16, 2016
Unity Ads と Ad Colonyの動画SDKをUnity(C#)で一元管理したメモ(SDKだらけ〜〜w ref: http://qiita.com/matsuyoro/items/0959ba21a001d2dd7eca
View file0.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
// unity ads
using UnityEngine.Advertisements;
public class GameSceneSingleton {
@matsuyoro
matsuyoro / file0.txt
Last active Apr 11, 2016
Unity rigidbody2Dでよく使うメソッド一覧 ref: http://qiita.com/matsuyoro/items/e32b4fd12d20e5c06614
View file0.txt
transform.localEulerAngles.z;
@matsuyoro
matsuyoro / Podfile
Last active Aug 19, 2016
AdMobメディエーションでFAN(facebook audience network)を出す方法 ref: http://qiita.com/matsuyoro/items/6f402247d2e53df48e68
View Podfile
pod 'FBAudienceNetwork'
@matsuyoro
matsuyoro / file0.txt
Created Aug 22, 2016
storyboardで「Must translate autoresizing mask into constraints to have _setHostsLayoutEngine:YES.」というエラーがでた場合 ref: http://qiita.com/matsuyoro/items/9219c23a70c012d6e3e5
View file0.txt
Must translate autoresizing mask into constraints to have _setHostsLayoutEngine:YES.
@matsuyoro
matsuyoro / FragmentActivity.java
Last active Sep 28, 2016
fragmentのタブのアイコン画像のサイズをカスタマイズする ref: http://qiita.com/matsuyoro/items/48399411cca6764e051b
View FragmentActivity.java
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
tabLayout.getTabAt(0).setCustomView(R.layout.design_fragment_icon_camera);
tabLayout.getTabAt(1).setCustomView(R.layout.design_fragment_line_weight);
@matsuyoro
matsuyoro / GameManager.cs
Last active Apr 4, 2017
iOS/Android(Unity5.5)で Admobメディエーションで、バナー広告、インタースティシャル広告、動画リワード広告を、最適化した色んな会社の広告をシングルトンで一元化して出す方法 ref: http://qiita.com/matsuyoro/items/33d723fdef798f74d286
View GameManager.cs
// 〜〜省略
GameSceneSingleton.Instance.setVideoSdkCallbackListener(this);
// 〜〜省略
You can’t perform that action at this time.