En iPhone,puedes traducir el mensaje cuando solicitas el permiso para usar la cámara en una app. Lo que no puedes es mostrar diferentes mensajes en caso de que tu app tenga diferentes funciones a la hora de usar la cámara. Apple dice que incluyas todo en el mensaje #iosdeveloper
8. Fetch Data (Completion Handler)
Network.shared.apollo.fetch(
query: GetUsersQuery()
) { result in
switch result {
case .success(let graphQLResult):
if let users = graphQLResult.data/?.users {
print(users)
}
case .failure(let error):
print(error)
}
}
9. Fetch Data (Async/Await)
Modern approach.
func fetchUsers() async {
do {
let response = try await
Network.shared.apollo.fetch(
query: GetUsersQuery()
)
print(response.data/?.users)
} catch {
print(error)
}
}
Why Preferred?
Cleaner code
No callback nesting
Better readability
Easier error handling
10. Mutation Example
GraphQL
mutation CreateUser {
createUser(name: "Phoenix") {
id
name
}
}
Swift
let mutation =
CreateUserMutation(name: "Phoenix")
Network.shared.apollo.perform(
mutation: mutation
) { result in
print(result)
}
11. Subscriptions Example
let subscription =
MessageAddedSubscription()
Network.shared.apollo.subscribe(
subscription: subscription
) { result in
print(result)
}
Used with:
ApolloWebSocket
for real-time communication.
#iOS#Swift#GraphQL#ApolloIOS#SwiftUI#UIKit#MobileDevelopment#iOSDeveloper#SoftwareEngineering#Programming#Tech#Apple#AsyncAwait#API#Develop
Building an iOS app or trying to get one ready for the App Store?
Alderframe LTD can help with:
• iOS app creation
• Bug fixes
• UI/UX polish
• App Store submission
• App reviews & audits
• Subscription/payment flow issues
• Launch preparation
Fair pricing. Clear communication. Practical results.
DM me if your iOS app needs building, fixing, or getting over the finish line.
#iOSDeveloper#AppDevelopment#AppStore#SwiftUI#iOSApps#MobileAppDevelopment#StartupApps
4. Apollo iOS
Most popular GraphQL library for iOS.
Features:
- Type-safe Swift models
- Query generation
- Code generation
- Async/Await support
- WebSocket subscriptions
- Cache management
Installation
Swift Package Manager
File
→ Add Package Dependency
Package:
github.com/apollographql/apo…
5. Apollo Architecture
iOS App
↓
Apollo Client
↓
GraphQL Server
↓
Database
Apollo Client handles:
Queries
Mutations
Subscriptions
Caching
Network layer
6. Apollo Setup
Network Layer
import Apollo
final class Network {
static let shared = Network()
private(set) lazy var apollo = ApolloClient(
url: URL(string: "api.example.com/graphql")!
)
}
7. Writing GraphQL Queries
Create:
query GetUsers {
users {
id
name
email
}
}
Apollo generates:
GetUsersQuery
Automatically.
This is a huge advantage because:
- No manual Codable models
- Compile-time type safety
#iOS#Swift#GraphQL#ApolloIOS#SwiftUI#UIKit#MobileDevelopment#iOSDeveloper#SoftwareEngineering#Programming#Tech#Apple#AsyncAwait#API#Develop
3. Core Concepts
Query
Used to fetch data.
query GetUser {
user(id: 1) {
id
name
email
}
}
Equivalent to:
http
GET
Mutation
Used to create/update/delete data.
mutation CreateUser {
createUser(name: "Phoenix") {
id
name
}
}
Equivalent to:
http
POST
PUT
DELETE
Subscription
Used for real-time updates.
GraphQL
subscription {
messageAdded {
id
text
}
}
Use cases:
- Chat apps
- Live scores
- Stock market
- Notifications
Usually works through:
Plain text
WebSocket
#iOS#Swift#GraphQL#ApolloIOS#SwiftUI#UIKit#MobileDevelopment#iOSDeveloper#SoftwareEngineering#Programming#Tech#Apple#AsyncAwait#API#Developers
2. Why Use GraphQL in iOS?
Prevents Over-fetching —
REST:
Need -> name
Receive -> name email phone address
GraphQL:
Need -> name
Receive -> name
Prevents Under-fetching —
REST:
http
/users/1
/users/1/posts
/users/1/comments
Multiple API calls.
GraphQL:
query {
user(id:1){
name
posts{
title
}
comments{
text
}
}
}
Single request.
Better for Mobile Apps
Benefits:
- Less bandwidth
- Fewer network calls
- Faster screens
- Better battery efficiency
- Better performance on slow network
#iOS#Swift#GraphQL#ApolloIOS#SwiftUI#UIKit#MobileDevelopment#iOSDeveloper#SoftwareEngineering#Programming#Tech#Apple#AsyncAwait#API#Developers
GraphQL in iOS —
1. What is GraphQL?
GraphQL is a query language for APIs developed by Meta (Facebook).
Instead of receiving an entire response from the server like REST, the client requests only the fields it needs.
REST -
REQUEST
http
GET /users/1
RESPONSE:
JSON
{
"id": 1,
"name": "PSKV",
"email": "mail ID",
"phone": "number",
"address": "...",
"posts": [...]
}
Even if you need only:
name
email
you still receive everything.
GraphQL -
REQUEST:
query {
user(id: 1) {
name
email
}
}
RESPONSE:
JSON
{
"data": {
"user": {
"name": "PSKV",
"email": "mail ID"
}
}
}
Only requested fields are returned.
#iOS#Swift#GraphQL#ApolloIOS#SwiftUI#UIKit#MobileDevelopment#iOSDeveloper#SoftwareEngineering#Programming#Tech#Apple#AsyncAwait#API#Developers
Mastering Grids in SwiftUI: A Simple Yet Powerful Tool for iOS Developers
When building iOS apps, presenting data in a clean and organized way is just as important as the data itself. That's where grids come in.
Whether you're creating a photo gallery, a product catalog, dashboard, or a collection-based interface, grids help structure content efficiently and improve the user experience.
One of the things I appreciate about SwiftUI is how easy it makes working with grids. With components like LazyVGrid and LazyHGrid, developers can create responsive layouts with minimal code while benefiting from performance optimizations such as lazy loading.
If you're new to iOS development, grids are a great example of SwiftUI's declarative approach. Instead of manually calculating positions and spacing, you define the layout structure and let SwiftUI handle the rest.
As your apps grow, grids become even more valuable. Lazy loading ensures that views are created only when needed, which helps maintain smooth performance when displaying large collections of data. Combined with adaptive grid items, layouts can automatically adjust to different screen sizes without requiring multiple implementations.
What starts as a simple way to display data often becomes an important tool for building scalable, performant, and maintainable user interfaces.
The best part? The same grid system that helps beginners build their first collection view can help experienced developers solve complex layout challenges.
What's your favorite use case for grids in SwiftUI?
#iOSDeveloper#SwiftUI#Swift
🚀 Mobile App Developer
Building innovative iOS or Android apps? Let's connect with developers creating great mobile experiences.
📩 olasunkantaiwo2021@zohomail.com
#MobileDeveloper#iOSDeveloper#AndroidDeveloper
🚀 Mobile App Developer
Building innovative iOS or Android apps? Let's connect with developers creating great mobile experiences.
📩 olasunkantaiwo2021@zohomail.com
#MobileDeveloper#iOSDeveloper#AndroidDeveloper