Skip to content

Instantly share code, notes, and snippets.

View yotubarail's full-sized avatar
🏠
Working from home

Shota_T yotubarail

🏠
Working from home
View GitHub Profile
@yotubarail
yotubarail / SwiftUIModal.swift
Created August 13, 2020 01:44
SwiftUIでのModalの扱い方
import SwiftUI
struct ContentView: View {
@State var showModal = false
var body: some View {
Button(action: {
self.showModal.toggle()
}) {
Text("次のViewへ")
@yotubarail
yotubarail / ViewController.swift
Created April 13, 2020 07:38
Google AdMobのテスト
import UIKit
import GoogleMobileAds
class ViewController: UIViewController, GADBannerViewDelegate {
var bannerView: GADBannerView!
override func viewDidLoad() {
super.viewDidLoad()
@yotubarail
yotubarail / AppDelegate.swift
Created April 13, 2020 07:33
Google AdMobのテスト
import UIKit
import CoreData
import Firebase
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
@yotubarail
yotubarail / textViewInAlertView.swift
Created February 28, 2020 01:41
UIAlertControllerにUITextViewを追加
class ViewController: UIViewController, UITextViewDelegate {
@IBOutlet weak var memoTextView: ToucheEventTextView!
override func viewDidLoad() {
super.viewDidLoad()
@yotubarail
yotubarail / fbdisplayName.swift
Last active February 10, 2020 06:46
FIrebaseのdisplayNameとpictureURLの取得・更新
import UIKit
import Firebase
import SDWebImage
class accountViewController: UIViewController, UIImagePickerControllerDelegate,UINavigationControllerDelegate {
let firebaseAuth = Auth.auth()
let imagePick = UIImagePickerController()
@IBOutlet weak var profImage: UIImageView!
@yotubarail
yotubarail / AppDelegate.swift
Created February 3, 2020 01:45
Firebaseでのログイン維持
import UIKit
import CoreData
import Firebase
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
override init() {
@yotubarail
yotubarail / reception.js
Last active December 27, 2019 02:22
受付のJS
function slack() {
let xmlhttp = new XMLHttpRequest();
let webhook_url = 'https://hooks.slack.com/services/******/******';
let message = '{"username": "受付" ,"text":"受付でボタンが押されました", "icon_emoji": ":office:"}';
xmlhttp.open('POST', webhook_url, false);
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send(message);
location.href='reception2.html';
}
@yotubarail
yotubarail / MessageKitConfirmation.swift
Created October 7, 2019 00:54
MessageKitの動作確認用
import UIKit
import MessageKit
class ViewController: MessagesViewController {
var messageList: [MockMessage] = []
let dateFormatter:DateFormatter = DateFormatter() //日時のフォーマットを管理するもの
@yotubarail
yotubarail / imageChoose.swift
Last active May 20, 2019 07:13
Swiftで画像を複数選択
import Photos
import DKImagePickerController // 忘れないように
/* classにUIImagePickerControllerを書き加える
例: class ViewController: UIViewController, UIImagePickerController {
*/
@IBOutlet weak var imageView: UIImageView!