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 | |
import AVFoundation | |
import Photos | |
/// | |
/// アルバム保存コントローラーサンプル | |
/// | |
class SaveAlbumSample: NSObject { |
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
/// | |
/// CstmVideoEditorController | |
/// | |
class CstmVideoEditorController: UIVideoEditorController { | |
/// | |
/// will appear | |
/// | |
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
for v in self.navigationBar.subviews { |
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
/// | |
/// アニメーション表示 | |
/// | |
self.constraintBottom.constant = 0 | |
UIView.animate(withDuration: 0.1, animations: { [weak self] in | |
self?.layoutIfNeeded() | |
}, completion: nil) | |
/// | |
/// アニメーション非表示 |
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 = "123456789" | |
/// | |
/// 先頭1文字 - 1 | |
/// | |
print("\(Str.substring(to: Str.index(after: Str.startIndex)))") | |
/// | |
/// 先頭1文字以外 - 23456789 | |
/// | |
print("\(Str.substring(from: Str.index(after: Str.startIndex)))") |
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
/// | |
/// UIPopoverPresentationControllerDelegate | |
/// | |
/// 画面の回転対応 | |
/// | |
func popoverPresentationController(_ popoverPresentationController: UIPopoverPresentationController, willRepositionPopoverTo rect: UnsafeMutablePointer<CGRect>, in view: AutoreleasingUnsafeMutablePointer<UIView>) { | |
let baseView = 起点としたいView | |
view.pointee = baseView | |
rect.pointee = baseView.bounds |
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
if [[ ${CONFIGURATION} == "Release" ]]; then | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PRODUCT_SETTINGS_PATH}") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PRODUCT_SETTINGS_PATH}" | |
echo "[UpdateBuildNumber Release] CFBundleVersion Increment ${buildNumber}" | |
else | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PRODUCT_SETTINGS_PATH}") | |
echo "[UpdateBuildNumber Debug] CFBundleVersion Not Increment ${buildNumber}" | |
fi |
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 _0_delay = 3.0 * Double(NSEC_PER_SEC) | |
let _0_time = DispatchTime.now() + Double(Int64(_0_delay)) / Double(NSEC_PER_SEC) | |
DispatchQueue.main.acyncAfter(deadline: _0_time, execute: { | |
}) | |
DispatchQueue.main.acyncAfter(deadline: DispatchTime.now() + Double(Int64(3.0 * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: { | |
}) |
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
curl \ | |
--header "Authorization: key=ご自身のAPI_KEY" \ | |
--header Content-Type:"application/json" \ | |
https://fcm.googleapis.com/fcm/send \ | |
-d "{ | |
\"to\" : \"/topics/何か適当に\", | |
\"time_to_live\" : 0, | |
\"restricted_package_name\" : \"bundle id\", | |
\"notification\" : { | |
\"sound\" : \"default\", |
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
/** | |
容量取得 | |
- returns: freeとtotalのサイズ取得 | |
*/ | |
static func GetDiskSize() -> (free: Double?, total: Double?) { | |
let _0_paths: NSArray = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.LibraryDirectory, NSSearchPathDomainMask.UserDomainMask, true) | |
let _0_last: String = _0_paths.lastObject as! String | |
do { | |
let _0_dic: NSDictionary = try NSFileManager.defaultManager().attributesOfFileSystemForPath(_0_last) | |
return ( |
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 share1() { | |
let shareText = "テキストテキスト\nテキストテキスト" | |
let shareWebsite = NSURL | |
let shareImage = UIImage | |
let activityItems = [ | |
shareText, | |
shareWebsite, | |
shareImage, | |
] | |
let vc = UIActivityViewController(activityItems: activityItems, applicationActivities: nil) |