Skip to content

Instantly share code, notes, and snippets.

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

miharu mnaruse

🏠
Working from home
View GitHub Profile
@mnaruse
mnaruse / GeocoderService.swift
Last active July 17, 2020 15:14
Swift標準のCLGeocoderを使ったジオコーディングと逆ジオコーディング
//
// GeocoderService.swift
// myGeocoding
//
// Created by Miharu Naruse on 2020/05/20.
// Copyright © 2020 Miharu Naruse. All rights reserved.
//
// https://developer.apple.com/documentation/corelocation/converting_between_coordinates_and_user-friendly_place_names
// https://developer.apple.com/documentation/corelocation/clplacemark
// https://developer.apple.com/documentation/corelocation/clgeocoder
@mnaruse
mnaruse / XibView-basic.swift
Last active June 14, 2020 08:06
Creating a custom UIView from a XIB.
//
// XibView.swift
//
// Created by MiharuNaruse on 2020/06/14.
// Copyright © 2020 m_rn. All rights reserved.
//
// https://medium.com/better-programming/swift-3-creating-a-custom-view-from-a-xib-ecdfe5b3a960
//
import UIKit
@mnaruse
mnaruse / XibView-IBDesignable.swift
Created June 14, 2020 08:21
Creating a custom UIView from a XIB with IBDesinable.
//
// XibView-IBDesignable.swift
//
// Created by MiharuNaruse on 2020/06/14.
// Copyright © 2020 m_rn. All rights reserved.
//
/**
https://medium.com/zenchef-tech-and-product/how-to-visualize-reusable-xibs-in-storyboards-using-ibdesignable-c0488c7f525d
@mnaruse
mnaruse / Podfile-basic
Created June 14, 2020 10:34
Basic Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
abstract_target 'All' do
# Pods for All
pod 'SwiftGen'
@mnaruse
mnaruse / .swiftlint.yml
Created June 14, 2020 10:45
My favorite ".swiftlint.yml" file.
included:
- Practice_SwiftStyle
# - Source
# - Tests
# 対象外のファイル・フォルダ
excluded:
# - Tests/SwiftLintFrameworkTests/Resources
- Pods/
- Generated
@mnaruse
mnaruse / .swiftformat
Created June 14, 2020 10:48
My favorite ".swiftformat" file.
# file options
--exclude Pods,Generated
# format options
--allman false
--binarygrouping 4,8
--commas inline
--comments indent
@mnaruse
mnaruse / .swiftformat
Created June 14, 2020 10:48
My favorite ".swiftformat" file.
# file options
--exclude Pods,Generated
# format options
--allman false
--binarygrouping 4,8
--commas inline
--comments indent
@mnaruse
mnaruse / Podfile-favorite
Created June 14, 2020 10:53
My favorit "Podfile".
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
abstract_target 'All' do
# Pods for All
pod 'SwiftFormat/CLI'
if which "${PODS_ROOT}/SwiftLint/swiftlint" >/dev/null; then
git diff --name-only | grep .swift | while read filename; do
"${PODS_ROOT}/SwiftLint/swiftlint" --path "$filename"
done
else
echo "SwiftLint does not exist, download from https://github.com/realm/SwiftLint"
fi
if which "${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat" >/dev/null; then
"${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat" "$SRCROOT"
else
echo "SwiftFormat does not exist, download from https://github.com/nicklockwood/SwiftFormat"
fi