Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-1
votes
0answers
23 views

Save image+gif as single gif/video file [closed]

I have a background image on which I can add multiple images, gifs, Text (IQLabel). How can I make a single gif or video of this. The output file should play all gifs (gif images can vary in size). ...
1
vote
1answer
65 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 ...
0
votes
0answers
87 views

Swift Update Main Collection (Array) from other Collection(Array) of Codable classe [closed]

I have implemented pull to referesh in application as well as there is pagination. On pull to refresh action I am fetching page1 data for latest data. and update ...
0
votes
0answers
35 views

Two different blocks with reverse direction in single method in Swift

So I've been trying to refactor my existing code for loading data from server and synching it to the local DB. Initially there were multiple methods with duplicated pattern, then I refactored them ...
0
votes
1answer
26 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 ...
1
vote
1answer
60 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
122 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
76 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 ...
0
votes
1answer
32 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-...
0
votes
0answers
15 views

Quick-Dial Button/ActionSheet within ViewController

I'm creating a button that will dial a user quickly in to their conference calls should they have a default provider set. If they have no default provider an action sheet will appear that allows them ...
0
votes
0answers
70 views

Candidate registration, with validation, using MVVM

I am new to MVVM. I Created Model class CandidateRegisterModel and ViewModel class CandidateRegisterViewModel ...
3
votes
1answer
96 views

Adding dragging ability to a UIView using protocols

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. ...
5
votes
0answers
696 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 ...
2
votes
1answer
153 views

iOS Memory Game - Swift 4

I'm learning iOS through this past Stanford CS193P course. I've just completed the first assignment and would love a code review as I can't actually turn in an assignment for feedback since the course ...
0
votes
0answers
42 views

Creating a class that builds modal views to display announcements or issues

I'm looking to create a class that will display a template pop-up to the user to alert them to new features/updates and when their calendar isn't synchronised correctly. I'd like to do this in a ...
2
votes
0answers
95 views

Log in user through json and display the application

I am currently learning swift 4 and would like to ask you to correct my code. (I would like to have a pattern for learning the "beautiful code"). My code gets data from the server in JSON format and ...
4
votes
1answer
91 views

iOS Swift 3 app that requests data from the Stack Exchange API

This is my first Swift app, so I want to improve everything that I can about my code and know what I can do better. The app requests 10 developers from StackExchange API and displays them in a table ...
3
votes
1answer
72 views

Ring Timer Animation with Chasing Tail using CoreAnimation

After a fair amount of trial and error, I have gotten the animation acting in the manner that I want it, as seen here. However, I always feel like I'm writing way too much and too sloppily when trying ...
3
votes
1answer
117 views

Multilingual app without localizing

I'm making an iOS app which supports multiple languages but not in the built-in localized way. In iOS, for localization to work, the user has to change the device's language. But in the app I'm ...
1
vote
1answer
2k views

Prevent a UITextField from being input with aphabetic characters

The goal is to disallow typing alphabetic characters as input in a UITextField. Please tell me if this approach is convenient. ...
0
votes
1answer
103 views

Sychronous wrapper around UIApplication.openURL:options:completion:

I am deprecating iOS 9 on a project. One of the differences in the framework is that the openURL method has changed. iOS 9 - (BOOL)openURL:(NSURL *)url; iOS 10 ...
3
votes
1answer
66 views

iOS app that signs people up for a street-ball league in their neighborhood

I know there is some repeated code in here, which is why I need a code review. The point of this app is simple, the user opens it, taps "begin", they select their league - men's, women's or co-ed, and ...
1
vote
0answers
1k views

Swift/iOS component for label with clickable text buttons

