Skip to content

Instantly share code, notes, and snippets.

View kichiemon's full-sized avatar
🌴
I’m on Fiji time!

きちえもん kichiemon

🌴
I’m on Fiji time!
View GitHub Profile
@kichiemon
kichiemon / echo_xcode_uuid.sh
Created January 18, 2020 01:04
Check Xcode UUID. e.g. `./echo_xcode_uuid.sh Xcode.app`
#!/bin/sh
if [ $# = 1 ]; then
echo $(/usr/libexec/PlistBuddy -c 'Print DVTPlugInCompatibilityUUID' "/Applications/$1/Contents/Info.plist")
else
echo $(/usr/libexec/PlistBuddy -c 'Print DVTPlugInCompatibilityUUID' "/Applications/Xcode.app/Contents/Info.plist")
fi
@kichiemon
kichiemon / project.yml
Created November 27, 2019 14:35
project.yaml for XcodeGen
name: ApplicationName
options:
bundleIdPrefix: jp.kichiemon
targets:
ApplicationName:
type: application
platform: iOS
deploymentTarget: "13.0"
sources:
- path: ApplicationName
@kichiemon
kichiemon / Info.plist
Last active November 27, 2019 14:32
Info.plist for SwiftUI
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
@kichiemon
kichiemon / Info.plist
Last active November 27, 2019 14:18
default Info.plist created by Xcode.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- 言語設定:既定の言語・地域を言語IDで指定する。デフォルトは、en-US が設定されている。e.g. ja_JP -->
<!-- The default language and region for the bundle, as a language ID. -->
<!-- https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundledevelopmentregion -->
<!--
For a language used in many regions, use a code that represents a language designator.
To specify English, use the en language designator.
xcrun swift -version
extension UIView {
func drawCircle() {
let circlePath = UIBezierPath(ovalIn: self.bounds)
let circleShape = CAShapeLayer(layer: self.layer)
circleShape.frame = self.bounds
circleShape.path = circlePath.cgPath
circleShape.strokeColor = ColorName.primary.color.cgColor
circleShape.fillColor = Color.clear.cgColor
circleShape.lineWidth = 0.8
#if targetEnvironment(simulator)
// iOS simulator code
#endif
CATransaction.begin()
CATransaction.setCompletionBlock { [weak self] () in
self?.tableView.reloadData()
}
self.data = data
CATransaction.commit()
@kichiemon
kichiemon / makefile
Last active March 28, 2019 01:35
Generate iOS Project by Makefile
# curl rawURL -O
SHELL := /bin/bash
.PHONY: all
define setup_gem
bundle init
chmod +w Gemfile
echo "gem 'fastlane'" >> Gemfile
import UIKit
protocol PinterestLayoutDelegate: class {
func collectionView(_ collectionView:UICollectionView, heightForPhotoAtIndexPath indexPath:IndexPath) -> CGFloat
}
class PinterestLayout: UICollectionViewLayout {
fileprivate var numberOfColumns = 2
fileprivate var cellPadding: CGFloat = 6