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
3
votes
0answers
14 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 ...
1
vote
1answer
35 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
40 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
72 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
158 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
37 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
453 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
147 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
39 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
146 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
72 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
39 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 ...
3
votes
1answer
36 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
120 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
158 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
84 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
31 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
72 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
54 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
132 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
2k 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
42 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 ...
2
votes
2answers
200 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
103 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
130 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
385 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
59 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
346 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
4k 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
813 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 ...
2
votes
0answers
105 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
173 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
194 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
180 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 ...
0
votes
1answer
9k 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
2answers
201 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
74 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
2k 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
2answers
1k 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
377 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
879 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
746 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
138 views

Optimizing UITableViewCell with singleton property

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

ManuallyCompletableOperation for OperationQueue

Here is a very handy subclass of Operation that allows to do asynchronous tasks inside an OperationQueue: ...
2
votes
1answer
2k 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
89 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
594 views

iOS tableView with two special rows of headers

Using swift for iOS, here is my cellforRow method ...
1
vote
1answer
373 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
1k views

Upload multiple photos to server

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

Applying Gaussian blur to UILabel

Here is the code and it is really slow, like seconds slow to render about 25 labels. ...