In this talk, I'm going to show how to build data-driven SwiftUI applications that uses Cloud Firestore to store data.
You will learn how to architect your SwiftUI app so both its local and remote state stay in sync in real time
Try!Swift India 2017: All you need is SwiftChris Bailey
In September last year Swift 3 was released, added official support for Swift on Linux for the first time. This provided the scope for Swift to be used for both front-end and back-end development, allowing iOS developers to gain the benefits of full-stack development that Web developers have enjoyed for some time. In just twelve months, this has moved from promise to reality, with full-stack Swift applications not just being possible but being developed and deployed by some of the largest companies in the world.
In this session Chris and AB will introduce you to full-stack Swift development, show you how easy it is to get started, and talk about how the IBM MobileFirst for iOS Garage are building full-stack Swift applications their customers.
MBL301 Data Persistence to Amazon Dynamodb for Mobile Apps - AWS re: Invent 2012Amazon Web Services
Object modeling is a common practice in mobile applications. We present two methods for modeling objects backed by Amazon DynamoDB, the AWS Persistence Framework for Core Data and DynamoDBMapper. We cover the benefits and limitations of these two solutions and demonstrate sample applications built with both technologies.
In a world where users have ever higher expectations from the apps they use, having data always available, even when the device is offline has become increasingly important.
In this talk we will go through different ways of saving data on the phone and introduce Realm as a replacement for SQLite and ORM's.
Through an example app it will be demonstrated that thinking "Offline first" not only affects your apps architecture for the better, but also results in happier users.
Single Page JavaScript WebApps... A Gradle StoryKon Soulianidis
From MelbJVM July 2014
This presentation covers building single page web applications with Gradle, including why we chose to use Gradle instead of a more commonly used JS based build tool, and the benefits by integrating a JS webapp into the JVM environment.
Try!Swift India 2017: All you need is SwiftChris Bailey
In September last year Swift 3 was released, added official support for Swift on Linux for the first time. This provided the scope for Swift to be used for both front-end and back-end development, allowing iOS developers to gain the benefits of full-stack development that Web developers have enjoyed for some time. In just twelve months, this has moved from promise to reality, with full-stack Swift applications not just being possible but being developed and deployed by some of the largest companies in the world.
In this session Chris and AB will introduce you to full-stack Swift development, show you how easy it is to get started, and talk about how the IBM MobileFirst for iOS Garage are building full-stack Swift applications their customers.
MBL301 Data Persistence to Amazon Dynamodb for Mobile Apps - AWS re: Invent 2012Amazon Web Services
Object modeling is a common practice in mobile applications. We present two methods for modeling objects backed by Amazon DynamoDB, the AWS Persistence Framework for Core Data and DynamoDBMapper. We cover the benefits and limitations of these two solutions and demonstrate sample applications built with both technologies.
In a world where users have ever higher expectations from the apps they use, having data always available, even when the device is offline has become increasingly important.
In this talk we will go through different ways of saving data on the phone and introduce Realm as a replacement for SQLite and ORM's.
Through an example app it will be demonstrated that thinking "Offline first" not only affects your apps architecture for the better, but also results in happier users.
Single Page JavaScript WebApps... A Gradle StoryKon Soulianidis
From MelbJVM July 2014
This presentation covers building single page web applications with Gradle, including why we chose to use Gradle instead of a more commonly used JS based build tool, and the benefits by integrating a JS webapp into the JVM environment.
Rapid Application Development with SwiftUI and FirebasePeter Friese
Firebase is Google's mobile development platform for Android, iOS, and the web. SwiftUI is Apple's user interface toolkit that lets developers design apps in a declarative way. In this session, we will bring the two together and take a look at how easy it is to develop a new application from scratch.
Slides for my talk at CocoaHeads Berlin (https://www.meetup.com/Cocoaheads-Berlin/events/266764473/)
SwiftUI makes it easy to create beautiful UIs in no time, but it is just as easy to end up with a giant view that mixes view code and business logic. Fortunately, Apple gave us some tools to keep the bloat in check and write maintainable and reusable code.
In this talk, I am going to show you how to
- refactor an existing SwiftUI view to make it more maintainable,
- turn it into a reusable SwiftUI component,
- add event handling,
- make the view configurable,
- use SwiftUI's styling API to apply different designs,
- add it to the Xcode component library,
- turn it into a shareable component that can be consumed via Swift Package Manager,
- and distribute it via GitHub
In this workshop, you will learn how to build a SwiftUI application with Firebase. We will cover the following topics:
- Data modeling for Firestore
- Efficiently mapping Firestore data using Swift’s Codable protocol
- Fetching data from Firestore using snapshot listeners
- Connecting SwiftUI’s state management system to Firestore to implement real-time sync
- Securing your user’s data using Firebase Security Rules
- Signing in your users using Firebase Authentication
We will be using the latest versions of Firebase and SwiftUI, making use of Combine and async/await to demonstrate how to call asynchronous APIs using modern Swift technologies. Please bring your laptop, making sure to install the latest stable version of Xcode before the workshop.
SwiftUI makes it easy to create beautiful UIs in no time, but it is just as easy to end up with a giant view that mixes view code and business logic. Fortunately, Apple gave us some tools to keep the bloat in check and write maintainable and reusable code.
In this talk, I am going to show you how to
- refactor an existing SwiftUI view to make it more maintainable,
- turn it into a reusable SwiftUI component,
- add event handling,
- make the view configurable,
- add it to the Xcode component library,
- turn it into a shareable component that can be consumed via Swift Package Manager,
- and distribute it via GitHub
Firebase for Apple Developers - SwiftHeroesPeter Friese
In this talk, we are going to walk you through the building blocks for creating modern applications on Apple’s platforms using SwiftUI and Firebase.
We will cover the following topics:
- Setting up an architecture for data-driven applications
- What’s new in SwiftUI’s application life cycle
- Syncing data in realtime across multiple devices with Cloud Firestore
- Mapping Firestore documents in a type-safe way using the Codable protocol
- Storing images and other large files in Cloud Storage
- Using Firebase in WidgetKit and on watchOS
- How async/await (new in Swift 5.5) will affect the way we write asynchronous code (plus some surprises in Firebase's code base)
Firebase is always evolving, so we will also talk about how we’re making use of Apple’s latest technologies in our own code base, for example
- Combine
- async/await
- SwiftUI view modifiers
No matter if you’re a seasoned Firebase user or just wondering what it is all about, you should leave this session with a deeper understanding of what Firebase it and how you can use it your apps on Apple’s platforms.
+ = ❤️ (Firebase for Apple Developers) at Swift LeedsPeter Friese
In this talk, I am going to walk you through the building blocks for creating modern applications on Apple’s platforms using SwiftUI and Firebase.
We will cover the following topics:
- Setting up an architecture for data-driven applications
- What’s new in SwiftUI’s application life cycle
- Syncing data in realtime across multiple devices with Cloud Firestore
- Mapping Firestore documents in a type-safe way using the Codable protocol
- Using Combine to fetch data from remote APIs and Firebase
- How async/await (new in Swift 5.5) will affect the way we write asynchronous code (plus some surprises in Firebase's code base)
Firebase is always evolving, so I will also talk about how we’re making use of Apple’s latest technologies in our own code base, for example
- Combine
- async/await
- SwiftUI view modifiers
No matter if you’re a seasoned Firebase user or just wondering what it is all about, you should leave this session with a deeper understanding of what Firebase it and how you can use it your apps on Apple’s platforms.
Async/await is a new language feature that will ship with Swift 5.5 this year. There’s no doubt it will have a significant impact on how we write asynchronous code.
In this talk, we’re going to look at some use cases for async/await, how we can call existing Swift APIs using this new feature, and why your decision to write your SDK in Objective-C might turn out to have been a very clever move.
We’ll also have a look at the refactoring support Apple is adding to Xcode and how it will help you migrate your existing code base.
In this talk, I am going to walk you through the building blocks for creating modern applications on Apple’s platforms using SwiftUI and Firebase.
We will cover the following topics:
- Setting up an architecture for data-driven applications
- What’s new in SwiftUI’s application life cycle
- Syncing data in realtime across multiple devices with Cloud Firestore
- Mapping Firestore documents in a type-safe way using the Codable protocol
- Using Combine to fetch data from remote APIs and Firebase
- How async/await (new in Swift 5.5) will affect the way we write asynchronous code (plus some surprises in Firebase's code base)
Firebase is always evolving, so I will also talk about how we’re making use of Apple’s latest technologies in our own code base, for example
- Combine
- async/await
- SwiftUI view modifiers
No matter if you’re a seasoned Firebase user or just wondering what it is all about, you should leave this session with a deeper understanding of what Firebase it and how you can use it your apps on Apple’s platforms.
Rapid Application Development with SwiftUI and FirebasePeter Friese
Firebase is Google's mobile development platform for Android, iOS, and the web. SwiftUI is Apple's user interface toolkit that lets developers design apps in a declarative way. In this session, we will bring the two together and take a look at how easy it is to develop a new application from scratch.
Slides for my talk at heise MacDev 2019 (https://heise-macdev.de/lecture.php?id=8509)
6 Things You Didn't Know About Firebase AuthPeter Friese
There’s no doubt about it: many apps need some way of authenticating the user, but most developers don’t get overly excited by the prospect of implementing a login/sign-up screen.
In this talk, you will learn what Firebase Auth is, why you should use it, and - if this didn’t get you excited yet - 5 things you probably didn’t know about Firebase Auth before.
In particular, we’re going to look at
- How Firebase Auth works, and why you should use it
- How to let users sign in without even having to come up with a password
- What Anonymous Auth is all about and why you should care
- How to make signing in on iOS more magical
- How to integrate Firebase Auth and Sign in with Apple
Five Things You Didn't Know About Firebase AuthPeter Friese
There’s no doubt about it: many apps need some way of authenticating the user, but most developers don’t get overly excited by the prospect of implementing a login/sign-up screen.
In this talk, you will learn what Firebase Auth is, why you should use it, and - if this didn’t get you excited yet - 5 things you probably didn’t know about Firebase Auth before.
In particular, we’re going to look at
- How Firebase Auth works, and why you should use it
- How to let users sign in without even having to come up with a password
- What Anonymous Auth is all about and why you should care
- How to make signing in on iOS more magical
Building High-Quality Apps for Google AssistantPeter Friese
In this session, I will show you how to build great apps for the assistant using Dialogflow and Actions on Google. Building Actions with Dialogflow is deceptively easy, but building great apps that meet the quality bar requires in-depth knowledge of the design guidelines we defined. In this talk, I'm going to walk you through the best practices for VUI design and will show you how to apply these to your Assistant apps. We’ll cover topics such as handling new and returning users, robust error handling for no-input and no-match situations, and being able to repeat information for the user. We will also look at strategies for implementing multi-lingual apps and how to design for multiple surfaces at the same time.
Building Conversational Experiences with Actions on Google Peter Friese
Since we first started using computers, we have dreamt of interacting with them in a more natural, human-like way using spoken language. Advances in machine learning and artificial intelligence have spiked an interest in natural language processing, and building conversational interfaces no longer is a dream, but a reality every developer can use in their own applications.
The problem of recognising spoken input has been largely solved, and the next challenge is how to build compelling user experiences that are modelled after natural human conversation.
In this talk, I will give an introduction to the Google Assistant and how to use Actions on Google to build conversational interfaces for devices with and without screens. We will take a look at how API.AI makes implementing natural language understanding feasible even for non-linguists, and discuss how you can integrate agents with existing backends. In conversation, it's all about being natural, so we will also look at how to create agents that feel like real characters.
Building Conversational Experiences with Actions on GooglePeter Friese
Since we first started using computers, we have dreamt of interacting with them in a more natural, human-like way using spoken language. Advances in machine learning and artificial intelligence have spiked an interest in natural language processing, and building conversational interfaces no longer is a dream, but a reality every developer can use in their own applications.
The problem of recognising spoken input has been largely solved, and the next challenge is how to build compelling user experiences that are modelled after natural human conversation.
In this talk, I will give an introduction to the Google Assistant and how to use Actions on Google to build conversational interfaces for devices with and without screens. We will take a look at how API.AI makes implementing natural language understanding feasible even for non-linguists, and discuss how you can integrate agents with existing backends. In conversation, it's all about being natural, so we will also look at how to create agents that feel like real characters.
Android Wear 2.0 is a major update and contains a number of significant updates that will make it easier to build delightful experiences for wearables. In this session, I will provide an overview of new features such as Standalone apps, Material Design on Android Wear and some of the new UI components we're making available (such as Navigation Drawers and Action Drawers), as well as complications and complication data providers.
With recent advances in wearable technology, it's now possible to create novel fitness experiences without building custom hardware. In this talk we take you through creating a fitness tracker in C# on Android Wear, covering Google Play Services and watch-faces along the way. If this piques your interest, you can build your own Android Wear-based fitness tracker in our code lab!
This is an introductory session to Android Wear. We will cover Design Principles and how to implement them. In particular, I will show how to enhance your existing notifications to make them shine on Android Wear, how to implement Android Wear apps that make use of the new possibilities Android Wear gives you as a developer such as voice input and GPS. Finally, we will take a look at implementing watch faces.
Google Play Services are a unified SDK that allow you to quickly and easily integrate Google features into your Android apps. Being rolled out to millions of Android devices, they provide easy access to Google services and allow you to innovate quickly.
In this session, I will give you a rundown of the core services available via Google Play Services and give you an overview of the new APIs that ship as a part of Google Play Services. We will also have a look at some of the lesser known features that will enable you to build apps that truly rock.
In this session, I will give an overview of Android Wear and how to integrate it in your product strategy. We will look at the underlying design principles and discuss a number of use cases for apps that connect to wearable devices. After that, we will take a look at some code examples and learn how to use the Android Wear SDK.
Google+ for Mobile Apps on iOS and AndroidPeter Friese
Create a more engaging and personalized experience for your users by incorporating aspects of Google+ into your mobile app. Learn how your users can share pictures, links, and more into Google+ from your app, and how doing so can raise visibility and discoverability of your application.
Cross-Platform Authentication with Google+ Sign-InPeter Friese
This presentations outlines how Google+ Sign-In allows your users to sign in once and then be signed in seamlessly across all of your apps. The session takes a look at Google+ Sign-in authentication models and highlights common pitfalls and best practices.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
35. let db = Firestore.firestore()
do {
_ = try db.collection(“movies")
.addDocument(from: movie)
}
catch {
print(“Error: (error.localizedDescription).")
}
Saving Data to Firestore
36. let db = Firestore.firestore()
do {
_ = try db.collection(“movies")
.addDocument(from: movie)
}
catch {
print(“Error: (error.localizedDescription).")
}
Saving Data to Firestore
40. /
/
Model
struct Movie: Codable, Identifiable {
@DocumentID var id: String?
var title: String
var releaseDate: Date
var rating: Double
}
Architecture: Model
41. class MovieViewModel: ObservableObject {
@Published var movies = [Movie]()
private var db = Firestore.firestore()
func subscribe() {
db.collection("movies").addSnapshotListener { (querySnapshot, error) in
guard let documents = querySnapshot
?
.
documents else { return }
self.movies = documents.compactMap { queryDocumentSnapshot in
try? queryDocumentSnapshot.data(as: Movie.self)
}
}
}
}
Architecture: ViewModel
42. struct SimpleMovieList: View {
@StateObject var viewModel = MovieViewModel()
var body: some View {
List(viewModel.movies) { item in
Image(item.coverImageName)
VStack(alignment: .leading) {
Text(item.title)
Text(item.releaseDate.asString())
}
}
}
}
Architecture: View
46. Thanks! Peter Friese, Developer Advocate, Google
@pete
rf
riese
h
tt
ps://pete
rf
riese.dev
h
tt
ps://medium.com/@pete
rf
riese
h
tt
ps://medium.com/
fi
rebase-developers
h
tt
ps://stackove
rf
low.com/questions/tagged/swi
ft
ui+
fi
rebase
h
tt
ps://github.com/
fi
rebase/
fi
rebase-ios-sdk
50. Data Flow
• Prope
rt
ies
• @State
• @Binding
• @ObservedObject
• @StateObject (✨ new in Swi
ft
UI 2)
• @EnvironmentObject
• Sarah Reichelt: Swi
ft
UI Data Flow
(bit.ly/Swi
ft
UIDataFlow)
52. struct DetailsView: View {
let movie: Movie
var body: some View {
ScrollView(.vertical) {
VStack(alignment: .leading) {
Text(movie.title).font(.title)
Text(movie.description).font(.body)
}
.padding()
}
.edgesIgnoringSafeArea(.all)
.background(Color(UIColor.secondarySystemBackground)
.edgesIgnoringSafeArea(.all))
}
}
Data Flow - Prope
rt
y
53. struct DetailsView: View {
let movie: Movie
var body: some View {
ScrollView(.vertical) {
VStack(alignment: .leading) {
Text(movie.title).font(.title)
Text(movie.description).font(.body)
}
.padding()
}
.edgesIgnoringSafeArea(.all)
.background(Color(UIColor.secondarySystemBackground)
.edgesIgnoringSafeArea(.all))
}
}
Data Flow - Prope
rt
y
Use for data thatdoesn’t change
54. struct GridView: View {
let movies: [Movie]
@State private var selection: Movie? = nil
var body: some View {
LazyVGrid(columns: columns, spacing: 20) {
ForEach(movies) { movie in
if (movie.id
!
=
selection
?
.
id) {
CardView(movie: movie)
.onTapGesture { select(movie) }
.matchedGeometryEffect(id: movie.id, in: ns)
}
else {
CardView(movie: movie)
.opacity(0)
}
Data Flow - @State
55. struct GridView: View {
let movies: [Movie]
@State private var selection: Movie? = nil
var body: some View {
LazyVGrid(columns: columns, spacing: 20) {
ForEach(movies) { movie in
if (movie.id
!
=
selection
?
.
id) {
CardView(movie: movie)
.onTapGesture { select(movie) }
.matchedGeometryEffect(id: movie.id, in: ns)
}
else {
CardView(movie: movie)
.opacity(0)
}
Data Flow - @State
56. struct GridView: View {
let movies: [Movie]
@State private var selection: Movie? = nil
var body: some View {
LazyVGrid(columns: columns, spacing: 20) {
ForEach(movies) { movie in
if (movie.id
!
=
selection
?
.
id) {
CardView(movie: movie)
.onTapGesture { select(movie) }
.matchedGeometryEffect(id: movie.id, in: ns)
}
else {
CardView(movie: movie)
.opacity(0)
}
Data Flow - @State
Use for UI state
57. struct DiscoverMoviesView: View {
@StateObject var viewModel = DiscoverViewModel()
@Environment(.presentationMode) var presentationMode
@EnvironmentObject var movieStore: MovieStore
var body: some View {
NavigationView {
VStack {
SearchBar(text: $viewModel.searchText)
List {
ForEach(viewModel.tmdbMovies) { item in
Data Flow - @StateObject
58. struct DiscoverMoviesView: View {
@StateObject var viewModel = DiscoverViewModel()
@Environment(.presentationMode) var presentationMode
@EnvironmentObject var movieStore: MovieStore
var body: some View {
NavigationView {
VStack {
SearchBar(text: $viewModel.searchText)
List {
ForEach(viewModel.tmdbMovies) { item in
Data Flow - @StateObject
Use for viewmodels
59. struct DiscoverMoviesView: View {
@EnvironmentObject var movieStore: MovieStore
func addMovie(movie: TMDBMovie) {
print("Adding (movie.title)")
let newMovie = Movie(from: movie)
movieStore.addMovie(newMovie)
dismiss()
}
}
Data Flow - @EnvironmentObject
60. struct DiscoverMoviesView: View {
@EnvironmentObject var movieStore: MovieStore
func addMovie(movie: TMDBMovie) {
print("Adding (movie.title)")
let newMovie = Movie(from: movie)
movieStore.addMovie(newMovie)
dismiss()
}
}
Data Flow - @EnvironmentObject
Use for passingstuff down
62. import SwiftUI
import Firebase
@main
struct JewelCaseApp: App {
@StateObject var movieStore = MovieStore()
init() {
FirebaseApp.configure()
}
var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(movieStore)
}
}
}
Sett ing up Firebase for Swi
ft
UI 2
😱 No more
AppDelegate
63. import SwiftUI
import Firebase
@main
struct JewelCaseApp: App {
@StateObject var movieStore = MovieStore()
init() {
FirebaseApp.configure()
}
var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(movieStore)
}
}
}
Sett ing up Firebase for Swi
ft
UI 2
Let’s use theinitialiser
64. import SwiftUI
import Firebase
@main
struct JewelCaseApp: App {
@StateObject var movieStore = MovieStore()
init() {
FirebaseApp.configure()
}
var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(movieStore)
}
}
}
Sett ing up Firebase for Swi
ft
UI 2