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
0answers
52 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. ...
1
vote
1answer
58 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 ...
3
votes
1answer
42 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 ...
5
votes
2answers
108 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° ...
2
votes
2answers
106 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 ...
1
vote
0answers
29 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. ...
0
votes
0answers
50 views

Downloading large amount of data and storing on Android & iOS

So I have this API that downloads from our web service, but the we service sends it as a ZIP file instead of a json stream or something else. Now the files can get quite large butt they are not ...
0
votes
0answers
65 views

Swift for flattening JSON nested objects

I am receiving JSON from a service API (Airtable) that returns an object with a single key records which is an array of objects. These objects have most of their ...
1
vote
0answers
41 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 ...
2
votes
1answer
80 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 ...
1
vote
1answer
72 views

Convert image to grayscale

To convert JPEG file, C function, bgraToGrayscale is called from Swift. Is there a better way to 1.allocate memory and 2.access pointers than the ways they have been done in code below? And ...
1
vote
1answer
114 views

Unit Test class from iOS

I am learning to write test cases in iOS using Swift. I was stuck at testing static functions from my Utilities class, so I ...
2
votes
2answers
74 views

Handling view state for cardview

I have two buttons 1) Chat button 2) Annotation Button On tap each view comes from bottom and when tap outside view hidden back (Please refer the screen shot) On tap On annotation On tap on ...
3
votes
1answer
103 views

ValueAnimator for IOS - Did I butcher it up?

I am trying to make an IOS tool similar to Android's ValueAnimator... more or less This is useful for situations where you simply want a value to "animate" over time, but rather than necessarily ...
1
vote
0answers
90 views

Clean way of passing parameters in swift

I am creating a user request model to pass-params for web service call toRegisterParams() is used call register web service request toLoginParams() is used call register web service request so my ...
2
votes
0answers
58 views

Convenient way to make an UIImageView ExpressibleByStringLiteral

I want to reduce boiler-plate code and write like this when developing in iOS: let imgView: UIImageView = "share_fareware_text_bg" Here is implementation code: <...
1
vote
0answers
45 views

Combining the text from selected TextFields into 1 TextView - Conditionally [closed]

ViewController2 (source) Has several TextFields, each with their own switches. ViewController1 (destination) Has one TextView waiting for data to be sent to it from ViewController2 (source) But i ...
1
vote
0answers
104 views

iOS Calendar Navigation and Layout

In an effort to explore how the default calendar app works and to experiment with container view controllers, I created the following mock app. See this post for more info about my motivation for this ...
2
votes
1answer
41 views

iOS Attributes in the data model

I am working on a product-related app where the data model for a product attribute feels too heavy. But I can't split it into several small data models because they are all about goods. At present, ...
3
votes
1answer
75 views

UITableView allowing some kinds of requests to be deleted with swipe gestures

I have a tableview which shows a list of objects called Requests. It has 3 segments. Namely Accepted, Received and Sent. And the objects for each segment are in 3 arrays. I want to enable deleting ...
2
votes
1answer
192 views

Cookie Clicker Game

I'm getting into Swift iOS development, and decided to create a Cookie Clicker application as a first attempt. Since I am very new with Swift, I would like feedback and criticism on everything ...
2
votes
0answers
43 views

check condition with userdefaults value exist or not [closed]

I am check first time userDefaults will not save value return 0 else get value from userDefaults I am checking if userDefaults will not save the value, and If it ...
4
votes
0answers
69 views

Swift iOS app for showing motivational quotes, with multiple screens

I'm one month into self-learning Swift, and I would like some advice to improve my coding skills. I have listed 2 situations that I think I need to improve. I'd like some feedback focusing on my use ...
2
votes
1answer
54 views

Playing a sound depending on the currently displayed flash card image

I've developed a fully working flash card app for kids. It has a UIImageView that cycles through 26 cards (abcs) via a gesture click and a music button that will ...
1
vote
1answer
45 views

App sends location data to website

Explaining the idea and first steps Today, I had the idea to do a website which displays my current position. I searched in the App Store for an App and found one named SendLocation. This App ...
4
votes
1answer
81 views

Force-unwrapped property as a contract

