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
golang-bob.pdf
iwatsukayura
0
130
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
Event is what happens
moro
2
770
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
Agents on Rails - Rails at Scale 2026
irinanazarova
0
560
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
残高管理から台帳サービスへの進化
artoy
1
200
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
190
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
180
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
270
すこし踏み込む CancellationToken
htkym
2
1.7k
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Done Done
chrislema
187
17k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Unsuck your backbone
ammeep
672
58k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
370
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
67k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
310
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
780
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!