Skip to content

Instantly share code, notes, and snippets.

Avatar

matsuyoro matsuyoro

View GitHub Profile
@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 Nov 13, 2015
iOSアプリ等でwebviewを表示する際に、拡大はするがユーザーがピンチで拡大や、スクロールができないようにする。 ref: http://qiita.com/matsuyoro/items/2240b29e14d23bda102f
View file0.txt
_webView.scalesPageToFit = YES;
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)!
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