๐Ÿ‘†Long Press

SwiftUI โŸฉ Gestures โŸฉ Long Press

โญ๏ธ .onEnded()

  • ๅชๆœ‰ๆ™‚้–“ๆŒ‰่ถ…้Ž minimumDuration ๆ‰ๆœƒ่งธ็™ผโ—๏ธ

  • if the user stops touching the view before minimumDuration seconds have elapsed or moves their finger more than maximumDistance points SwiftUI does not invoke the onEnded(_:) callback.

โญ๏ธ .onChanged()

  • ๅช่ฆๆ‘ธๅˆฐ๏ผŒๅฐฑๆœƒ่งธ็™ผ๏ผŒไฝ†ใ€Œๅช่งธ็™ผไธ€ๆฌกใ€๏ผŒๅฐฑ็ฎ—ๆ‘ธๅ†ไน…๏ผŒไนŸๅช่งธ็™ผไธ€ๆฌก๏ผŒไธๆœƒ้€ฃ็บŒ่งธ็™ผ๏ผŒ้™„้€็š„ value ็ธฝๆ˜ฏ trueใ€‚ไฝ†ใ€Œๆฏๆ‘ธไธ€ๆฌก๏ผŒๅฐฑ่งธ็™ผไธ€ๆฌกใ€ใ€‚

Last updated