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
27 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
40 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
54 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
32 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
68 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
70 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
37 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
45 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
45 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
44 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
76 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
160 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
38 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
470 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
164 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
44 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
163 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
94 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
44 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
41 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
125 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
248 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
112 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
32 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
76 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
58 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
142 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
3k 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 ...
2
votes
2answers
279 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
104 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
132 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
447 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
60 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
401 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
5k 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
905 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
108 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
185 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
235 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
195 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
10k 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
219 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
75 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
395 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
966 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
793 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
143 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: ...