Skip to content

Instantly share code, notes, and snippets.

View osanaikoutarou's full-sized avatar

Koutarou Osaanai osanaikoutarou

View GitHub Profile
@osanaikoutarou
osanaikoutarou / ViewController.swift
Last active November 7, 2018 14:59
[teratail]156732
// iOS 11.4
// Xcode 9.4
// KILabel 1.0.0 by cocoapods
import UIKit
import KILabel
class ViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
@osanaikoutarou
osanaikoutarou / gist:71a15c1c2ce3882d9bcd0eb8dfd1eea3
Created October 22, 2018 05:57
年、月から日数を求める
func dayNumOfMonth(year:Int, month:Int) -> Int {
let components = DateComponents(year: year, month: month)
let calendar = Calendar.current
let date = calendar.date(from: components)!
let range = calendar.range(of: .day, in: .month, for: date)!
return range.count
}
//
// LineSpacingLabel.swift
// SimplePhotoMemo
//
// Created by osanai on 2018/10/09.
// Copyright © 2018年 osanai. All rights reserved.
//
// 行間をStoryboard上で調整する
@osanaikoutarou
osanaikoutarou / 0_reuse_code.js
Created August 4, 2017 08:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
//
// CustomScrollView.m
// UIControlTest
//
// Created by osanai on 2017/01/18.
// Copyright © 2017年 osanai. All rights reserved.
//
#import "CustomScrollView.h"
これで解決した その1
self.navigationController.navigationBar.tintColor = UIColor.whiteColor;
self.navigationController.navigationBar.topItem.title = @"戻る";
タイトルはココらへん
self.navigationController.navigationBar.titleTextAttributes= @{NSForegroundColorAttributeName: [UIColor whiteColor]};
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
http://dev.classmethod.jp/smartphone/ios-all-stars-report/
PROJECT -> Info -> ConfigurationsでPods設定
CustomViewの中ではAutoLayoutの影響が適用されるのがviewDidLayoutSubivews後
VCの中では普通にframe取れる
for (CALayer *layer in self.layer.sublayers) {
[layer removeFromSuperlayer];
}