Skip to main content

Questions tagged [swift-language]

Swift is a programming language designed by Apple for creating iOS and OS X apps. Swift builds upon the foundation of C and Objective-C.

2 votes
1 answer
383 views

In Swift, functions can be defined with named parameters, for example: func greet(person: String) -> String { ... } which need to be used when the function is called : greet(person: "Anna&...
DarkTrick's user avatar
  • 286
1 vote
1 answer
258 views

I'm developing a Swift Package distributed via Swift Package Manager (SPM). I have other dependencies (Swift packages) that my package depends on. Is it possible to expose types (classes, structs, etc....
Fourth's user avatar
  • 79
3 votes
1 answer
279 views

I am writing unit tests for my SwiftData application. Currently, I am using in-memory database, which get reset after every test. What benefits will I gain if I start using real database? My main ...
user19037628's user avatar
1 vote
1 answer
173 views

My team and I are beginning to mock our API responses in our iOS app so we don't have to worry about our backend being up when testing. I have conditional compilation directives based on the ...
Derek's user avatar
  • 121
4 votes
4 answers
1k views

I hope this isn't too off-topic/opinion-based, I'm new here. I want to pass three elements of the same type into a function. The three elements are unique cards of a deck of cards, so they're not ...
dve.exe's user avatar
  • 59
2 votes
1 answer
161 views

My question is regarding how would the developer know when you add interfaces/protocols to their code and inject them as dependency. Consider an example of BudgetService. protocol ...
john doe's user avatar
  • 141
3 votes
1 answer
191 views

What is correct in your opinion regarding the creation and handling of models in an application let's say using MVVM, or even an MVC design pattern? I will try to illustrate the situation I see at my ...
Lucas's user avatar
  • 139
0 votes
2 answers
2k views

I've got these classes: enum Environment { case staging case production static func current() -> Environment { #if STAGING return .staging #elseif PROD ...
Bawenang Rukmoko Pardian Putra's user avatar
1 vote
1 answer
409 views

I am currently developing an iOS application where there are options on the screen to edit and delete a list. Only the user who created this list can edit or delete it. I am struggling to determine ...
Trenton's user avatar
  • 17
-2 votes
1 answer
160 views

I have an app written using MVVM and RxSwift. For navigation I'm using coordinator What is the best way to store user's credentials and pass them to Network Layer. I don't want to sore them in DB or ...
Roma's user avatar
  • 107
2 votes
4 answers
323 views

Having a bit of trouble on deciding the best way to store crypto values which are usually in decimals. Do I go with Double or Float? Or is there an even better type that Swift offers? My initial gut ...
Tank12's user avatar
  • 139
2 votes
1 answer
168 views

The other day, I came across this question on StackOverflow. In short, the user who asked the question wanted to extend a class from a third-party library to implement the Codable protocol, but ...
TallChuck's user avatar
  • 152
9 votes
1 answer
10k views

I hope this is the right place to ask. I'm an experienced developer, and have used MVC for much time. This question is in the context of iOS/macOS development for the most part, (SwiftUI). Using MVC ...
Woodstock's user avatar
  • 201
1 vote
0 answers
44 views

So, I have an entity called Consultation that is being used as a member variable of the class VideoCallViewModel that goes like this: struct Consultation: Equatable { enum Status: Int, ...
Bawenang Rukmoko Pardian Putra's user avatar
4 votes
0 answers
1k views

Are there best practices about how to prepare lightweight viewmodels with dummy data, that could be used in SwiftUI previews? Right now, I have a viewmodel for an in-app purchase screen, that needs to ...
Tomáš Kafka's user avatar

15 30 50 per page
1
2 3 4 5
8