Slide 1

Slide 1 text

TBUPTIJO!BTLFO*OD %BUF$PNQPOFOUTͱ ஥ྑ͘ͳΔɹ J04%$+BQBO

Slide 2

Slide 2 text

ຊηογϣϯʹ͍ͭͯ %BUF$PNQPOFOUTͱ஥ྑ͘ͳΔɹ

Slide 3

Slide 3 text

ຊηογϣϯʹ͍ͭͯ %BUF$PNQPOFOUTͱ஥ྑ͘ͳΔɹ ࠓɺ೤͍࿩୊ʁ

Slide 4

Slide 4 text

ຊηογϣϯʹ͍ͭͯ %BUF$PNQPOFOUTͱ஥ྑ͘ͳΔɹ ࠓɺ೤͍࿩୊ʁ %BUF$PNQPOFOUT͸J04

Slide 5

Slide 5 text

ຊηογϣϯʹ͍ͭͯ %BUF$PNQPOFOUTͱ஥ྑ͘ͳΔɹ J04ʹؔ͢Δʁ

Slide 6

Slide 6 text

ຊηογϣϯʹ͍ͭͯ %BUF$PNQPOFOUTͱ஥ྑ͘ͳΔɹ J04ʹؔ͢Δʁ

Slide 7

Slide 7 text

ຊηογϣϯʹ͍ͭͯ %BUF$PNQPOFOUTͱ஥ྑ͘ͳΔɹ ೔࣌ܭࢉΛ%BUFͰࡁ·ͤͪΌͬͯΔਓ %BUF$PNQPOFOUTΛ͋Μ·Γ࢖ͬͨ͜ͱ͕ͳ͍ਓ ͦΜͳਓͷͨΊͷηογϣϯͰ͢ɻ

Slide 8

Slide 8 text

࣌ؒͷجૅ

Slide 9

Slide 9 text

࣌ؒ͸ͲͷΑ͏ʹఆٛ͞ΕΔʁ

Slide 10

Slide 10 text

࣌ؒ͸ͲͷΑ͏ʹఆٛ͞ΕΔʁ ࣌ؒ࣠

Slide 11

Slide 11 text

࣌ؒ͸ͲͷΑ͏ʹఆٛ͞ΕΔʁ ࠓ ࣌ؒ࣠

Slide 12

Slide 12 text

࣌ؒ͸ͲͷΑ͏ʹఆٛ͞ΕΔʁ ࠓ ج४఺ ࣌ؒ࣠

Slide 13

Slide 13 text

࣌ؒ͸ͲͷΑ͏ʹఆٛ͞ΕΔʁ ࠓ ج४఺ ௕͞ ࣌ؒ࣠

Slide 14

Slide 14 text

