Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [ios]

iOS is an operating system for mobile devices developed by Apple Inc. that is currently used in their iPhone, iPod touch, iPad, and Apple TV (2nd generation) devices. It shares a lot with Mac OS X, but is optimized for touch-based interfaces. Use this tag for questions about iOS-specific code.

Filter by
Sorted by
Tagged with
2 votes
1 answer
58 views

Show a list of downloads

I've been working on a Swift project that involves a seedbox app for my NAS, and I would appreciate some feedback on the code structure and especially on the placement of my observer. I've implemented ...
Bam Bou's user avatar
  • 21
0 votes
0 answers
48 views

Counting many to one relationship in Core Data

I tried to create simple application, yet I encountered problem with relationship using Core Data in SwiftUI. I have 2 simple models, ParentEntity: ...
ostojan's user avatar
  • 151
0 votes
0 answers
85 views

React Native (expo) mobile application publishing to stores in Azure DevOps pipeline using different backends for different app versions

Mobile development is quite new for me, and I would like to ask about a solution review. I'm not sure the way I publish the application is correct, I think good companies may do it differently. I have ...
alcohol is evil's user avatar
4 votes
1 answer
680 views

Caesar Cipher in Swift (iOS-app)

I have implemented the Caesar Cipher in Swift and incorporated it into an iOS-app. I guess it's formally correct. Please see the attached images, which show how the usage of the app is meant. Here's ...
michael.zech's user avatar
  • 4,326
1 vote
1 answer
74 views

Javascript CLI to boot iOS simulators, install project, extract data, and merge into JSON

I'm a DIY "dev" - so I really create things that I need or think they'll end up helping others. I wrote this Swift Package so the iOS community could get device bezel radius' to help with UI ...
markb's user avatar
  • 171
1 vote
0 answers
36 views

Good way to coding on React-Native?

I'm new on this field of coding, and I start to create by myself a project for iOS and Android. I'm a bit lost of how I supposed to organize my code, I saw different persons on YouTube doing their ...
Dorian's user avatar
  • 11
2 votes
2 answers
97 views

Building a UITableView with fixed number of cells progammatically

I am building this pet project with UIKit. The App's main goal is to keep track of my daily expenses. The AddExpenseViewController is responsible for capturing user ...
motita's user avatar
  • 21
2 votes
0 answers
65 views

Refactoring of this massive ViewController with a UITableView in it

I'm making an application that has a UIViewController with a UITableView in order to show the favorite users that the user of ...
user15675885's user avatar
2 votes
1 answer
158 views

MVVM pattern in Swift

