This UIButton changes own size like Snapchat buttons.
It will turn bigger during forcusing, and will turn default size when you release.
var legacyToken = "xoxb-xxx"; | |
var botUserId = "D020MGLFK0A"; | |
var targetChannelPatterns = ['times_.*']; | |
// WebHook用 Hook発言をしたユーザー情報を取得し、全てのchannelにinviteしてあげる | |
function doPost(e){ | |
var text = e.parameter.text.substring(e.parameter.trigger_word.length).trim(); | |
if(text != "招待して"){ | |
return postMessage(e.parameter.channel_id, "ちょっとよくわからないです"); |
const clickLikeButton = () => { | |
const buttons = document.getElementsByClassName("recsGamepad__button"); | |
if (buttons) { | |
const likeButton = buttons[3]; | |
likeButton.click(); | |
} else { | |
alert("no buttons"); | |
} | |
}; |
setInterval( | |
function () { | |
const elem = document.getElementsByClassName("recsGamepad__button"); | |
elem[3].click(); | |
}, 1000) |
import Hydra | |
// このようなダイアログが出るメソッドがあるとします。 | |
func showOKDialog(completion: (() -> Void)? = nil){ | |
let alert: UIAlertController = UIAlertController(title: "hoge", message: nil, preferredStyle: .alert) | |
let defaultAction = UIAlertAction(title: ok, style: .default, handler: { _ in | |
completion?() | |
}) | |
alert.addAction(defaultAction) | |
present(alert, animated: true, completion: nil) |
import ReplayKit | |
func startRecording() { | |
let recorder = RPScreenRecorder.shared() | |
recorder.isMicrophoneEnabled = true | |
recorder.startRecording(handler: { error in | |
if let error = error { | |
NSLog("Failed start recording: \(error.localizedDescription)") | |
return | |
} |
import UIKit | |
enum TutorialNumber { | |
case first | |
case second | |
} | |
protocol TutorialVC: class { | |
var number: TutorialNumber { get set } | |
} |
import AVFoundation | |
import Hydra | |
import Photos | |
struct VideoUtils { | |
// 動画の保存名 | |
private static let logoVideoName = "logo.mp4" | |
private static let muteVideoName = "mute.mp4" | |
// 加工タイプ |
private let device = MTLCreateSystemDefaultDevice()! | |
private var fadingNode: SCNNode? | |
extension ViewController: ARSCNViewDelegate { | |
func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) { | |
guard let planeAnchor = anchor as? ARPlaneAnchor else { | |
return | |
} |
protocol Repository { | |
func fetchInt() -> Int | |
} | |
class RepositoryImpl: Repository { | |
func fetchInt() -> Int { | |
// 通信する | |
let api = API() |