Join Simon Allardice for an in-depth discussion in this video Processing the text files, part of Code Clinic: Swift.
- View Offline
- Exercise Files
- I don't want to underestimate…the code we need to write here.…We're still dealing with hundreds of thousands…of these data points in each of these text files.…So briefly, for each text file,…I need to read that into my application,…then break it apart into individual readings,…meaning line by line, then go through…those lines one by one, pull out the…wind speed, temperature and pressure numbers…and group those together for each day.…Then, I can calculate the mean and the median…of those numbers for each day,…and finally format and save that data…into CloudKit as a CloudKit record.…
This could of course be done several different ways.…Here's how I'm gonna do it.…First I'll add a new file to my project.…This is gonna be a Swift file.…And I'm going to use it to create a basic structure.…I'll call it Day.…This is very simple, a Swift struct…that will allow me to gather together…the 250 to 300 different readings we've been provided…for each measurement across each day…and ignore any data that we don't need.…It's really simple, it's just a date property.…
Simon introduces challenges and then provides an overview of his solutions in Swift. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Skill Level Intermediate
1. Problem One: Exploring Lake Pend Oreille
2. Problem Two: Image Analysis
3. Problem 3: Eight Queens
4. Problem 4 - Accessing Peripherals
5. Problem 5 - Recursion and Directories
6. Problem 6 - Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.