࣌ؒ͸ͲͷΑ͏ʹఆٛ͞ΕΔʁ ࠓ ج४఺ ௕͞ ࣌ؒ࣠ ༗໊ͳج४఺ɿ 6/*9ΤϙοΫ 65$

Slide 15

Slide 15 text

࣌ؒ͸ͲͷΑ͏ʹఆٛ͞ΕΔʁ ࠓ ج४఺ ௕͞<ඵ> ࠃࡍ୯Ґܥʢ4*ʣͰఆٛ͞ΕΔ࣌ؒͷ୯Ґ͕ඵ ࣌ؒ࣠ ༗໊ͳج४఺ɿ 6/*9ΤϙοΫ 65$

Slide 16

Slide 16 text

4XJGUͰ࣌ؒΛදݱ͢Δܕ͸ʁ %BUF

Slide 17

Slide 17 text

4XJGUͰ͸ͲͷΑ͏ʹදݱ͞ΕΔʁ %BUF init(timeIntervalSinceNow: ) init(timeIntervalSince1970: ) init(timeIntervalSinceReferenceDate: ) init(timeInterval: since: ) init()

Slide 18

Slide 18 text

4XJGUͰ͸ͲͷΑ͏ʹදݱ͞ΕΔʁ init(timeIntervalSinceNow: ) init(timeIntervalSince1970: ) init(timeIntervalSinceReferenceDate: ) init(timeInterval: since: ) init() %BUF

Slide 19

Slide 19 text

4XJGUͰ͸ͲͷΑ͏ʹදݱ͞ΕΔʁ init(timeIntervalSinceNow: ) init(timeIntervalSince1970: ) init(timeIntervalSinceReferenceDate: ) init(timeInterval: since: ) init() = init(timeIntervalSinceNow: 0) %BUF

Slide 20

Slide 20 text

%BUF㱠೔෇ %BUF࣌ؒͷ఺

Slide 21

Slide 21 text

೥ʁ݄ʁ೔ʁ ඵ͔͠஌Βͳ͍Αʂ %BUF㱠೔෇ %BUF࣌ؒͷ఺

Slide 22

Slide 22 text

೔࣌ܭࢉͷ೉͠͞

Slide 23

Slide 23 text

଍͠ࢉ͢Δ let after10Sec = Date() + 10 let after1Minute = Date() + 60 let after1Day = Date() + (60 * 60 * 24) let after1Month = Date() + (60 * 60 * 24 * 30)

Slide 24

Slide 24 text

଍͠ࢉ͢Δ ! let after10Sec = Date() + 10 let after1Minute = Date() + 60 let after1Day = Date() + (60 * 60 * 24) let after1Month = Date() + (60 * 60 * 24 * 30)

Slide 25

Slide 25 text

೔࣌ܭࢉͰߟྀ͠ͳ͚Ε͹͍͚ͳ͍͜ͱ ͏Δ͏೥ͷଘࡏ ϲ݄ͷఆٛ αϚʔλΠϜ ͏Δ͏ඵͷଘࡏ ೥ ೔ ϲ݄ ೔ ೔ ࣌ؒ ෼ ඵ

Slide 26

Slide 26 text

ʌůɾ㱼ɾA ŷžŷž

Slide 27

Slide 27 text

೔࣌ܭࢉΫϥε$BMFOEBS

Slide 28

Slide 28 text

೔࣌ܭࢉΫϥε$BMFOEBS let calendar = Calendar(identifier: .gregorian) let after1Month = calendar.date(byAdding: .month, value: 1, to: Date())

Slide 29

Slide 29 text

໰୊ ʮੜ೥݄೔Λ%BUFͰදݱͰ͖Δ͔ʁʯ

Slide 30

Slide 30 text

ੜ೥݄೔Λ%BUFͰදݱͯ͠ΈΔ let birthday = Date(timeIntervalSince1970: 656_175_600) let formatter = DateFormatter() formatter.dateFormat = "yyyy-MM-dd" formatter.timeZone = TimeZone(abbreviation: "UTC") print(formatter.string(from: birthday))

Slide 31

Slide 31 text

ੜ೥݄೔Λ%BUFͰදݱͯ͠ΈΔ let birthday = Date(timeIntervalSince1970: 656_175_600) let formatter = DateFormatter() formatter.dateFormat = "yyyy-MM-dd" formatter.timeZone = TimeZone(abbreviation: "UTC") print(formatter.string(from: birthday)) 1990-10-18 00:00:00 +09:00

Slide 32

Slide 32 text

ੜ೥݄೔Λ%BUFͰදݱͯ͠ΈΔ let birthday = Date(timeIntervalSince1970: 656_175_600) let formatter = DateFormatter() formatter.dateFormat = "yyyy-MM-dd" formatter.timeZone = TimeZone(abbreviation: "UTC") print(formatter.string(from: birthday)) 1990-10-18 00:00:00 +09:00 1990-10-17

Slide 33

Slide 33 text

%BUF࣌ؒͷ఺ ஀ੜ೔ͳͲͷදݱʹ͸޲͔ͳ͍

Slide 34

Slide 34 text

%BUF࣌ؒͷ఺ ੜ೥݄೔ͳͲͷදݱʹ͸޲͔ͳ͍

Slide 35

Slide 35 text

%BUF࣌ؒͷ఺ ੜ೥݄೔ͳͲͷදݱʹ͸޲͔ͳ͍ ࠓ೔ɺࠓ݄ɺࠓ೥ɺه೦೔ɺFUD λΠϜκʔϯʹґଘ͠ͳ͍೔࣌Λਖ਼֬ʹදݱͰ͖ͳ͍

Slide 36

Slide 36 text

೔෇ͰදݱͰ͖Δܕ͕͋ͬͨΒͳ͊ɻɻɻ

Slide 37

Slide 37 text

%BUF$PNQPOFOUT

Slide 38

Slide 38 text

let calendar = Calendar(identifier: .gregorian) let birthday = DateComponents(calendar: calendar, year: 1990, month: 10, day: 18)

Slide 39

Slide 39 text

%BUF$PNQPOFOUTͷ *OJUJBMJ[FS͔Βಛ௃ΛݟΔ

Slide 40

Slide 40 text

%BUF$PNQPOFOUT JOJUJBMJ[FS DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 41

Slide 41 text

ͭш㱬 ŠƄŢŠƄŢ

Slide 42

Slide 42 text

%BUF$PNQPOFOUT JOJUJBMJ[FS DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 43

Slide 43 text

%BUF$PNQPOFOUT JOJUJBMJ[FS ͳΜͱҾ਺ݸʂ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 44

Slide 44 text

%BUF$PNQPOFOUT ೔࣌Λߏ੒͢Δཁૉ܈

Slide 45

Slide 45 text

%BUF$PNQPOFOUT JOJUJBMJ[FS શͯ೔࣌ͷߏ੒ཁૉ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 46

Slide 46 text

ͭͷཁૉຖ͸؆୯

Slide 47

Slide 47 text

%BUF$PNQPOFOUT JOJUJBMJ[FS ΧϨϯμʔ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 48

Slide 48 text

%BUF$PNQPOFOUT JOJUJBMJ[FS λΠϜκʔϯ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 49

Slide 49 text

%BUF$PNQPOFOUT JOJUJBMJ[FS ࣌୅ ݩ߸ HSFHPSJBOΧϨϯμʔͷ৔߹ لݩલ ੢ྐྵ ࿨ྐྵΧϨϯμʔͷ৔߹ େԽ ฏ੒ ྩ࿨ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 50

Slide 50 text

%BUF$PNQPOFOUT JOJUJBMJ[FS ೥݄೔࣌෼ඵφϊඵ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 51

Slide 51 text

%BUF$PNQPOFOUT JOJUJBMJ[FS ༵೔ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 52

Slide 52 text

%BUF$PNQPOFOUT JOJUJBMJ[FS ͦͷ༵೔͕Կ൪໨͔ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?) ݄ͷୈ ೔༵೔

Slide 53

Slide 53 text

%BUF$PNQPOFOUT JOJUJBMJ[FS ࢛൒ظ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 54

Slide 54 text

%BUF$PNQPOFOUT JOJUJBMJ[FS ͦͷ݄ͷԿि໨͔ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?) ݄ͷୈि໨

Slide 55

Slide 55 text

%BUF$PNQPOFOUT JOJUJBMJ[FS ͦͷ೥ͷԿि໨͔ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 56

Slide 56 text

%BUF$PNQPOFOUT JOJUJBMJ[FS ೥ʢXFFLPGZFBS༻ʣ DateComponents(calendar: Calendar?, timeZone: TimeZone?, era: Int?, year: Int?, month: Int?, day: Int?, hour: Int?, minute: Int?, second: Int?, nanosecond: Int?, weekday: Int?, weekdayOrdinal: Int?, quarter: Int?, weekOfMonth: Int?, weekOfYear: Int?, yearForWeekOfYear: Int?)

Slide 57

Slide 57 text

%BUF$PNQPOFOUT͸Ͳ͏࢖͏ʁ

Slide 58

Slide 58 text

ࡾͭͷ໾ׂ ೔࣌ ྔ ύλʔϯϚον

Slide 59

Slide 59 text

ࡾͭͷ໾ׂ ೔࣌ %BUF$PNQPOFOUT%BUF

Slide 60

Slide 60 text

೔࣌ DateComponents => Date let today = DateComponents(calendar: gregorianCalendar, year: 2021, month: 9, day: 19) var todayInJp = today todayInJp.timeZone = TimeZone(abbreviation: "JST") todayInJp.date // 2021-09-19 00:00:00 +09:00

Slide 61

Slide 61 text

೔࣌ DateComponents => Date let today = DateComponents(calendar: gregorianCalendar, year: 2021, month: 9, day: 19) var todayInJp = today todayInJp.timeZone = TimeZone(abbreviation: "JST") todayInJp.date // 2021-09-19 00:00:00 +09:00

Slide 62

Slide 62 text

೔࣌ Date => DateComponents let today = gregorianCalendar .dateComponents([.calendar, .year, .month, .day], from: Date())

Slide 63

Slide 63 text

೔࣌ let today = gregorianCalendar .dateComponents([.calendar, .year, .month, .day], from: Date()) Date͔Β Calendarͱ೥݄೔͕ઃఆ͞Εͨ DateComponentsΛੜ੒ Date => DateComponents

Slide 64

Slide 64 text

ʮࠓ೔ʯͷදݱྫ

Slide 65

Slide 65 text

ʮࠓ೔ʯͷදݱྫ

Slide 66

Slide 66 text

೔࣌ ʮࠓ೔ʯͷදݱྫ // 2021೥9݄19೔ let today = DateComponents(calendar: gregorianCalendar, year: 2021, month: 9, day: 19) today.isValidDate // true

Slide 67

Slide 67 text

೔࣌ ʮࠓ೔ʯͷදݱྫ // 2021೥9݄ͷୈ3,೔༵೔ let today = DateComponents(calendar: gregorianCalendar, year: 2021, month: 9, weekday: 1, weekdayOrdinal: 3) today.isValidDate // true

Slide 68

Slide 68 text

೔࣌ ʮࠓ೔ʯͷදݱྫ // 2021೥ͷ262೔໨ let today = DateComponents(calendar: gregorianCalendar, year: 2021, day: 262) today.isValidDate // false

Slide 69

Slide 69 text

೔࣌ ʮࠓ೔ʯͷදݱྫʢ❌ʣ // 2021೥ͷ262೔໨ let today = DateComponents(calendar: gregorianCalendar, year: 2021, day: 262) today.isValidDate // false 2021೥1݄262೔ͱ൑ఆ͞Εɺfalse

Slide 70

Slide 70 text

೔࣌ ʮࠓ೔ʯͷදݱྫ // 2021೥ͷୈ38,೔༵೔ let today = DateComponents(calendar: gregorianCalendar, year: 2021, weekday: 1, weekdayOrdinal: 38) today.isValidDate // false

Slide 71

Slide 71 text

೔࣌ ʮࠓ೔ʯͷදݱྫʢ❌ʣ // 2021೥ͷୈ38,೔༵೔ let today = DateComponents(calendar: gregorianCalendar, year: 2021, weekday: 1, weekdayOrdinal: 38) today.isValidDate // false 2021೥1݄ͷୈ38,೔༵೔ͱ ൑ఆ͞Εɺfalse

Slide 72

Slide 72 text

ࡾͭͷ໾ׂ ྔ ௕͞

Slide 73

Slide 73 text

ྔ ೔࣌ܭࢉͷ͓ڙʹ let oneMonth = DateComponents(month: 1) // ̍ϲ݄ let oneMonthLater = calendar.date(byAdding: oneMonth, to: Date())

Slide 74

Slide 74 text

ྔ ೔࣌ܭࢉͷ͓ڙʹ let oneMonth = DateComponents(month: 1) // ̍ϲ݄ let oneMonthLater = calendar.date(byAdding: oneMonth, to: Date())

Slide 75

Slide 75 text

ࡾͭͷ໾ׂ ύλʔϯϚον

Slide 76

Slide 76 text

ύλʔϯϚον UserNotificationͷTriggerදݱͳͲ let wakeUpAlertTime = DateComponents(hour: 8, minute: 30) let trigger = UNCalendarNotificationTrigger( dateMatching: wakeUpAlertTime, repeats: true)

Slide 77

Slide 77 text

ύλʔϯϚον UserNotificationͷTriggerදݱͳͲ let wakeUpAlertTime = DateComponents(hour: 8, minute: 30) let trigger = UNCalendarNotificationTrigger( dateMatching: wakeUpAlertTime, repeats: true)

Slide 78

Slide 78 text

ύλʔϯϚον UserNotificationͷTriggerදݱͳͲ let wakeUpAlertTime = DateComponents(hour: 8, minute: 30 weekday: 1) let trigger = UNCalendarNotificationTrigger( dateMatching: wakeUpAlertTime, repeats: true)

Slide 79

Slide 79 text

ύλʔϯϚον UserNotificationͷTriggerදݱͳͲ let wakeUpAlertTime = DateComponents(hour: 8, minute: 30 weekday: 1) let trigger = UNCalendarNotificationTrigger( dateMatching: wakeUpAlertTime, repeats: true) ೔༵೔ͷ8࣌30෼

Slide 80

Slide 80 text

5JQT

Slide 81

Slide 81 text

5JQT DateComponents(hour: 12)

Slide 82

Slide 82 text

5JQT ྔΛද͢ͷ࣌ؒʁ ύλʔϯϚονͷ࣌ʁ DateComponents(hour: 12)

Slide 83

Slide 83 text

5JQT %BUF$PNQPOFOUT͕ͲΜͳҙຯΛ͔࣋ͭ͸ɺίϯςΩετʹΑͬͯҟͳΔɻ ࠞཚ͢Δ৔߹ʹ͸ɺϥούʔΫϥεΛ࡞Δͷ͕͓͢͢Ίɻ // ྔతදݱʹݶఆ͢Δ struct DateLength { var value: DateComponents }

Slide 84

Slide 84 text

·ͱΊ %BUF͸࣌ؒͷ఺Ͱ͋Γɺѻ͏୯Ґ͸ඵͷΈ ඵҎ֎୯ҐͰܭࢉΛߦ͏৔߹͸$BMFOEBSΛ࢖͏ %BUF$PNQPOFOUT͸೔࣌Λߏ੒͢Δཁૉ܈Ͱ ओʹʮ೔࣌ɺྔɺύλʔϯϚονʯͷ໾ׂͰ࢖ΘΕΔ

Slide 85

Slide 85 text

͚͋͢Μઈࢍ֦େதʂ J04%$ΰʔϧυεϙϯαʔɻ͚͋͢ΜϝΨω১͖࢖ͬͯͶʂ ࠃ಺ʮϔϧεέΞʯΧςΰϦͰ೥౓ͷ%-਺ɺऩӹ/Pʂ 5FDIϒϩά࢝Ί·ͨ͠ʂ 🥇 📖 🎩

Slide 86

Slide 86 text

͚͋͢Μઈࢍ֦େதʂ 5FDIϒϩάϦϯΫ ຊηογϣϯͷิ଍هࣄ΋ॻ͖·ͨ͠ɻ ͥͻνΣοΫͯ͠Έ͍ͯͩ͘͞ʂ https://tech.asken.inc

Slide 87

Slide 87 text

No content