Skip to content

Instantly share code, notes, and snippets.

View SatoTakeshiX's full-sized avatar

佐藤剛士 SatoTakeshiX

View GitHub Profile
@SatoTakeshiX
SatoTakeshiX / ContentView.swift
Last active April 11, 2020 13:30
SwiftUI Navigaiton
struct ContentView: View {
var body: some View {
NavigationView {
NavigationLink(destination: Text("sdetail")) {
Text("master")
.navigationBarTitle("nav", displayMode: .inline)
}
.navigationBarTitle("nav", displayMode: .large)
Text("detassssssil")
@SatoTakeshiX
SatoTakeshiX / CodePiece.swift
Created December 23, 2019 15:56
SwiftUIのButtonのタップ領域を広げるにはViewの方をpaddingする #CodePiece #SwiftUI
Button(action: doSomething) {
Text("Default padding")
.padding()
.background(Color.yellow)
}
@SatoTakeshiX
SatoTakeshiX / convert.swift
Last active August 31, 2023 09:10
Take capture a view by SwiftUI
//
// ContentView.swift
// TryGeometryReader
//
// Created by satoutakeshi on 2019/12/07.
// Copyright © 2019 satoutakeshi. Licensed under MIT.
//
import SwiftUI
@SatoTakeshiX
SatoTakeshiX / CodePiece.swift
Created November 26, 2019 13:38
TabbarとNavigationの組み合わせ、SwiftUIでうまくいかないぞ。。 #CodePiece #SwiftUI
struct ContentView: View {
var body: some View {
TabView {
NavigationView {
NavigationLink(destination: Text("Next Page")) {
BlueView()
}
}
.navigationBarTitle(Text("Landmarks"))
.tabItem {
@SatoTakeshiX
SatoTakeshiX / read.md
Last active July 9, 2019 05:33
ゴリゴリキャッチアップSwiftUI
@SatoTakeshiX
SatoTakeshiX / convert.swift
Created May 29, 2019 00:08
UIView convert method
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = UIColor.blue
let today = Date() //2018年12月18日に実行
// 中国の農暦 = 旧暦
let chineseCalendar = Calendar(identifier: .chinese)
let comp = chineseCalendar.dateComponents([.year, .month, .day], from: today)
print(comp.debugDescription)
// year: 35 month: 11 day: 12 isLeapMonth: false
@SatoTakeshiX
SatoTakeshiX / CodePiece.swift
Created December 18, 2018 04:46
Calendar型の.chineseは旧暦、中国の農暦を表すとのこと #swift #CodePiece
// 旧暦(農暦)
let chine = Calendar(identifier: .chinese)
@SatoTakeshiX
SatoTakeshiX / Fibonacci.swift
Created October 27, 2018 05:07
フィボナッチ数列
// インデックス番号を入れたらその番号のフィボナッチ数を出力
func fib(index: Int) -> Int {
guard index > 1 else { return 1 }
var a = 1
var b = 1
(2...index).forEach { (index) in
(a, b) = (a + b, a)
}
return a
@SatoTakeshiX
SatoTakeshiX / CodePiece.swift
Created October 8, 2018 03:20
LINE Messageing API、コンテンツ取得するさいのコンテンツの拡張子って何で調べればいいんだと悩んでいたらHeaderに書いてた。。 #結婚式パーティー余興 #CodePiece
GET https://api.line.me/v2/bot/message/{messageId}/content