Skip to content

Instantly share code, notes, and snippets.

View uruly's full-sized avatar
☂️

Reo uruly

☂️
View GitHub Profile
import UIKit
class ViewController: UIViewController {
//ユーザーが指定した時間(仮) 分
let userTimer:Int = 1
var count = 0
var timeLabel:UILabel!
var secondLabel:UILabel!
import UIKit
class ViewController: UIViewController {
var bezierPath:UIBezierPath!
var canvas:UIImageView!
var lastDrawImage:UIImage?
import UIKit
class CustomSegue: UIStoryboardSegue {
override func perform(){
//遷移前のViewControllerのインスタンスを作成
let firstVC = self.source
//遷移後のViewControllerのインスタンスを作成
let secondVC = self.destination
//このモックがsecondVCの動きになる
import UIKit
class CustomUnwindSegue: UIStoryboardSegue {
override func perform(){
//遷移前のViewControllerのインスタンスを作成
let firstVC = self.source
//遷移後のViewControllerのインスタンスを作成
let secondVC = self.destination
let mock = createMockView(view: firstVC.view)
import UIKit
class DataManager{
//Documentに関する情報
struct MyDocInfo{
static let NAME = "document"
static let ECTENSION = "doc"
static var LOCAL_DOCUMENTS_PATH:String? = nil
}
//アプリのサンドボックスのパスを格納する変数
import UIKit
class CheckCollectionView: UICollectionView {
let reuseID = "cell"
let checkColor = UIColor.blue //チェックしたもののみ色をつける
let defaultColor = UIColor.white
import UIKit
class ButtonTestViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let btn = UIButton()
let btnImg = UIImage(named:"image.png")
btn.frame = CGRect(x:50,y:50,width:120,height:100)
import UIKit
@objc protocol UpDownCountButtonDelegate {
func touchDown(sender:UIButton)
func touchCancel(sender:UIButton)
}
class UpDownCountButton: UIButton {
@uruly
uruly / AlertManager.swift
Last active April 12, 2018 01:00
LocalNotification
import UIKit
class AlertManager {
let id = "alert"
var text = "通知が来ているはずだよ"
//現在の時間から
func after(day:Int,hour:Int,minute:Int,seconds:Int) -> UILocalNotification{
//ローカル通知
extension UIImage {
func resize(size:CGSize) -> UIImage?{
// リサイズ処理
let origWidth = self.size.width
let origHeight = self.size.height
var resizeWidth:CGFloat = 0
var resizeHeight:CGFloat = 0
if (origWidth < origHeight) {
resizeWidth = size.width