📜 ⬆️ ⬇️

Stanford Courses CS193P Winter 2017: Developing iOS 10 Applications with Swift



Stanford University, USA - one of the best in the world in the field of computer science (Computer Science). He generously shares his courses, and one of the most popular and successful courses is the CS193P course on application development on iOS, which Professor Paul Hagerty reads. This course is taught annually, starting in 2010. Currently the CS193P “Developing iOS 10 Apps with Swift” course is relevant, Winter 2017 - “Developing iOS 10 apps using Swift”, and all 17 Lectures and 5 Tasks on iTunes U have already been posted (but you can also watch on Youtube ) .
In the new course it is clearly seen that the professor made a small reversal of the entire course from OBJECT-ORIENTED programming, to FUNCTIONAL programming with a multitude of immutable objects with APIs similar to mathematical functions.
Of course, iOS was not designed at all based on the idea of ​​functional programming. But the people who invented Swift kept the idea of ​​functional programming “in their head”. So when developing your iOS application (at least in the Model part), you can use a variety of functional programming elements.

This is a new frontier in iOS programming, because for 10 years, people mainly used only reference type objects in iOS programming, bearing in mind the concept of object-oriented programming. But when you program in Swift using structs and enums , and especially if you enums the protocols and Generics protocol mechanisms, you can really do an excellent job dealing with real functional programming.

And starting right from Lecture 1 and Assignment 2 of the new course, the accents are set quite differently. Now in the first place are value types , and about reference types - only in passing, in detail about the structs structures and enums , and about classes classes - just a glimpse. In great detail about the Range<T> ranges and about the conditions under which Range<T> becomes the Sequence sequence and allows you to apply the for in syntax to yourself.
')
He begins the professor with a very detailed story about the syntax of Swift 3 and the capabilities of Xcode 8. Literally explains each character. Further, it shows how to design a Model using a struct , based on the public API Model, how to achieve extensible functionality in struct structures, because we cannot use the creation of subclass , as in the class class . The creation of nested struct and enum shown. On very short code fragments, it is explained when it is necessary to use Optional , and when not to, based on the semantic content of Optional . Much attention is paid to enum that have associated values ​​of any type, including closures. Such features of the properties as the willSet{} and didSet {} observers and the lazy delayed initialization are considered. Therefore, it is extremely useful for beginners to develop iOS applications on Swift, but not for beginners to learn programming as such.

A special breakthrough in learning Swift programming in the iOS operating system can be achieved by completing Tasks that are offered in this course. They are usually very interesting, and you will undoubtedly enjoy their implementation. But they will also require you to know the whole range of working methods in Swift with struct structures, enum enumerations, Optional semantic understanding, the use of closures, tuples, etc., as well as the subtle knowledge of iOS 10: View Controller “life cycle”, multithreading, Scroll View , Table View , Collection View , Core Data , Dynamic Animation , etc.

For 3 years already there has been a website that helps you to complete this wonderful course and complete all the tasks of this course. The task of this project is to take you, as a developer, to a high enough level of iOS programming, when you can freely communicate with experts and understand everything that is said at WWDC, as well as follow the creation of Swift 4 on Swift.org , and Don't “hang out” forever in educational materials. After a high-quality, independent programming of the CS193P Course CS193P no training courses will be needed.

This site contains all the necessary materials for the study of Stanford courses: unauthorized Russian-language lecture notes , demo examples , Tasks in Russian and options for solving Tasks for iOS 10 and Swift 3 .
The process of performing tasks on a Mac in Xcode 8 is very exciting: good informational support, the result is displayed on iPhone and iPad simulators or on real devices, visualization of the debugging process.

The most interesting thing is that from Xcode 8 you can run demo examples and tasks you have completed on your device (or share it with friends) for free - you do not need to have a developer certificate Developer Account $ 99 / year. Beginning with Xcode 7 , Apple ’s policy toward developers has changed: they are trying to involve younger programmers in developing applications.

If you are an experienced programmer in some other language ( Java , Python , C++ ), then, as experience shows, you only need 2-3 weeks to deal with Swift syntactic constructs (it has a very short entry period). And then - welcome to the Stanford course “Developing iOS 10 Apps with Swift” to try your hand at fulfilling Tasks, the text of which is presented in Russian and English here . The first three Jobs are not related to multithreading, nor to Table View tables, nor to Core Data databases, or to animation. This is a pure practice of knowledge of Swift and MVC . Here you will have to manage the storage of data in UserDefaults with the help of calculated variables with code in a couple of lines, understand what closures are capturing, and how to “break” a cyclic memory reference using weak and unowned in the “capture” list, what is @escaping functions, how to work with tuples, etc. Github has examples for solving Tasks. So it is worth trying and using all your Swift programming skills. In addition, you can compare your solution with the existing one .
There are solutions to the tasks:
Task 1 cs193p Winter 2017 Calculator. Solution. Required and optional items. Located on Github .

Task 2 cs193p Winter 2017 "Smart" Calculator. Decision. Required and optional items. Located on Github .

Task 3 cs193p Winter 2017 "Graphic" Calculator. Decision. Required items. Located on Github .

Task 3 cs193p Winter 2017 "Graphic" Calculator. Decision. Additional items. Located on Github .

Task 4. CS193P Winter 2017. Smashtag Mentions (Twitter client). The solution is the mandatory items 1-7. It is located on Github .

Task 4. CS193P Winter 2017. Smashtag Mentions (Twitter client). The solution is the required items 8 - 10. Located on Github .

Task 4. CS193P Winter 2017. Smashtag Mentions (Twitter client). The solution is additional points 1-5. Located on Github .

Task 4. CS193P Winter 2017. Smashtag Mentions (Twitter client). The solution is an additional item 6. UICollectionView and moving cells. Located on Github .

Task 4. CS193P Winter 2017. Smashtag Mentions (Twitter client). The solution is an additional item 6. UICollectionView with the location of cells of the WaterFall type and switching between Layouts. The code is on github .

The materialization of the course “Development of iOS Applications with Swift” is held on the private forum on Piazza. Questions can be asked there.
To register you need to follow the link:
piazza.com/moscow_physical_engineering_institute_bestkora.com/spring2017/mf141
and dial the private code mf141.

Source: https://habr.com/ru/post/326342/


All Articles