Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
AltConf report - Hakata.swift #8
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
はるふ
June 25, 2019
Programming
400
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AltConf report - Hakata.swift #8
はるふ
June 25, 2019
More Decks by はるふ
See All by はるふ
SwiftのArrayは メモリで連続だよ!
ha1f
0
71
Other Decks in Programming
See All in Programming
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
340
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
130
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
400
スマート反転とウェブアクセシビリティ
camiha
0
210
新卒PdEのリアル
ryu1013
1
520
Building an Out-of-Order CPU
latte72
1
800
Java 27新機能 / Java 27 new features
kishida
2
170
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
350
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
530
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3.2k
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
8.4k
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5k
Featured
See All Featured
Paper Plane
katiecoart
PRO
4
53k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.9k
It's Worth the Effort
3n
188
29k
Evolving SEO for Evolving Search Engines
ryanjones
0
300
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
470
Done Done
chrislema
187
17k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
320
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
610
Leo the Paperboy
mayatellez
10
2.3k
GitHub's CSS Performance
jonrohan
1033
470k
Transcript
AltConf 2019 Ϩϙʔτ ୈ8ճ HAKATA.swift LINE Fukuoka Corporation Δ;(@_ha1f)
Δ;(@_ha1f) • iOS Developer @ LINE Fukuoka • WWDCམͪͨʢߦͬͨ͜ͱͳ͍ʣ •
͍·͕ࡾ
࠷ۙͷۀʹΧελϜελϯϓ • จࣈΛηοτͰ͖Δελϯϓ • ͪΖΜiOS෦ͷΈ • https://engineering.linecorp.com/ja/blog/product-story-01-custom-sticker/
Topic • AltConf@SanJoseʹࢀՃ • ӳޠͰొஃ͖ͯ͠·ͨ͠ʂ • αϯϊθશൠʹ͍ͭͯϨϙʔτ͠·͢ʂ
Agenda • αϯϊθͰͷੜ׆ʹ͍ͭͯ • AltConfʹ͍ͭͯ • ొஃʹ͍ͭͯ • ͓·͚
αϯϊθͰͷੜ׆ʹ͍ͭͯ
αϯϊθ • ӈԼͷͭ Apple Google Facebook • ΧϦϑΥϧχΞभʢւ ؛ʣ •
αϯϑϥϯγεί CaltrainͰ1࣌ؒ
ྑ͍ఔͷా-αϯϊθߦศ • ాۭߓͰΊͬͪΌຊਓiOSΤϯδχΞ • ඈߦػͰྡͷ੮͕͜͏Ί͍͞Μͩͬͨ
αϯϊθͬͯͲΜͳͱ͜ʁ • ాࣷ • Uber͕ͳ͍ͱੜ͖ΒΕͳ͍ • ຖշɺ͕ࠩ͠ڧ͍ ɹʢଟ໘Ͱۄম͖ম͚Δʣ Apple ParkͰࢠങͬͨ
αϯϊθͷؾԹ • னॵͯ͘ྋ͍͠ • ͳΜͱ࠷ߴؾԹ100ʂ
αϯϊθͷؾԹ • னॵͯ͘ྋ͍͠ • ͳΜͱ࠷ߴؾԹ100ʂ • ͱ͍͏ͷஊͰϗϯτઁࢯ38
https://amzn.to/2xa2eUF SIMΧʔυ • దʹAmazonͰങ͍ͬͯͬͨ • 10ؒLTE͍์ϓϥϯ2990ԁ
αεϕΠҿΈձ • ϕΠΤϦΞࡏॅͷຊਓͱͷަྲྀ • ຖ݄ͬͯΔΒ͍͠
৯ࣄ • ͏·͍ɺͰ͔͍ɺߴ͍ ʢϋϯόʔΨʔͰ1500ԁͱ͔ʣ • ଞࠃͷྉཧଟ͍
ϗςϧʹHomewood Suites by Hilton • WWDCظؒத͚ͩΫιߴ͍ ɹʢ1ധ2.5ສԁͩͬͨʣ • ձ͔ΒిंͰ30͙Β͍ ɹʢۙ͘ചʣ
ே৯͖
AltConfʹ͍ͭͯ
None
WWDC ߦ͖͍ͨʂ
Submit!
Not selected…
None
None
AltConfͱ • Alternative Apple Developer Conference • WWDCͱಉ͡ఔʢ༵ۚtry! Swiftʣ •
αϯϊθͷɺWWDCձͷۙ͘Ͱ։࠵
WWDC
WWDC AltConf
WWDC AltConf try!Swift
·͡ͰͱͳΓʂ
ࣸਅࡱΕΔ
Wi-Fi…… WWDC͕ ࠷େڧ
ࢀՃඅ༻ • ࢀՃඅ0ԁʢάοζͳ͠ʣ or 7000ԁʢάοζͳ͠ʣ ɹor 4ສԁʢάοζ͋Γʣ • WWDCͷࢀՃऀͱ͔༡ͼʹདྷΔʢ࣮࣭ೖνΣοΫͳ͠ʣ
AltConfͷ༰ᶃ • ॳWWDCͷύϒϦοΫϏϡʔΠϯά • ̎Ҏ͕߱ηογϣϯ
AltConfͷ༰ᶄ • 2 track + LABS + ग़ήʔϜ • 10ͷLT
or 45ͷsession • ࣗLT
ͳ͔ͥग़Δ͓ञ • ேே৯ʴίʔώʔ͕ͰΔ • ༦ํञ͕ग़Δ • શ෦ແྉ
ొஃʹ͍ͭͯ
AltConfͰͷొஃ༰(10) • A story of Mysterious Asian Strings • ຊޠ/λΠޠ/ؖࠃޠͷจࣈͷѻ͍ʹؔ͢ΔςΫχοΫ
• ӳޠऀશ֯֯ɺมͳͲͷ͕ࣝͳ͍ͷͰɺͦͷհ
AltConfͷCfP • CfPʹग़ͯ͠ɺબΜͰΒ͏ܗࣜ • ग़ͨ͠ͷ݄̑Լ०ʢకΊΓΪϦΪϦʣ
Yours is among those selected! • ϝʔϧ͕དྷͯɺإࣸਅͱ͔ͷఏग़ΛٻΊΒΕͨ
AltConfͷCfPͷબޙ • εΫϦʔϯͷॎԣൺͱ͔ڭ͑ͯ͘ΕΔ • ਐߦͷਓ͕ಡΉհจΛࣄલʹఏग़͢Δ • ࢿྉͷࣄલఏग़ͳͲͳ͠
ొஃલ • AltConfࣗମਓগͳΊʢWWDCͷϏσΦݟͯΔਓ͕ଟ͍ʣ
ొஃ
ొஃͷ݁Ռ • ࣭͕͋ͬͨͱΓ͋͑ͣͳΜͱ͔ͳͬͨʂ • ԠΒ͑ͨ
ӳޠྗʁ • ཹֶɾւ֎ࡏॅܦݧͳ͠ • େֶೖࢼͰษڧ ʴ ࣾձਓʹͳ͔ͬͯΒձࣾͰ • TOEIC 855ʢ1લ770ʣ
ͦͯ͠ɺࣄ݅ىͬͨ͜
ొஃޙ…… ༵ʹొஃͨ͠
༵ۚͷ • פؾ͕ͨ͠ • ࣮Ր༵͔Β͕௧͔ͬͨ • ొஃʹ͚ͯͷਫ਼ਆྗͰ͑ͯͨͷ͕Εͨ
༵ Mission1: ମԹͷ֬ೝ ମԹܭͳ͍ʁ ͳ͍Αʁମௐѱ͍ͷʁ ͬΆ͍ΜΑͶ ͡Ό͋ελοϑʹങ͍ʹߦ͔ ͤΔΑɻ܅͚࣋ͪͲ ͋Γ͕ͱ
100.8°F
100.8°F • ઁࢯ38.2 • શʹ
ϗϯτͬͱͬͱ͍ɻ Mission2: อݥձࣾి පӃߦ͖͍ͨ ʙʙʹߦ͍ͬͯͩ͘͞ ͓͚ ཱͯସ͑Δ͔Β͓ۚݱͰ Θͳ͍͍ͯ͘Α ఱ࠽
༵ͳͷͰEmergency͔͍͋ͯ͠ͳ͍ Regional Medical Center
όʔίʔυΛΊΒΕ·͢
ͷޙɺݕ߲ࠪҰཡΛΒ͍·͢ • Θ͔Γ͍͢
ϗϯτͬͱͬͱ͍ɻ Mission3: ҩऀͱͷձ ɻ௧͍ @L#P{$@#P{$:{P@# ͳΔ΄Ͳ $:#{}P@{%@}_P@#!_+%(#! @)_%@#:$$LP@#{$L#@{ શʹཧղͨ͠
ΊͬͪΌΉ͍ͣ ͚ͲͳΜͱ͔ཧղͰ͖Δ·Ͱ આ໌ͯ͘͠Εͨʂʂʂ
ణ
ༀہ·ͰUberɻ7000ԁ͙Β͍Ͱͨ͠ɻ ॲํᝦͱༀ ॲํᝦ ༀ
පӃ • ࣄલʹΊͬͪΌઆ໌ͯ͘͠ΕΔʢinformed consentʣ ɹɹɹɹ˞ཧղͰ͖Δ͔ผ • A4࢛ຕɺΊͬͪΌஸೡͳஅॻΒ͑ͨ • 4͙࣌ؒΒ͍Έͨ΄͏͕ྑ͍ •
ؼࠃޙʹපӃߦͬͨ
·ͱΊ
·͡ͰࢀՃͯ͠Α͔ͬͨʂ • ग़ͯ΄ΜͱʹߦͬͯΑ͔ͬͨ • ϦΞϧλΠϜͰηογϣϯΛݟΕΔɺٞͰ͖Δ ɹɹʢWWDCࢀՃऀͱʣ • ྔΛײ͡ΒΕΔʂʂ
͓͢͢Ί࣋ͪ • ࢠɺαϯάϥε • betaͷmacOS, iOSΛೖΕͯΑ͍ • SIMΧʔυɺ௺ΓɺମԹܭɺༀɺอݥ
On YouTube Vlog • ΞϝϦΧͰͪΐͬͱߘͨ͠ • https://www.youtube.com/channel/ UC20AZKltEpdZkKYalgBhLHA • νϟϯωϧొɺߴධՁΑΖ͘͠Ͷʂ
https://youtu.be/D7cqkOx3hsg Other videos… AltConfͷײΠϯλϏϡʔ
https://youtu.be/SllqSFylicY Other videos… lovee͞ΜWWDCΠϯλϏϡʔ
THANK YOU LINE FukuokaɹΔ;(@_ha1f) Follow @ha1f on Twitter! Follow Δ;'s
ΤϯδχΞ vlog on YouTube!
A story of Mysterious Asian Strings (for iOS) AltConf SanJose
2019 LINE Fukuoka Tomoki Yamaguchi a.k.a. @ha1f
Tomoki Yamaguchi @_ha1f • iOS Developer from Japan! • Working
for LINE Fukuoka (Communication application) • Call me “half”
Hello Asian World. উ֞ೞࣁਃ สวัสดีครับ ͜Μʹͪ 㟬
How do you work with asian characters? • Even Amazon,
Apple have problems ϑΟϧλʔ filter Ωϟϯηϧ Cancel
Full-width, Half-width • Most Japanese, Chinese, Korean characters are full-width
AB12 ̖̗̍̎ ͑ͼұ್ • Alphabets, numbers have both styles
Today’s purpose • Tell about some techniques for asian characters
• Knowing a little will help you!
Agenda • Text layout (current) • Character counting • Text
validation
Vertical Form • Japanese, Chinese, Korean can be represented with
vertical form • Supported by Kindle ॎ ॻ ͖ ͷ ߹ ӈ ͔ Β ࠨ ʹ ಡ Έ · ͢ ԣॻ͖ͷ߹ ࠨ͔Βӈʹ ಡΈ·͢ Vertical Scroll Horizontal Scroll
Thai language sometimes exceeds UILabel • CALayer.clipToBounds will cut them
• We should not set “clipToBounds” • Basically Thai language specific
Agenda • Text layout • Character counting • Text validation
Counting characters • There are many ways to count characters
e.g. UTF-8, grapheme cluster, unicode scalar, width, … • Apple’s default (String.count) is grapheme cluster
Counting alphabet characters is easy • Most counting methods return
the same value
Asian Strings are not so easy • Each method returns
a different length • “.count” is more likely to return what you expect! i.e. user-friendly (recommended)
Thai language counting How long is this String? ำำำำำำำำำำำำำำำำำำ
Thai language counting • We should also restrict with memory
size • Grapheme cluster counting returns 1
Agenda • Text layout • Character counting • Text validation
Can you find a bug? Suppose we want to prevent
from inputting text longer than 3 characters // Forbid text longer than 3 func textField( _ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String ) -> Bool { return (textField.text?.count ?? 0) < 3 }
Character conversion • One character can be a combination of
multiple characters • Even insert / delete don’t change the characters count • Works like replacing
We have to validate String after change • We have
to check characters limit after change func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { let currentText = textField.text ?? "" let newText = (currentText as NSString) .replacingCharacters(in: range, with: string) return newText.count <= 3 }
Even this has a bug! func textField(_ textField: UITextField, shouldChangeCharactersIn
range: NSRange, replacementString string: String) -> Bool { let currentText = textField.text ?? "" let newText = (currentText as NSString) .replacingCharacters(in: range, with: string) return newText.count <= 3 }
Even this has a bug! func textField(_ textField: UITextField, shouldChangeCharactersIn
range: NSRange, replacementString string: String) -> Bool { let currentText = textField.text ?? "" let newText = (currentText as NSString) .replacingCharacters(in: range, with: string) return newText.count <= 3 } Let’s check the value here
Result of “replacingCharacters” can be wrong • Input and Output
do not match • The result can be shortened after confirmation Don’t trust intermediate text Don’t prevent input during editing!! ͔͍ͭ͠Ό → ։ൃऀ
We have to validate String after change • We have
to limit characters after confirmation override func viewDidLoad() { super.viewDidLoad() textField.addTarget(self, action: #selector(handleChange(_:)), for: .editingDidEnd) } @objc func handleChange(_ textField: UITextField) { textField.text = textField.text.map { String($0.prefix(3)) } }
Conclusion 1. Be careful for character’s width and height 2.
Be careful for counting strategy 3. Don’t block input during editing
THANK YOU LINE FukuokaɹΔ;(@_ha1f) Follow @ha1f on Twitter!