I've been coding for some time now and since I am working alone I'm not strict in my coding structure approach(bad idea) and was only focused on getting things done which resulted in MVC(MASSIVE-View-...
Joe 's user avatar
  • 23
1 vote
0 answers
558 views

CoreBluetooth delegate to async stream

I want to use async/await by AsyncStream for Bluetooth scanning. The CoreBluetooth is using the delegate pattern. The following code provides an adapter for using ...
lotusirous's user avatar
5 votes
3 answers
243 views

Sum of natural numbers below threshold

I have this code: ...
Shum's user avatar
  • 53
2 votes
0 answers
67 views

Function for formatting data retrieved from a battery via Bluetooth Low Energy

I have the following function in Swift and am looking to improve the readability. The function takes from the deviceData object which holds maps of data like ...
Dylon Jaynes's user avatar
1 vote
1 answer
252 views

API call to list top stories using dependency injection in iOS with MVVM

I'm currently trying to find out what's the best networking architecture for MVVM applications. I couldn't find many resources and decided to go with dependency injection based architecture as per the ...
Tharindu Ketipearachchi's user avatar
3 votes
1 answer
938 views

UIImage downscale and compression

getFinalImageData(:UIImage) takes a UIImage and downscales its size dimensions (to 400 ...
trndjc's user avatar
  • 133
0 votes
1 answer
56 views

Understanding How To Approach A Permutational Word Search

This question is carried over from StackOverflow... First time posting here, so bear with me. The topic is constructing a search made up of a given string, and a series of letters, where each of the ...
Dan Donaldson's user avatar
1 vote
1 answer
683 views

Best way to do Input Validation on Swift/iOS/UIKit

I have the following form that creates a new "activity": For which I want to enforce the following requirements: Name => minimum # of chars: 1; maximum # of chars: 50 Description => ...
Enrique's user avatar
  • 145
2 votes
2 answers
233 views

Replace Western Arabic numerals with Persian digits

I've written and used this code in my apps whenever needed to convert any Western Arabic numerals into Eastern Arabic (or better say, Persian/Farsi) numerals in any Persian text. It works fine as ...
Neeku's user avatar
  • 121
2 votes
1 answer
3k views

Changing the color of some pixels in an image in Swift

My code is working perfectly fine, except for one-thing. The performance is not up-to the mark. What I am trying to achieve is I have an image with a few circles (each circle has a border with ...
Raja Saad's user avatar
  • 123
4 votes
2 answers
153 views

Fetching data closure completion

I started learning MVVM and API data fetching, so I made this code: Function loadDirector in which directorName value is ...
Jule's user avatar
  • 41
2 votes
2 answers
312 views

Initialize Swift class or struct values inline

For a Metal application, I would like to create and initalize texture object globally so it will not have to be optional, and will already be ready to use once ...
user244312's user avatar
3 votes
1 answer
141 views

Structure and readability of the code in swift ios

For a job in company I had to do a code assignment. My assignment performs all the required tasks needed to be done. But after one month the company provided me a feedback and said that we have ...
Cluadia Hedda's user avatar
3 votes
2 answers
142 views

Determine final player in a counting game

I made a function in which 17 players are counting to number N. Function as a parameter takes a number N and returns which player is going to say N. If current number is divisible by 9 the counting ...
Sah Sah's user avatar
  • 31
2 votes
1 answer
161 views

Swift code to extract most common page sequences from an Apache server log

So I received the following prompt for a code interview: "Please create an iOS app that downloads a text file from our server, parses the contents, and displays the results. The file is a ...
Russ J's user avatar
  • 201
0 votes
2 answers
178 views

How to load and get data from 2 files

I want to load 2 files and show this data in 2 strings. I trying to do it like this and it works fine. But I think it is not the best solution... How to do more elegant solution? ...
User's user avatar
  • 1
4 votes
2 answers
1k views

Better way to provide data to UIKit component from Combine pipeline

Today I'm researching how to provide data to UIKit component when using Combine pipeline. I could see tons of tutorials about how to use SwiftUI + Combine from internet, but not found anyone helpful ...
Zhou Haibo's user avatar
4 votes
1 answer
305 views

JSON parsing service

I created the following service for the purpose of sending in a file for parsing. I'm using the generics so that when I call parse() I can pass a custom type ...
Joe Scotto's user avatar
3 votes
1 answer
150 views

Swift iOS rewrite a function that use Firebase database without updating a global variable

I'm learning swift programming and i built a music trivia app for iOS that use firebase real time database. I have a function that before the game start get the number of record for each category of ...
salvatop's user avatar
2 votes
1 answer
86 views

Which is better-way to casting model

I need to convert my model to fit data in tableview cell finding better approach ...
Jaydeep Vyas's user avatar
2 votes
2 answers
179 views

What can I learn from this coding test?

So I was recently asked to complete the following challenge for an interview: Programming Problem Provide a production ready solution that accepts a new user name, validates a single string input as ...
Russ J's user avatar
  • 201
2 votes
1 answer
225 views

UIView position updates based on device motion via RxSwift

I've created a simple function to work as a level, where the dot on screen is centered when the device is completely flat. It changes position based on device orientation. I use RxSwift to update the ...
jclasley's user avatar
  • 101
5 votes
1 answer
331 views

Sorting JSON items from a site

So I recently applied to this job for iOS Developer and was invited to complete the following code challenge: As a next step, please complete this coding exercise in order to proceed with our ...
Russ J's user avatar
  • 51
1 vote
1 answer
533 views

Improving sqlite3 code in swift using c api

Trying to come up with a pattern where the code to open db, writing queries is elegant and clean while handling all possible error conditions. Following code ...
AppDeveloper's user avatar
3 votes
1 answer
104 views

Break music player into usable components in SwiftUI

I created a music player using swiftUI.I need to ask a question when I break up my player into usable components. How should I take this approach with the music player? because the music player is one ...
NinjaDeveloper's user avatar
2 votes
0 answers
26 views

Is this way of handling events in a Xamarin project memory safe?

I inherited a Xamarin project and I'm trying to find my way. The first task I completed involved creating a new reusable view and adding it to an existing screen. This was iOS specific, so I went and ...
Kevin's user avatar
  • 121
3 votes
1 answer
3k views

SwiftUI Dot indicator

I want to understand if I got this concept correctly. I should start work from ViewState; a reference type object holding the state of a view. Here it is called <...
fewlinesofcode's user avatar
4 votes
1 answer
113 views

POC for GithubUserFinder

I would like to request iOS developer community to please review my POC i.e. [GithubUserFinder][1] which I have created as part of job screening test at T-mobile Bengaluru. I have around 2 years of ...
Pooja Singh's user avatar
3 votes
0 answers
288 views

Combine asynchronous return values in SwiftUI

I have 2 asynchronous return values from 2 different classes, one from HealthKit, the other from MotionManager. I combine the outcome of these classes through a combinedViewModel. The code works, but ...
Bjorn Morrhaye's user avatar
2 votes
2 answers
631 views

Convert C to Swift

I trying to convert this C code for calculating distance from RSSI to Swift code. I try to do it by myself, but considering I'm beginner, I need help in how to do it. Here is C code: ...
Win Fan's user avatar
  • 23
1 vote
1 answer
179 views

Service Locator with Lazy Loading in Swift

I am experimenting with the ServiceLocator pattern. I'd like to support lazy loading of items. ...
Teddy K's user avatar
  • 113
1 vote
0 answers
640 views

iOS Core animation cancel and restart [closed]

There is a simple movement CAKeyframeAnimation, what needs is that I can cancel and restart the animation freely. The key point of the following code, is that I ...
DNG's user avatar
  • 121
1 vote
3 answers
3k views

Create UIView programmatically in Swift

I am generating View and setting constraints programmatically in UIViewController ...
saurabh's user avatar
  • 156
2 votes
3 answers
187 views

I want to take away WebService call from UIViewController

I am using Moya to make network calls in Swift. In my ViewController I am calling the WebService and creating a model from response. ...
saurabh's user avatar
  • 156
2 votes
0 answers
740 views

Java's AtomicInteger equivalent in c#

I'm trying to replicate Android's GenerateViewId() to assign a unique Tag to dynamically created UIViews in Xamarin.iOS. ...
user avatar
1 vote
1 answer
97 views

Initializing more than one instance object at a time in init method

I have a RadioStation class file and a view controller where I create two station objects based on this class, one for FM and one for AM. I created both of these ...
timman's user avatar
  • 149
3 votes
1 answer
81 views

Handle HTTP and BLE requests

Im implementing and designing a workflow that performs both HTTP and BLE requests. Im having trouble figuring out the best approach to design a service to handle both types of requests, and manage ...
J. Doe's user avatar
  • 45
6 votes
2 answers
2k views

100DaysofSwiftUI - Project 1 - Challenge 1: Convert temperature units: Celsius, Fahrenheit and Kelvin

This is my code to solve the challenge in 100 Days of SwiftUI by Paul Hudson. This is the first challenge in the series and I chose to convert the temperature units from C° -> F°, F° -> C°, C° -> K° ...
Kareem Moustafa's user avatar
2 votes
2 answers
197 views

Searching within a data model using an array matching multiple terms

I have a standard tableview app that displays information from a data model array that uses a custom class. There is a UISearchController to filter the data. A ...
Chris's user avatar
  • 226
1 vote
0 answers
35 views

Manage Recent List Of user and staff type objects

So I have a view which shows recent 5 staff users and 5 customers for a restaurant app. I am storing this in user default. I am also managing the currently selected object. Here is my class. ...
Prashant Tukadiya's user avatar
1 vote
1 answer
152 views

iOS: prettify random color for debugging

iOS: prettify random color for debugging I used to use random color to debug, from colors I like ...
dengApro's user avatar
  • 381
2 votes
1 answer
436 views

iOS Body-Mass-Index (BMI) app

This is "homework" from a Swift course, which I'm currently taking. A mockup and the image-assets are provided by the instructor. We are supposed to create the layout and to write some appropriate ...
michael.zech's user avatar
  • 4,326

1
2 3 4 5
8