Skip to content

Instantly share code, notes, and snippets.

Working from home

Kishikawa Katsumi kishikawakatsumi

Working from home
Block or report user

Report or block kishikawakatsumi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kishikawakatsumi / DispatchGroup.swift
Last active Feb 29, 2020
Executing asynchronous tasks sequentially in Swift
View DispatchGroup.swift
let q = DispatchQueue(label: "q")
let group = DispatchGroup()
q.async {
loadA(completion: {
// Do something...
View TabView.swift
import SwiftUI
struct TabView: View {
var views: [TabBarItem]
@State var selectedIndex: Int = 0
init(_ views: [TabBarItem]) {
self.views = views
View Download and push bitrise.yml
lane :sync_bitrise_yml do
if !ENV['CI']
Dir.chdir("#{ENV['PWD']}") do
sh "curl -O -H 'Authorization: token #{ENV['BITRISE_ACCESS_TOKEN']}' '{ENV['BITRISE_APP_SLUG']}/bitrise.yml'"
unless system('git diff --quiet --exit-code')
sh 'git add bitrise.yml'
View CocoaPods Pre-Built binaries
set -exo pipefail
PROJECT_ROOT=$(cd $(dirname $0); cd ..; pwd)
(cd "$PROJECT_ROOT"; bundle install --path=vendor/bundle --binstubs=vendor/bin)
View Podfile
platform :ios, '10.3'
install! 'cocoapods', integrate_targets: false
target 'Shared' do
View gist:157ea34bb32aaa25ffe45ff40262e3bc
#!/usr/bin/env bash
git reset --hard
git checkout $1
xcodebuild build -scheme Demo -sdk iphonesimulator -derivedDataPath build
xcrun simctl install 89955894-3580-47CE-86FD-5C3E41850418 ~/work/Demo/build/Build/Products/Debug-iphonesimulator/
xcrun simctl install F28EC412-2D31-4F56-9705-670823B8B554 ~/work/Demo/build/Build/Products/Debug-iphonesimulator/
View setup
set -ex
bundle install --path=vendor/bundle --binstubs=vendor/bin
bundle exec pod install
carthage checkout
carthage build --no-use-binaries --platform ios --cache-builds BonMot
carthage build --no-use-binaries --platform ios --cache-builds bugsnag-cocoa
kishikawakatsumi / UIScrollView+UIPageControl.swift
Created Apr 29, 2018
UIScrollView + UIPageControl with RxSwift
View UIScrollView+UIPageControl.swift
import RxSwift
import RxCocoa
fileprivate extension Reactive where Base: UIScrollView {
fileprivate var currentPage: Observable<Int> {
let pageWidth = self.base.frame.width
let page = floor((self.base.contentOffset.x - pageWidth / 2) / pageWidth) + 1
return Int(page)
kishikawakatsumi / OptionParser.swift
Created Apr 5, 2018
SwiftPM ArgumentParser usage
View OptionParser.swift
let parser = ArgumentParser(commandName: "swiftfmt", usage: "swiftfmt filename [options]", overview: "Format Swift source code")
let filenameArgument = parser.add(positional: "filename", kind: String.self)
let configrationOption = parser.add(option: "--configuration", kind: String.self)
let versionOption = parser.add(option: "--version", kind: Bool.self)
let verboseOption = parser.add(option: "--verbose", kind: Bool.self, usage: "Show more debugging information")
let result = try parser.parse(Array(CommandLine.arguments.dropFirst()))
if let version = result.get(versionOption) {
print("Swiftfmt 0.1.0")
kishikawakatsumi / Info.plist
Created Oct 5, 2016
NSAllowsArbitraryLoads=YES on debug build
View Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
You can’t perform that action at this time.