So I'm creating a component based on UILabel, which I'm calling RichLabel. The main goal is to add support for clickable links (...
1
vote
1answer
251 views

Observable implementation

I have implemented a simple Observable class. I think that there is still room for improvement. Especially the fact that I have separate array to observe results ...
2
votes
1answer
212 views

Fed Singleton struct class from plist

I have a plist file which has URLs in it and struct class is feeding from this plist. This struct class has static variable which I use to reach URLs in every part of the app. My question is that I'm ...
1
vote
1answer
407 views

Swift/iOS: Subclassing UILabel and setting properties

I'm writing this subclass to add an icon to a UILabel. It works, but I'm wondering if this is the best/cleanest way to do it. Do you see any improvements? Should maybe ...
2
votes
1answer
321 views

iOS Set game implementation

So I'm working through a MOOC, Stanford's "Developing iOS 11 Apps with Swift", and in the course the professor highly emphasizes how important it is to separate your View from your Model in the MVC ...
0
votes
2answers
98 views

Optimizing UITableViewCell with singleton property

In UITableViewCell class, I have two properties: UINavigationController ...
1
vote
0answers
19 views

ManuallyCompletableOperation for OperationQueue

Here is a very handy subclass of Operation that allows to do asynchronous tasks inside an OperationQueue: ...
2
votes
1answer
682 views

Create a view with a thick inner border that has a gradient

InnerGradientBorderView is a subclass of UIView that has a thick border with a gradient. I have tried to replicate the Zoom ...
1
vote
0answers
53 views

UIImageView Animation with duration change

I have an array of UIImages that I animating using UIImageView, and creates an effect of wave. the user have plus and minus ...
1
vote
2answers
143 views

iOS tableView with two special rows of headers

Using swift for iOS, here is my cellforRow method ...
1
vote
1answer
151 views

Create new UIImage each time or once

I am writing a control that has a toggle on (show/hide password). The UITextfield has a UIImageView in that acts as the toggle. ...
1
vote
0answers
539 views

Upload multiple photos to server

I am uploading an array of photos to the server (using Alamofire): ...
3
votes
0answers
199 views

Applying Gaussian blur to UILabel

Here is the code and it is really slow, like seconds slow to render about 25 labels. ...
3
votes
2answers
180 views

A C++ wrapper for Apple CoreFoundation

The wrapper makes it easy to manage memory when using CoreFoundation objects. It aims to act like a simple shared_ptr. Here is a usage example: ...
-1
votes
2answers
96 views

Up/down arrow key commands

There are sources with these rules. I've listed the source too much, but I want to make it shorter and easier. ...
1
vote
0answers
152 views

Singleton lock for a queue

This is a singleton class which can be accessed anywhere including the shouldLock variable. I want to make sure that the variable is thread safe. Basically the <...
3
votes
1answer
445 views

Drawing a word, with a box around one letter

I'm working on a draw function which needs to draw the word 'crux' in the center of the current view and then draw a red box around the 'x' character like this: My ...
2
votes
1answer
81 views

Handling several types of messages over a web socket connection

I have a UIViewController with a Socket Connection established once viewDidLoad. This web socket is a multi-directional ...
2
votes
1answer
646 views

Filtering input characters for a numeric text field using logical operators

I did my code for "Bronze Challenge: Disallow Alphabetic characters" exercise in "iOS programming" book by Big Nerd Ranch (p.85). When I did the exercise I also changed code of func textField which ...
4
votes
0answers
329 views

Update UI once all API calls are done

I'm learning Swift at the moment but I would like to produce well-organised code. The goal of my little app is to display the weather of my current location. I use : the API of Darksky : https://...
3
votes
2answers
1k views

Comparing strings, ignoring case, punctuation, and whitespace

I have built a search function that will compare strings regardless of punctuation and whitespace. It is case insensitive. Here is my current function: ...
2
votes
0answers
119 views

Comments on singleton Swift status bar alert

I was trying out some projects like a status bar alert. It made most sense for this status bar to be a singleton: there is only one alert visible at a time. ...
2
votes
1answer
74 views

Algorithm optimisation to get first parent with specific kind of class

I am writing an extension for UIViewController to search all the parents and return a specific parent which is a kind of specific class. here is my try : ...
1
vote
0answers
131 views

Handler for a UI to select multiple days of the week for notifications

In the app I am currently working on, there is a part where user can set multiple local notifications for specific weekdays. The array of buttons is represented by a separate class, which utilises ...
2
votes
1answer
121 views

Extension vs Class For ViewModel

What the advantages & disadvantages to each of these approaches pertaining to creating file that takes care of the view configuration to reduce a controller's file size. Main Purposes Are: ...
1
vote
2answers
90 views

Switching between queues in cellForIndexPath method

My tableView is scrolling very slowly because there is a fetch request done in every cellForIndexPath method. I have verified ...
2
votes
0answers
57 views

Choosing structure of fields validation module in Swift

I've implemented abstract module for fields validation according to this MVP clean architecture repo. In a nutshell I've created ValidationGateway protocol ...