Functional Reactive Programming for iOS : using Objective-C and ReactiveCocoa
Vasiv, Mark (2018)
Vasiv, Mark
Turun ammattikorkeakoulu
2018
All rights reserved
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-201801251646
https://urn.fi/URN:NBN:fi:amk-201801251646
Tiivistelmä
The logic of most mobile applications is based on events coming from either user interface or network. Object-Oriented Programming (OOP), which is used in most of the client-side applications, is not designed to build software based on events. The existing related mechanisms in most of Object Oriented (OO) languages include the use of delegate methods, callbacks, and other language-specific techniques. These techniques abstractly serve the same functionality but use completely different syntax. This thesis focuses on iOS application development using Objective-C language, which has the above mentioned limitations concerning event-based programming. Firstly, the thesis introduces the language as well as iOS SDK basics and common patterns, highlighting core features and problems. Secondly, it provides a possible solution for the discussed issues – the use of the Functional Reactive Programming (FRP) paradigm. To achieve the FRP paradigm while developing iOS applications, the thesis suggests using ReactiveCocoa framework. The framework is a good compromise between abstract declarative programming style and relatively good performance level. The thesis also includes a fully-functional messenger User Interface (UI) component. The component is firstly built with the help of OOP and then refactored to expose FRP paradigm. The development process is documented and discussed with attention to every aspect of the process including design and actual programming.