The document provides an overview of RxSwift and best practices for using it. It begins with defining Rx and common Rx terminology like Observables and streams. It then discusses when to use Rx, such as for user actions, async operations, and bindings. The document concludes with Rx best practices like creating custom operators, handling cell reuse, and asking what is being reacted to.
The document describes code for displaying player stats from a pubg tracking service. It includes a StatsPresenter class that fetches stats from a data store based on a player's nickname. The presenter updates the stats on a StatsViewController by calling methods to reload the table view and display the player's profile.
Get the Most Out of iOS 11 with Visual Studio Tools for XamarinXamarin
In this webinar deck Craig Dunn shows what’s new in iOS 11 and how to take advantage of the latest updates – from drag-and-drop for iPad to machine learning and more – 100% in .NET and Visual Studio. Whether you’re building new or updating existing Xamarin.iOS apps, you’ll see how to implement new frameworks, APIs, and UI features, walk-through code samples, get expert tips and tricks, so you can start shipping iOS 11-ready apps to your users.
Watch webinar at https://youtu.be/mXAbpXLT1vo
This document contains code for an Android application that uses OpenCV for face and eye detection from camera frames. It detects faces, eyes within each face, and tracks the location of the eyes across frames to determine what grid location the user is focusing on (left, right, center). Based on detected eye gaze, it modifies the UI by shifting images left/right in horizontal scroll views or changing the text focus.
The document describes refactoring a Twitter client app to follow the MVVM design pattern. Originally, the view controller handled fetching and displaying tweets directly. It was refactored to use a presenter class that fetches tweets and notifies the view controller when finished via a protocol. This decouples the data handling from the view controller and makes the code more testable.
This document provides an overview of how Swift and Objective-C interact when used together. It discusses how Swift code can call Objective-C code using objc_msgSend(), how method selectors are just strings, how to add the @objc attribute to expose Swift code to Objective-C, how to call private Objective-C methods from Swift, and how to use bridging headers to simplify importing Objective-C interfaces. The document also briefly mentions namespace collision protection in Swift extensions and debugging techniques like setting breakpoints on Objective-C method names in Swift code.
The document defines a Timeline struct that conforms to a DataType protocol. The Timeline struct stores an array of Tweet objects and provides methods to insert, delete, and retrieve Tweets from the array. The DataType protocol defines requirements for a type that manages an array of items including methods to insert, delete, and access items.
The document provides an overview of advanced Android Wear development techniques including:
1) Customizing notifications by creating a custom activity displayed as a notification, handling notification data changes, and building notifications with custom backgrounds.
2) Advanced UI techniques such as disabling swipe to dismiss, adding long press to dismiss interactions, and using round and rectangular layouts.
3) Transferring bitmap images between handheld and wearable devices using assets, Volley, Picasso, and data syncing APIs.
4) Techniques for voice input using the speech recognizer, networking on Wear using libraries, and avoiding data caching issues.
The document describes code for displaying player stats from a pubg tracking service. It includes a StatsPresenter class that fetches stats from a data store based on a player's nickname. The presenter updates the stats on a StatsViewController by calling methods to reload the table view and display the player's profile.
Get the Most Out of iOS 11 with Visual Studio Tools for XamarinXamarin
In this webinar deck Craig Dunn shows what’s new in iOS 11 and how to take advantage of the latest updates – from drag-and-drop for iPad to machine learning and more – 100% in .NET and Visual Studio. Whether you’re building new or updating existing Xamarin.iOS apps, you’ll see how to implement new frameworks, APIs, and UI features, walk-through code samples, get expert tips and tricks, so you can start shipping iOS 11-ready apps to your users.
Watch webinar at https://youtu.be/mXAbpXLT1vo
This document contains code for an Android application that uses OpenCV for face and eye detection from camera frames. It detects faces, eyes within each face, and tracks the location of the eyes across frames to determine what grid location the user is focusing on (left, right, center). Based on detected eye gaze, it modifies the UI by shifting images left/right in horizontal scroll views or changing the text focus.
The document describes refactoring a Twitter client app to follow the MVVM design pattern. Originally, the view controller handled fetching and displaying tweets directly. It was refactored to use a presenter class that fetches tweets and notifies the view controller when finished via a protocol. This decouples the data handling from the view controller and makes the code more testable.
This document provides an overview of how Swift and Objective-C interact when used together. It discusses how Swift code can call Objective-C code using objc_msgSend(), how method selectors are just strings, how to add the @objc attribute to expose Swift code to Objective-C, how to call private Objective-C methods from Swift, and how to use bridging headers to simplify importing Objective-C interfaces. The document also briefly mentions namespace collision protection in Swift extensions and debugging techniques like setting breakpoints on Objective-C method names in Swift code.
The document defines a Timeline struct that conforms to a DataType protocol. The Timeline struct stores an array of Tweet objects and provides methods to insert, delete, and retrieve Tweets from the array. The DataType protocol defines requirements for a type that manages an array of items including methods to insert, delete, and access items.
The document provides an overview of advanced Android Wear development techniques including:
1) Customizing notifications by creating a custom activity displayed as a notification, handling notification data changes, and building notifications with custom backgrounds.
2) Advanced UI techniques such as disabling swipe to dismiss, adding long press to dismiss interactions, and using round and rectangular layouts.
3) Transferring bitmap images between handheld and wearable devices using assets, Volley, Picasso, and data syncing APIs.
4) Techniques for voice input using the speech recognizer, networking on Wear using libraries, and avoiding data caching issues.
Everything You (N)ever Wanted to Know about Testing View ControllersBrian Gesiak
This document discusses testing view controllers in iOS applications. It outlines three key aspects for testing view controllers: 1) Defining a module for the app, 2) Manually triggering view controller lifecycle events, and 3) Accessing view controllers instantiated from a storyboard. The document provides examples of writing tests that instantiate a view controller, trigger viewDidLoad, and assert properties and behaviors. While more difficult than testing model layers, the document argues it is possible and important to test view controllers with the right techniques.
iOS 9 introduced several new features including split screen multitasking on iPad, search APIs, app thinning technologies like bitcode and app slicing, keyboard shortcuts, 3D Touch features, updated UI components like UIAlertController and SFSafariViewController, on demand resources, and the new Contacts framework. It also improved existing technologies like Auto Layout with new syntax and components like UIStackView.
The document provides an overview of modern web development frameworks and libraries from 2006 to 2015. It discusses:
- Early frameworks like jQuery that provided cross-browser APIs but had tight coupling with HTML.
- AngularJS which introduced two-way data binding but had slow dirty checking.
- Backbone.js which used a true MVC pattern with jQuery-like views but had a complicated data binding system.
- React which introduced one-way data flow and the virtual DOM for performance. It requires changing one's mindset.
- The adoption of reactive programming concepts which treat all code as streams of events.
- The evolution of frameworks to incorporate ideas from React while new libraries emerged
Testing view controllers with Quick and NimbleMarcio Klepacz
The document discusses testing view controllers with Quick and Nimble. It provides an example of testing a view controller that presents an app intro screen using behavior-driven development. Specifically, it shows how to arrange the view controller in a testable state, invoke the code being tested, and make assertions about the expected behavior using Quick and Nimble matchers. The tests verify that the app intro is presented if it has not been dismissed before and is dismissed if the dismiss button is tapped, as well as checking that a flag is set correctly. Following the arrange-act-assert pattern and addressing view controller lifecycle issues are emphasized for effective testing.
The document discusses protocol-oriented programming (POP) in Swift. It provides examples of using protocols to define behaviors for views and view controllers. Views can adopt protocols to share shaking animations, while view controllers can retrieve data from any network service that conforms to a Gettable protocol. Tests can inject mock services to test view controller functionality without network calls. The document advocates blending different programming paradigms like POP, OOP and FP to build robust and testable apps.
The document discusses various AWT classes and components for creating graphical user interfaces in Java, including buttons, borders, card layouts, checkboxes, text fields, menus, and handling events from mouse clicks and key presses. Code examples are provided to demonstrate drawing shapes and graphics, as well as handling user input events.
The document provides tips for developing Android Wear apps and watch faces, including creating a basic watch face in 10 minutes. It discusses Android Wear APIs, creating watch face projects, battery usage considerations, avoiding burn-in effects, and includes code examples for drawing hands and implementing animations. Additional tips cover using vector drawables, custom views, common modules, and porting to other platforms like Tizen. Resources and the speaker's open source projects are provided for further reference.
Value types are at the core of Swift (seriously, mostly everything in the Swift standard library is a value type). But how do you avoid subclassing? That’s where the power of Protocol-Oriented programming comes in. Learn how to structure your code to never subclass (almost) again! Practical everyday examples and ideas for your own code base will be included.
AngularJS is an MVW JavaScript framework. It uses Model-View-Whatever architecture, with the "Whatever" standing for whatever works for the developer. Core concepts include templates, directives, scopes, expressions, filters, controllers and services. AngularJS enables two-way data binding between models and views. It also supports dependency injection to decouple code. Directives can be used to create reusable components in AngularJS applications.
The Mobile Vision API provides a framework for recognizing objects in photos and videos. The framework includes detectors, which locate and describe visual objects in images or video frames, and an event-driven API that tracks the position of those objects in video.
The 2016 Android Developer Toolbox [MOBILIZATION]Nilhcem
This document discusses various tools that can be used in Android development. It describes build tools like Gradle and build variants. It also covers debugging tools such as Stetho, Hugo, and Pidcat. Metrics and performance tools like LeakCanary, Takt, and AndroidDevMetrics are also mentioned. The document provides links to code analysis tools and testing tools like mock servers. It concludes by recommending choosing the right tools for the job.
Wild Flies and a Camel Java EE Integration StoriesMarkus Eisele
Apache Camel is one of the most complete integration frameworks out there. With more than 150 components and a large community it clearly has it's fans. Deploying the lightweight core is easy. Getting into modules and even more components makes this challenging. There are different approaches to ride that Camel. How to get the most out of it with Java EE and WildFly is exactly the topic of this session. It will introduce you to both Java EE 7 and Apache Camel in a very brief way and follows up with the different integration and deployment scenarios along with introducing the tools which help you the most on the way to your integration solution.
Joan Miro was a Spanish painter known for his unique abstract style. Some key facts about him are that he was born in Barcelona in 1893, developed a signature abstract style using vivid colors and biomorphic shapes, and was a leading figure in the surrealist movement. He produced a prolific body of work until his death in 1983.
The 2016 Android Developer Toolbox [NANTES]Nilhcem
This document discusses various tools for Android development including build variants, debug menus, measuring performance, static code analysis, testing, and debugging. It provides details on tools like Android Studio, LeakCanary, Hugo, and Stetho for monitoring apps. It also covers setting up a mock server, using Charles Proxy and hosts editor for testing network requests, and exploring apps with APKTool, JADx, and SonarQube.
Redux - негласный победитель Flux соревнований, одна из трендовых библиотек 2015 года. Слишком "сырой" для продакшена? Нет, мы так не думаем! Используя силу функционального подхода и модель Event Sourcing'a, Redux позволяет гибко управлять состоянием вашего приложения. В докладе мы расскажем про то, как мы, используя связку Redux+React, переписали с нуля front-end одного из наших продуктов (Лидсканер | leadscanner.ru). Рассмотрим реальные плюсы и минусы данного стека, в частности: работу с side-effects, повторное использование компонентов, тестируемость.
Структура:
Про нас.
Какие перед нами стояли вызовы.
Многоуровневая архитектура.
Обзор Flux архитектуры.
Redux - Predictable state container for JavaScript apps.
React как view layer.
Повторное использование компонентов.
Dumb and Smart components.
Feature Folders.
Работа с side effects.
Обзор подходов организации actionCreators.
Middlewares.
Redux-saga.
Минусы данного стека.
Slides for the 2016 Redux & Angular workshop. Redux is a popular library for state management. This workshop is about understanding how to use Redux and how to integrate it wit Angular 2
Redux. From twitter hype to productionJenya Terpil
This document provides an overview of Redux and related tools for managing state in web applications. It introduces Redux and how it uses a single state tree with actions and reducers to update state immutably. It covers using React with Redux through connect and presentational/container components. It then summarizes approaches for handling side effects like API calls using middleware like redux-thunk and redux-saga. Finally, it recommends structuring Redux apps using feature folders and separating concerns with dumb and smart components.
The document discusses refactoring an MVC weather app to use Redux architecture. It describes the key concepts of Redux including a single store, actions, and reducers. It then shows how to model the weather app states and refactor view controllers to subscribe to the store and dispatch actions. Some challenges of applying Redux to mobile apps are noted, such as managing global state across tabs and cleaning up data when views are dismissed. Redux may be better applied to shared resources like authentication rather than full app state management.
Everything You (N)ever Wanted to Know about Testing View ControllersBrian Gesiak
This document discusses testing view controllers in iOS applications. It outlines three key aspects for testing view controllers: 1) Defining a module for the app, 2) Manually triggering view controller lifecycle events, and 3) Accessing view controllers instantiated from a storyboard. The document provides examples of writing tests that instantiate a view controller, trigger viewDidLoad, and assert properties and behaviors. While more difficult than testing model layers, the document argues it is possible and important to test view controllers with the right techniques.
iOS 9 introduced several new features including split screen multitasking on iPad, search APIs, app thinning technologies like bitcode and app slicing, keyboard shortcuts, 3D Touch features, updated UI components like UIAlertController and SFSafariViewController, on demand resources, and the new Contacts framework. It also improved existing technologies like Auto Layout with new syntax and components like UIStackView.
The document provides an overview of modern web development frameworks and libraries from 2006 to 2015. It discusses:
- Early frameworks like jQuery that provided cross-browser APIs but had tight coupling with HTML.
- AngularJS which introduced two-way data binding but had slow dirty checking.
- Backbone.js which used a true MVC pattern with jQuery-like views but had a complicated data binding system.
- React which introduced one-way data flow and the virtual DOM for performance. It requires changing one's mindset.
- The adoption of reactive programming concepts which treat all code as streams of events.
- The evolution of frameworks to incorporate ideas from React while new libraries emerged
Testing view controllers with Quick and NimbleMarcio Klepacz
The document discusses testing view controllers with Quick and Nimble. It provides an example of testing a view controller that presents an app intro screen using behavior-driven development. Specifically, it shows how to arrange the view controller in a testable state, invoke the code being tested, and make assertions about the expected behavior using Quick and Nimble matchers. The tests verify that the app intro is presented if it has not been dismissed before and is dismissed if the dismiss button is tapped, as well as checking that a flag is set correctly. Following the arrange-act-assert pattern and addressing view controller lifecycle issues are emphasized for effective testing.
The document discusses protocol-oriented programming (POP) in Swift. It provides examples of using protocols to define behaviors for views and view controllers. Views can adopt protocols to share shaking animations, while view controllers can retrieve data from any network service that conforms to a Gettable protocol. Tests can inject mock services to test view controller functionality without network calls. The document advocates blending different programming paradigms like POP, OOP and FP to build robust and testable apps.
The document discusses various AWT classes and components for creating graphical user interfaces in Java, including buttons, borders, card layouts, checkboxes, text fields, menus, and handling events from mouse clicks and key presses. Code examples are provided to demonstrate drawing shapes and graphics, as well as handling user input events.
The document provides tips for developing Android Wear apps and watch faces, including creating a basic watch face in 10 minutes. It discusses Android Wear APIs, creating watch face projects, battery usage considerations, avoiding burn-in effects, and includes code examples for drawing hands and implementing animations. Additional tips cover using vector drawables, custom views, common modules, and porting to other platforms like Tizen. Resources and the speaker's open source projects are provided for further reference.
Value types are at the core of Swift (seriously, mostly everything in the Swift standard library is a value type). But how do you avoid subclassing? That’s where the power of Protocol-Oriented programming comes in. Learn how to structure your code to never subclass (almost) again! Practical everyday examples and ideas for your own code base will be included.
AngularJS is an MVW JavaScript framework. It uses Model-View-Whatever architecture, with the "Whatever" standing for whatever works for the developer. Core concepts include templates, directives, scopes, expressions, filters, controllers and services. AngularJS enables two-way data binding between models and views. It also supports dependency injection to decouple code. Directives can be used to create reusable components in AngularJS applications.
The Mobile Vision API provides a framework for recognizing objects in photos and videos. The framework includes detectors, which locate and describe visual objects in images or video frames, and an event-driven API that tracks the position of those objects in video.
The 2016 Android Developer Toolbox [MOBILIZATION]Nilhcem
This document discusses various tools that can be used in Android development. It describes build tools like Gradle and build variants. It also covers debugging tools such as Stetho, Hugo, and Pidcat. Metrics and performance tools like LeakCanary, Takt, and AndroidDevMetrics are also mentioned. The document provides links to code analysis tools and testing tools like mock servers. It concludes by recommending choosing the right tools for the job.
Wild Flies and a Camel Java EE Integration StoriesMarkus Eisele
Apache Camel is one of the most complete integration frameworks out there. With more than 150 components and a large community it clearly has it's fans. Deploying the lightweight core is easy. Getting into modules and even more components makes this challenging. There are different approaches to ride that Camel. How to get the most out of it with Java EE and WildFly is exactly the topic of this session. It will introduce you to both Java EE 7 and Apache Camel in a very brief way and follows up with the different integration and deployment scenarios along with introducing the tools which help you the most on the way to your integration solution.
Joan Miro was a Spanish painter known for his unique abstract style. Some key facts about him are that he was born in Barcelona in 1893, developed a signature abstract style using vivid colors and biomorphic shapes, and was a leading figure in the surrealist movement. He produced a prolific body of work until his death in 1983.
The 2016 Android Developer Toolbox [NANTES]Nilhcem
This document discusses various tools for Android development including build variants, debug menus, measuring performance, static code analysis, testing, and debugging. It provides details on tools like Android Studio, LeakCanary, Hugo, and Stetho for monitoring apps. It also covers setting up a mock server, using Charles Proxy and hosts editor for testing network requests, and exploring apps with APKTool, JADx, and SonarQube.
Redux - негласный победитель Flux соревнований, одна из трендовых библиотек 2015 года. Слишком "сырой" для продакшена? Нет, мы так не думаем! Используя силу функционального подхода и модель Event Sourcing'a, Redux позволяет гибко управлять состоянием вашего приложения. В докладе мы расскажем про то, как мы, используя связку Redux+React, переписали с нуля front-end одного из наших продуктов (Лидсканер | leadscanner.ru). Рассмотрим реальные плюсы и минусы данного стека, в частности: работу с side-effects, повторное использование компонентов, тестируемость.
Структура:
Про нас.
Какие перед нами стояли вызовы.
Многоуровневая архитектура.
Обзор Flux архитектуры.
Redux - Predictable state container for JavaScript apps.
React как view layer.
Повторное использование компонентов.
Dumb and Smart components.
Feature Folders.
Работа с side effects.
Обзор подходов организации actionCreators.
Middlewares.
Redux-saga.
Минусы данного стека.
Slides for the 2016 Redux & Angular workshop. Redux is a popular library for state management. This workshop is about understanding how to use Redux and how to integrate it wit Angular 2
Redux. From twitter hype to productionJenya Terpil
This document provides an overview of Redux and related tools for managing state in web applications. It introduces Redux and how it uses a single state tree with actions and reducers to update state immutably. It covers using React with Redux through connect and presentational/container components. It then summarizes approaches for handling side effects like API calls using middleware like redux-thunk and redux-saga. Finally, it recommends structuring Redux apps using feature folders and separating concerns with dumb and smart components.
The document discusses refactoring an MVC weather app to use Redux architecture. It describes the key concepts of Redux including a single store, actions, and reducers. It then shows how to model the weather app states and refactor view controllers to subscribe to the store and dispatch actions. Some challenges of applying Redux to mobile apps are noted, such as managing global state across tabs and cleaning up data when views are dismissed. Redux may be better applied to shared resources like authentication rather than full app state management.
This document introduces Reactive Extensions (RxJS) for JavaScript, which allows programming with asynchronous data streams. It discusses key RxJS concepts like Observables that emit event streams and Observers that subscribe to those streams. It provides examples of creating Observables from events, making Ajax requests, retrying failures, combining streams, and using various operators to transform and filter streams. The goal is to help developers learn how to use RxJS to compose asynchronous actions and events in a functional, reactive style.
Improving android experience for both users and developersPavel Lahoda
Android UI and User Experience has changed dramatically in the recent version(s) and while users generally enjoy the new features, there are still several areas that are left to application-level-DIY-patterns. For developers, this is double challenge, they want to provide users with the bleeding edge UI patterns and at the same time, they have to deal with evolving API, that sometimes changes dramatically.
Presentation covers the gotchas developer might face dealing with ever-moving Android API, and how to utilize Java language and the tools it have to make the experience for developer more pleasant. Typical trends in the API will get analyzed and divided into several areas or "patterns", discussing typical scenarios how these components are designed and implemented.
This talk will propose several such UI patterns, that will compete to become "de facto" standards and details on the implementation, including possible impact on existing API as we have both end users and developers in mind.
The list of patterns/areas discussed in the talk include following :
ActionBar
ListView
TimePicker
KineticGestureComponent
The document discusses opportunities to improve the Android user experience through more flexible and responsive layouts, improved action bar designs, and innovative input methods like gesture and sensor-based interactions. It presents examples of custom view groups and adapters that provide flexible resizing and binding of data to views. The talk argues the action bar could be improved through more consistent behavior and use of available screen space. Ideas for new date/time pickers and gesture-based interactions are also proposed to enhance the Android experience.
When developing applications we have a hard time managing application state, and that is okay because managing application state is hard. We will try to make it easier using Redux.
Redux is predictable state management container for JavaScript applications that helps us manage our state while also making our state mutations predictable.
Through the presentation and code, I will show you how I solved my state problem with Redux in React application.
Visualforce: Using JavaScript Remoting for Apex Controllersprabhat gangwar
The document discusses JavaScript remoting for Apex controllers, which allows making asynchronous AJAX requests from Visualforce pages to Apex controllers without reloading the entire page. Key points covered include how to configure and make requests to remote action methods, benefits like avoiding view state issues, and comparing JavaScript remoting to action functions.
Reactive Programming - ReactFoo 2020 - Aziz KhambatiAziz Khambati
This document discusses reactive programming and how it relates to React and RxJS. It begins with an introduction to reactive programming and its focus on data streams and propagating change. It then discusses how React popularized the declarative programming paradigm for building user interfaces. The document also provides an example of using RxJS to build an autocomplete component reactively by composing Observables. It emphasizes that RxJS allows building reactive features in a declarative way using operators on data streams.
Workshop Apps with ReactNative II:
- React Native short Recap
- Navigation in React Native Apps
- Tabs & Other Architectural Components
- Lists & Other Presentational Components
- OpenSource Important Components
Presentado por ingenieros Raúl Delgado y Marc Torrent
Java Server Faces (JSF) is a Java web development framework that provides reusable UI components and a component-based MVC architecture. Key aspects of JSF include:
- Clean separation of behavior and presentation using a component-based MVC model.
- Standard UI components and events tied to server-side code.
- Typical JSF applications include JavaBeans for state/behavior, event-driven development, and JSP view pages that reference a component tree.
The example JSF calculator application demonstrates:
1) Configuring the Faces servlet and managed beans.
2) Developing a model class and controller to mediate between the view and model.
3) Creating
In this talk, I'm presenting an alternative approach to thinking about UI and navigation on iOS - one that is declarative and that I find easy to reason about in a big application. I did live coding and the link is on the last slide. Enjoy!
Learn how to simplify the flow of data in your Swift application using a Flux / Redux / Elm like architecture inspired by functional programming.
Check out jarsen/Reactor on github.
Understand the basics: what reactive programming is, how it works why you should use it. Check how RXSwift library achieves FRP and a declarative way programming!
RxJS Operators - Real World Use Cases (FULL VERSION)Tracy Lee
This document provides an overview and explanation of various RxJS operators for working with Observables, including:
- The map, filter, and scan operators for transforming streams of data. Map applies a function to each value, filter filters values, and scan applies a reducer function over time.
- Flattening operators like switchMap, concatMap, mergeMap, and exhaustMap for mapping Observables to other Observables.
- Error handling operators like catchError, retry, and retryWhen for catching and handling errors.
- Additional explanation of use cases and common mistakes for each operator discussed. The document is intended to explain these essential operators for real world reactive programming use.
This document discusses using protocols and view models to configure views in Swift. It provides an example of a switch cell that can be configured using protocols for its text, switch state, and other properties. Protocol extensions are used to provide default values. The view model conforms to the protocols to provide the data to configure the cell. This avoids tightly coupling the cell to a specific view model class. The document suggests this approach makes the code more reusable, testable and maintainable.
Efficient and Testable MVVM pattern
김범준
레이니스트 / 안드로이드 개발
레이니스트에서 뱅크샐러드 안드로이드 어플리케이션을 개발하고 있는 5년차 개발자 입니다. Reactive, 함수형 프로그래밍에 관심이 많으며 효율적이고 가독성 있는 코드를 짜는 것을 항상 목표로 부단히 노력중입니다.
Managing application state, asynchronous events and manually updating the DOM is hard. Cycle.js is a minimal framework that combines a pure functional programming style, immutability, and state management using Observables and Virtual DOM rendering. In this presentation we take a mild introduction to why that's interesting.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Drona Infotech is a premier mobile app development company in Noida, providing cutting-edge solutions for businesses.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
Malibou Pitch Deck For Its €3M Seed Roundsjcobrien
French start-up Malibou raised a €3 million Seed Round to develop its payroll and human resources
management platform for VSEs and SMEs. The financing round was led by investors Breega, Y Combinator, and FCVC.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
SMS API Integration in Saudi Arabia| Best SMS API ServiceYara Milbes
Discover the benefits and implementation of SMS API integration in the UAE and Middle East. This comprehensive guide covers the importance of SMS messaging APIs, the advantages of bulk SMS APIs, and real-world case studies. Learn how CEQUENS, a leader in communication solutions, can help your business enhance customer engagement and streamline operations with innovative CPaaS, reliable SMS APIs, and omnichannel solutions, including WhatsApp Business. Perfect for businesses seeking to optimize their communication strategies in the digital age.
Transform Your Communication with Cloud-Based IVR SolutionsTheSMSPoint
Discover the power of Cloud-Based IVR Solutions to streamline communication processes. Embrace scalability and cost-efficiency while enhancing customer experiences with features like automated call routing and voice recognition. Accessible from anywhere, these solutions integrate seamlessly with existing systems, providing real-time analytics for continuous improvement. Revolutionize your communication strategy today with Cloud-Based IVR Solutions. Learn more at: https://thesmspoint.com/channel/cloud-telephony
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
5. W H A T I S R X ?
5
•RxSwift - Swift implementation of ReactiveX
•Follows the “Observer pattern”
•Declarative way of defining the data flow in your app
•Avoid “callback hell”
•Data flow is handled via manageable streams
6. W H A T I S R X ?
6
STREAMS
Observable<WaterMolecule>
Observable<Bool>
Observable<MeetUp>
of things.
One thing at a time.
12. 12
01User actions (button taps, text field delegates)
02Async operations (Network calls, processing)
03Bindings (VC!!<-> VM !!<-> Model)
L I S T
WHEN TO
USE RX
04Prevent code 🍝
13. B U T T O N A C T I O N
13
WITHOUT RX
@IBAction func logoTapped(_ sender: UIButton) {
dismissUntilHome()
}
navBar.logoButton !=> dismissUntilHome !!>>> rx_disposeBag
WITH RX
Drag and drop to create IBAction function. A bit more complicated if it is nested in a custom
view.
We are using Fira Code font: https://github.com/tonsky/FiraCode
14. D A T E P I C K E R
14
WITH RX
WITHOUT RX
Drag and drop to create IBAction function. A bit more complicated if it is nested in a custom
view, or number of date pickers are not constant.
datePicker.rx.date !=> viewModel.endDate !!>>> rx_disposeBag
@IBAction func datePicked(_ sender: UIDatePicker) {
viewModel.endDate = sender.date
}
15. T E X T F I E L D
15
WITH RX
titleField.textView.rx.text.orEmpty !!<-> viewModel.title !!>>> rx_disposeBag
Create binding in view controller.
WITHOUT RX
Set up delegate for the text field to listen for edit events to update view model, and manually
trigger UI update when view model’s property has changed.
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange,
replacementString string: String)
var title: String = "" {
didSet {
updateTextFields()
}
}
17. S C R O L L V I E W
17
WITH RX
tableView.rx_scrolledUnderTop !=> viewModel.showTopGradient !!>>> rx_disposeBag
tableView.rx_scrolledUnderBottom !=> viewModel.showBottomGradient !!>>> rx_disposeBag
Create binding in view controller.
WITHOUT RX
Set up delegate extensions and do the calculation within the method, at multiple places for
multiple classes:
func scrollViewDidScroll(_ scrollView: UIScrollView)
18. P A G I N A T I O N
18
SET UP DATA CONTROLLER
func getPaginatedData<T: RealmSwift.Object>(resource: Resource, loadNextPageTrigger: Observable<Void>, dataParser: @escaping (Data) !-> ([T], Int)) !->
Observable<[T]> {
let existingObjects: [T] = Realm.ip_objects(type: T.self)!?.toArray() !?? []
return recursiveGetPaginatedData(resource: resource, lastModified: lastModifiedDate, dataParser: dataParser, loadedSoFar: [], page: 1, loadNextPageTrigger:
loadNextPageTrigger).startWith(existingObjects)
}
func recursiveGetPaginatedData<T: RealmSwift.Object>(resource: Resource, dataParser: @escaping (Data) !-> ([T], Int), loadedSoFar: [T], page: Int,
loadNextPageTrigger: Observable<Void>) !-> Observable<[T]> {
guard let urlRequest = URLRequest(builder: URLRequestBuilder(resource: resource, paginationPage: page, authenticationToken = authenticationToken) else {
return Observable.just(loadedSoFar)
}
return networkOperationQueue.add(dataRequest: urlRequest).observeOn(MainScheduler.instance)
.flatMap { data !-> Observable<[T]> in
var justLoaded = loadedSoFar
let (models, paginationTotalItems) = dataParser(data)
justLoaded.append(contentsOf: models)
if justLoaded.count !== paginationTotalItems {
Realm.ip_add(justLoaded, update: true, configuration: self.realmConfiguration)
return Observable.just(justLoaded)
}
return Observable.concat([
Observable.just(justLoaded),
Observable.never().takeUntil(loadNextPageTrigger),
Observable.deferred { self.recursiveGetPaginatedData(resource: resource, dataParser: dataParser, loadedSoFar: justLoaded, page: page + 1,
loadNextPageTrigger: loadNextPageTrigger) }
])
}
}
Functions of the network call in data controller:
19. P A G I N A T I O N
19
SET UP VIEW MODEL
func opportunities(loadNextPageTrigger: Observable<Void>) !-> Observable<[OpportunityModel]> {
return getPaginatedData(resource: Resource.opportunities, loadNextPageTrigger: loadNextPageTrigger) { (data) !-> ([OpportunityRealmModel], Int) in
let opportunitiesModel = try! OpportunitiesModel(node: data)
return (opportunitiesModel.opportunities, opportunitiesModel.total)
}
.map { $0 as [OpportunityModel] }
}
Function of the API call in data controller:
Where we make the API call in view model:
dataController.opportunities(loadNextPageTrigger: nextPageTrigger.asObservable())
.map { $0.map { OpportunityCellViewModel(opportunity: $0) } }
.subscribe(
onNext: {
self.opportunityCellViewModels = $0
self.hasMoreOpportunities = true
},
onError: {
Logger.error($0)
NotificationCenter.postMessage(type: .requestFailure)
self.hasMoreOpportunities = false
},
onCompleted: {
self.opportunityCellViewModels.append(EndOfListViewModel())
self.hasMoreOpportunities = false
}) !!>>> rx_disposeBag
20. P A G I N A T I O N
20
GET NEXT PAGE IN VIEW MODEL
func nextPage() {
nextPageTrigger.fire()
}
How we get the next page in the view model:
21. N E T W O R K C A L L S
21
CHAINED NETWORK CALLS
guard let s3Object = requestS3Object(for: .opportunity) else { return nil }
return s3Object.observeOn(MainScheduler.instance).flatMap { s3Object !-> Observable<Bool> in
opportunity.imageURL = URL(string: s3Object.publicURL)
opportunity.imageKey = s3Object.key
guard let presignedURL = URL(string: s3Object.presignedURL) else {
return Observable.error(RxURLSessionError.requestCreationError)
}
return self.uploadImage(data: imageData, to: presignedURL)
}.observeOn(MainScheduler.instance).flatMap { imageUploadSuccess !-> Observable<Data> in
requestBuilder.data = opportunity.toJson()
guard let urlRequest = URLRequest(builder: requestBuilder) else {
return Observable.error(RxURLSessionError.requestCreationError)
}
return self.networkOperationQueue.add(dataRequest: urlRequest)
}
22. R E A C H A B I L I T Y
22
CREATE REACHABILITY SERVICE
class DefaultReachabilityService: ReachabilityService {
private let _reachabilitySubject: BehaviorSubject<ReachabilityStatus>
var reachability: Observable<ReachabilityStatus> {
return _reachabilitySubject.asObservable()
}
let _reachability: Reachability
init() throws {
guard let reachabilityRef = Reachability() else { throw ReachabilityServiceError.failedToCreate }
let reachabilitySubject = BehaviorSubject<ReachabilityStatus>(value: .unreachable)
let backgroundQueue = DispatchQueue(label: "reachability.wificheck")
reachabilityRef.whenReachable = { reachability in
backgroundQueue.async {
reachabilitySubject.on(.next(.reachable(viaWiFi: reachabilityRef.isReachableViaWiFi)))
}
}
reachabilityRef.whenUnreachable = { reachability in
backgroundQueue.async {
reachabilitySubject.on(.next(.unreachable))
}
}
try reachabilityRef.startNotifier()
_reachability = reachabilityRef
_reachabilitySubject = reachabilitySubject
}
}
How we create observable for reachability of network (by Krunoslav Zaher):
23. R E A C H A B I L I T Y
23
DISPLAY REACHABILITY MESSAGE
reachabilityService.reachability
.skip(1)
.throttle(10, scheduler: MainScheduler.instance)
.observeOn(MainScheduler.instance)
.subscribe(onNext: {
$0.reachable ? self.hideMessage() : self.showMessage(.lostConnection)
}) !!>>> disposeBag
How we subscribe to reachability observable:
24. B L U E T O O T H
24
SUBSCRIBING TO A BLUETOOTH STREAM
class AwesomeViewController: UIViewController {
let viewModel = DeviceStatusViewModel()
@IBOutlet weak var batteryImageView: UIImageView!
func viewDidLoad() {
bindToViewModel()
}
override func bindToViewModel() {
super.viewDidLoad()
viewModel.devicesManager.batteryStatus
.subscribeOn(MainScheduler.instance)
.subscribe(next: { batteryStatus in
self.batteryImageView.image = self.batteryImageForStatus(batteryStatus)
}) !!>>> rx_diposeBag
}
}
25. L O O K S G R E A T B U T …
25
STACKTRACE
HELL
27. B E S T P R A C T I C E S
27
infix operator !=> : Binding
infix operator !!>>> : Binding
public func !=> <T, P: ObserverType>(left: Variable<T>, right: P) !-> Disposable where P.E !== T {
return left.asObservable().bindTo(right)
}
public func !=> (left: UIButton, right: @escaping () !-> Void) !-> Disposable {
return left.rx.tap.subscribe(onNext: { right() })
}
CREATE OPERATORS FOR COMMON TASKS
Syntax sugar that greatly reduces boilerplate code:
28. B E S T P R A C T I C E S
28
public func !!<-> <T>(property: ControlProperty<T>, variable: Variable<T>) !->
Disposable {
let bindToUIDisposable = variable
.asObservable()
.bindTo(property)
let bindToVariable = property
.subscribe(
onNext: { n in
variable.value = n
},
onCompleted: {
bindToUIDisposable.dispose()
}
)
return Disposables.create(bindToUIDisposable, bindToVariable)
}
TWO-WAY BINDING
29. S C R O L L V I E W
29
SCROLL VIEW EXTENSIONS (AS PROMISED)
extension UIScrollView {
public var rx_scrolledUnderTop: Observable<Bool> {
return self.rx.contentOffset
.map { $0.y > 0 }
.distinctUntilChanged()
}
public var rx_scrolledUnderBottom: Observable<Bool> {
return self.rx.contentOffset
.map { $0.y < self.contentSize.height - self.frame.size.height - 1 }
.distinctUntilChanged()
}
}
Create extension for scroll view.
30. B E S T P R A C T I C E S
30
cell.viewOpportunityOverlayView.rx_tapGesture !=> {
self.showOpportunityDetail(opportunityVM.opportunity)
} !!>>> cell.cellDisposeBag
WATCH OUT FOR CELL REUSE
Be sure to reset bindings on cell reuse! In view controller:
override func prepareForReuse() {
super.prepareForReuse()
cellDisposeBag = DisposeBag()
}
In table view cell:
31. B E S T P R A C T I C E S
31
func bindToViewModel() {
Observable.combineLatest(vm.passwordValid, vm.passwordIsMinLength) {
$0 !&& $1
} !=> passwordReqsLabel.rx_hidden !!>>> rx_disposeBag
vm.emailAddress !<- emailAddressField.rx_text !!>>> rx_disposeBag
vm.password !<- passwordField.rx_text !!>>> rx_disposeBag
vm.passwordConfirmation !<- confirmPasswordField.rx_text !!>>> rx_disposeBag
}
@IBOutlet weak var settingsButton: UIButton! {
didSet {
settingsButton !=> showSettingsVC !!>>> rx_disposeBag
}
}
DESIGNATED METHOD FOR BINDING
32. B E S T P R A C T I C E S
32
class DeviceManager {
private var batteryStatus = Variable<BatteryLevel>(.low)
public var batteryStatusObs = batteryStatus.asObservable()
}
PUBLIC VS. PRIVATE
33. B E S T P R A C T I C E S
33
extension ObservableType {
public func ip_repeatingTimeouts(
interval dueTime: RxTimeInterval,
element: E,
scheduler: SchedulerType = MainScheduler.instance
) !-> Observable<E> {
return
Observable.of(
self.asObservable(),
debounce(dueTime, scheduler: scheduler).map { _ in element }
)
.merge()
}
}
REPEATING TIMEOUTS
35. 35
• What are you reacting to?
• Are you using a struct or a class?
• Observable vs. Variable?
• Does the subscription need to update things on the screen?
• Will the view update while it’s being displayed?
ASK YOURSELF…
C O N C L U S I O N S
37. 37
• RxMarbles.com
• ReactiveX.io
• https://github.com/IntrepidPursuits/swift-wisdom
• https://github.com/ReactiveX/RxSwift
• rxswift.slack.com
USEFUL LINKS
C O N C L U S I O N S