Skip to content

Instantly share code, notes, and snippets.

@kalupas226
kalupas226 / Sample.swift
Created December 23, 2022 16:04
SwiftUI debounce sample
import SwiftUI
struct ContentView: View {
@State private var query = ""
var body: some View {
TextField(
"Input text",
text: $query
)
@kalupas226
kalupas226 / FB11810368.md
Last active November 22, 2022 01:24
Popover (or sheet) is not working when Menu, Picker, etc is displayed.

FB11810368: Popover and sheet are not working when Menu, Picker, etc is displayed.

Environment: Xcode 14.1, iOS 16 (on iPad)

Popover (or sheet) is not working when Menu, Picker, etc is displayed.

struct ContentView: View {
 @State private var showPopover = false
@kalupas226
kalupas226 / open-on-github-in-xcode.workflow
Last active October 27, 2023 15:52
AppleScript that allows you to switch to GitHub web page from code on Xcode
-- ref
-- - https://github.com/wojteklu/xcode-open-on-github
-- - http://tonbi.jp/AppleScript/Tips/Scripting/Debug.html
-- - https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/CallCommandLineUtilities.html
on run {input, parameters}
tell application "Xcode-14.0.0"
set activeDocument to document 1 whose name ends with (word -1 of (get name of window 1))
set activeDocumentPath to path of activeDocument
set currentLines to selected paragraph range of activeDocument
set startLine to get item 1 of currentLines

FB11288574: VStack or other Stack View in NavigationView in TabView bug

Environment: Xcode 13.4.1, iOS 15

If we use VStack or other Stack View in NavigationView in TabView, onAppear will be called twice.

struct SampleView: View {
  var body: some View {
 TabView {
@kalupas226
kalupas226 / JapaneseTCA.md
Last active December 13, 2023 06:00
A Japanese translation of The Composable Architecture's README.md

The Composable Architecture

CI Slack

The Composable Architecture (省略すると TCA) は、コンポジション、テスト、開発者にとっての使いやすさを考慮し、一貫性のある理解しやすい方法でアプリケーションを構築するためのライブラリです。SwiftUI、UIKit などで使用することができ、Apple のどのプラットフォーム (iOS, macOS, tvOS, watchOS) でも使用