I have a class, which is meant to show a full screen modal controller with a set of actions (apart from actions it also has some static content, a lot of labels and images which are irrelevant, so I ...
3
votes
1answer
164 views

Splitting a long string based on its graphical presentation

I got a long string, let's call it Story. I fetch this story from a database so I don't know how long it is. I want to display this story in a view, but what if ...
1
vote
1answer
42 views

Calling API only once on changing segments

I am working on a screen which has segmented control and has 3 segments (year value 2019, 18, 17) and what I am doing is that on each segment click I have to reload data inside a tableview (getting ...
2
votes
4answers
502 views

Showing a welcome screen once per day

I have this method, which first basically shows a Welcome screen to user only once per day. The code I have so far is this ...
5
votes
1answer
242 views

Networking structure for Swift iOS app

I would like any constructive comments regarding the structure of this simple App that takes an API response and then displays on a table view. The URL is written in a ConstantsAPI file ...
2
votes
1answer
47 views

Checking user verification status

The User story is as follows: Users are allowed to get "verified", so other users know they have passed a background check. After tapping "get verified" button, or the "verification badge" ...
0
votes
2answers
221 views

Counting sort in Swift

I have this sorting algorithm which takes an array of dictionary values: guard var imageUrlString = anyImage.value as? [String:AnyObject] else { return } I then ...
2
votes
1answer
194 views

Codable Failure Response Handler

Suppose You have two kind of response like one for success and one for failure Success response model will looks like ...
1
vote
0answers
79 views

UICollectionViewCell's content layout misbehaves when UICollectionView scrolls to the top of the screen

UICollectionViewCell's content misbehaves , the layout animates, when UICollectionView scrolls to the top of the screen. I am asking here, because it looks like an apple's bug. looks like squeezed ...
4
votes
1answer
94 views

Creating directory within Application Support, and preventing iCloud backup

I'm using react native to build an iOS app, but have little to no experience in obj C or iOS development. The app I'm building has a bunch of content files that aren't user specific, will be ...
2
votes
1answer
137 views

Quiz app with Practice and Exam modes

I am building a Quiz app in swift (my first app) to practice a few skills (using CoreData, working with plists, UIKit etc.) and later to work with a server which stores the Exercises. Here's my ...
1
vote
0answers
388 views

Side menu handling ios

I am playing with 3 Main Classes Please have a look I have integrated https://github.com/jonkykong/SideMenu I have one tableview which act as leftViewController This class is show the list of ...
0
votes
1answer
196 views

Initiating Child ViewController from UIStoryBoard in iOS

I'm trying to use inheritance in UIViewController where base class has XIB in storyboard. I'm troubling with initiating different children classes with that XIB. I ...
1
vote
0answers
42 views

Side Scrolling App Too Slow (using UIScrollView)

I'm building an app where the user can press play and then the app will scroll through some musical notes (like sheet music). I use a timer and counter to move the view along. The code works ok, ...
2
votes
1answer
123 views

Finding valid path on 2D Grid

I got a 2D grid (n x n matrix). The user selects his player in this 2D grid and after that selects another node in this grid to mark his destination position. The player is allowed to move ...
2
votes
1answer
73 views

How can this swift, firebase image fetching, function be made more concise?

I am trying to fetch a group of images within a place in Firebase database ref. I then loop through each image adding it to an array which is then supposed to be added to a tableview cell. I was ...
2
votes
1answer
162 views

Manage Game Level with enum

Basically What I have is basket ball App. In which I have Added some levels and difficulties. logic is simply use tupple in enum and I have some methods to update / get current level with new values ...
2
votes
2answers
6k views

Form for OTP entry with six single-character text fields

I am working on an app in which I have to pass 6 digits OTP through 6 textFields in which you to provide only one character and after that it automatically goes to ...
3
votes
2answers
519 views

Tableview Subclass implementing delegate datasource

I have two view controllers which have same tableview. One is for Post and one is for Profile, which also contains a post by a user. I have decided to reuse the code, so I have created the class ...
2
votes
1answer
122 views

Closure implementation

I have custom cell of tableview which is used as header as well as normal cell. In custom cell I have this properties ...
4
votes
1answer
135 views

“What To Do” App

I am starting to build up my portfolio, so I am starting to build projects whenever an idea pops up in my head. So, I decided to build an app that helps you decide what to do. Basically how it works ...
3
votes
1answer
625 views

Presenting and passing data to a modal view controller without using prepare(for:sender:) method

I am using a toolbar button to present a modal view controller (in which I let the user export data as a PDF file). The main section of my app is a ...
1
vote
1answer
61 views

Damage or Heal based on the buttons you press

If you press the damage button, it will damage armor before health. If you press the heal button, it will heal armor before health. The project is here: https://github.com/austingaee/DamageHealth-...
3
votes
1answer
548 views

Adding dragging ability to a UIView using UIKitDynamics

I recently published an iOS control/component called BJDraggable which basically, with a call of a method, enables us to drag a view within its superview boundary. ...
4
votes
0answers
6k views

Page and center UICollectionView like App Store

I need a collection view to page through cells and center it like the App Store, where a portion of the previous and next cells look like this: The native ...

1
2 3 4 5
8