This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension AVAssetTrack { | |
/// | |
// MARK: ------------------------------ properties | |
/// | |
/// 動画の向き確認 | |
/// | |
var type: String { | |
if 0 < self.preferredTransform.b && self.preferredTransform.c < 0 && self.preferredTransform.tx == self.naturalSize.height { | |
return "ホーム下 or フロントホーム下" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// ReceiptDetail | |
/// | |
struct ReceiptDetail: Codable { | |
let receipt_type: String | |
let adam_id: Int | |
let app_item_id: Int | |
let bundle_id: String | |
let application_version: String | |
let download_id: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// Safe Area Insets | |
/// | |
var SAFE: UIEdgeInsets { | |
get { | |
if #available(iOS 11.0, *) { | |
if let insets = AppDelegate?.window?.safeAreaInsets { | |
return insets | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// 対象文字列 | |
/// | |
let str: String = "1234567890" | |
/// | |
/// 先頭1文字 - 1 | |
/// | |
print("先頭1文字: \(String(str.prefix(1)))") | |
/// | |
/// 先頭1文字以外 - 234567890 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIColor { | |
/// | |
/// UIColor.init(named: String)がiOS11以降からしか使えないのでiOS10用処理 | |
/// | |
static func Init(named: String) -> UIColor { | |
if #available(iOS 11.0, *) { | |
guard let _0_c: UIColor = UIColor.init(named: named) else { | |
return UIColor.clear | |
} | |
return _0_c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// CstmNV - 戻るボタン非表示 | |
/// | |
class CstmNC: UINavigationController { | |
/// | |
// MARK: ------------------------------ life cycle | |
/// | |
/// | |
/// | |
override func pushViewController(_ viewController: UIViewController, animated: Bool) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIFont.init(name: "PostScript名", size: 12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
/// | |
/// ベースビュー | |
/// | |
class V: UIView, UIGestureRecognizerDelegate { | |
// MARK: ------------------------------ UIGestureRecognizer | |
/// | |
/// コールバック関数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/swift | |
import Cocoa | |
class fileMG { | |
var dir: String | |
var file: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func numberOfSections(in tableView: UITableView) -> Int { | |
return 1 | |
} | |
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return 10 | |
} | |
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { | |
/// 0.0だと33pxの余白が発生したので0.1を定義 |
NewerOlder