Skip to content

Instantly share code, notes, and snippets.

View treastrain's full-sized avatar
🏠
Learning at home

treastrain / Tanaka Ryoga treastrain

🏠
Learning at home
View GitHub Profile
trash build
# https://help.apple.com/xcode/mac/current/#/dev544efab96
xcodebuild \
'ENABLE_BITCODE=YES' \
'BITCODE_GENERATION_MODE=bitcode' \
'OTHER_CFLAGS=-fembed-bitcode' \
'BUILD_LIBRARY_FOR_DISTRIBUTION=YES' \
'SKIP_INSTALL=NO' \
import PackageDescription
import Foundation
import Swift
extension PackageDescription.Product {
public static func iOSApplication(
name: Swift.String,
targets: [Swift.String],
bundleIdentifier: Swift.String? = nil,
teamIdentifier: Swift.String? = nil,
key en ja zh-HK zh-TW
FELICA_PASS_PROPERTIES_TICKET_SEAT_FORMAT %1$@-%2$@ %1$@-%2$@ %1$@-%2$@ %1$@-%2$@
PASS_VIEW_USER_ACTIVITY_TEMPLATE_NAME_NON_PAYMENT_TICKET ticket チケット 門票 門票
PROGRESS_ACTIVATING Card Activating… カードをアクティベート中… 正在啟用卡⋯ 正在啟用卡片⋯
PASS_MULTIPLE_CHANGES_BULLETIN_PASS Pass changed パスが変更されました 票證已更改 票卡已更改
PROGRESS_DOWNLOADING_CARD_IPAD Adding to Apple Pay… Apple Payに追加中… 正在加至Apple Pay⋯ 正在加入Apple Pay⋯
PROGRESS_CONTACTING_ISSUER Contacting the Card Issuer… カード発行元に問い合わせ中… 正在聯絡發卡機構⋯ 正在聯絡發卡機構⋯
PASS_VIEW_USER_ACTIVITY_TEMPLATE_NAME_NON_PAYMENT_BOARDING_PASS boarding pass 搭乗券 登機證 登機證
PASS_VIEW_USER_ACTIVITY_TEMPLATE_NAME_NON_PAYMENT_PASS pass パス 票證 票卡
key en ja zh-HK zh-TW
METRO_TRANSACTION_NOTIFICATION_TITLE_FORMAT "%@ for Metro" "%@(地下鉄)" "地鐵:%@" "地鐵%@"
EXPRESS_TRANSIT_EDUCATION_BODY_WATCH "Hold Apple Watch near a transit card reader to pay your fare with your card.\n\nAlways tap with the same card and device." "Apple Watchをカードリーダーにかざすとカードで運賃の支払いができます。\n\n常に同じデバイスで同じカードをタップしてください。" "將Apple Watch靠近交通卡讀卡器即可用卡支付車費。\n\n請總是使用同一張卡和裝置進行拍卡付款。" "將Apple Watch靠近大眾運輸讀卡機來使用卡片支付車資。\n\n永遠使用相同卡片和裝置感應。"
TRANSIT_OPEN_LOOP_EXPRESS_UPGRADE_MESSAGE_MARKET_NONE_FORMAT "Hold iPhone near a transit card reader to pay for transit with your “%1$@”. Tap to learn more." "iPhoneを交通系ICカードリーダーにかざすと、“%1$@”の運賃の支払いができます。詳しい情報を見るにはタップします。" "將iPhone靠近公共交通讀卡機以使用你的「%1$@」支付交通費。點一下以進一步了解。" "將iPhone靠近大眾運輸讀卡機來使用「%1$@」支付大眾運輸費用。點一下來瞭解更多內容。"
EXPRESS_TRANSIT_EDUCATION_BODY_DISABLEABLE "Hold iPhone near a transit card reader to pay your fare with your card. No Touch ID required.\n\nAlways tap with the same card on the same device.\n\nTo use a physical car
Available completions:
:_regexp-attach -- Attach to process by ID or name.
:_regexp-break -- Set a breakpoint using one of several shorthand formats.
:_regexp-bt -- Show the current thread's call stack. Any numeric argument displays at most that many frames. The argument 'all' displays all threads.
:_regexp-display -- Evaluate an expression at every stop (see 'help target stop-hook'.)
:_regexp-down -- Select a newer stack frame. Defaults to moving one frame, a numeric argument can specify an arbitrary number.
:_regexp-env -- Shorthand for viewing and setting environment variables.
:_regexp-jump -- Set the program counter to a new address.
:_regexp-list -- List relevant source code using one of several shorthand formats.
:_regexp-tbreak -- Set a one-shot breakpoint using one of several shorthand formats.
//
// CoreNFCProblemApp.swift
// CoreNFCProblem
//
// Created by treastrain on 2022/10/10.
//
import CoreNFC
import SwiftUI
@treastrain
treastrain / FormatStyle.md
Created March 26, 2023 17:37
Swift Foundation's `FormatStyle`

in Swift, use formatted methods directly on the types you want to format, optionally using FormatStyle and its subtypes to customize formatter output. This approach supports dates, integers, floating-point numbers, measurements, sequences, and person name components. Foundation caches identically-configured formatter instances internally, allowing you to focus on your app’s formatting needs.

Data Formatting | Apple Developer Documentation https://developer.apple.com/documentation/foundation/data_formatting

Numbers and Currency

Keybase proof

I hereby claim:

  • I am treastrain on github.
  • I am treastrain (https://keybase.io/treastrain) on keybase.
  • I have a public key ASBdL6Vgvw1nlMCihCWm5S1HnhdFPENkrBUewmLlwPbsrQo

To claim this, I am signing this object:

@treastrain
treastrain / NotCalledDeinitIfPrefersGrabberVisibleIsTrue.swift
Last active June 15, 2023 09:57
`UISheetPresentationController.prefersGrabberVisible` が `true` だったり、`View.presentationDragIndicator(_:)` が `.visible` だと deinit されない https://twitter.com/treastrain/status/1669271711269945344
//
// ViewController.swift
// SheetPresentationControllerPlayground
//
// Created by Ryoga Tanaka on 2023/06/15.
//
import UIKit
@available(iOS 16.4, *)
@treastrain
treastrain / ObservableObjectPlaygrounds.swift
Created July 3, 2023 04:06
Swift・SwiftUI・Combine・ObservableObject チャレンジ このコード例の場合、「object1 will change」・「object2 will change」・「object3 will change」はそれぞれそれぞれ何回 print されるか?
import Combine
import Foundation
// MARK: - パターン1
final class Object1: ObservableObject {
@Published var value1 = 0
@Published var value2 = 0
@Published var value3 = 0
}