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
1
vote
0answers
1k views

RxSwift iOS Observable FIFO Queue Implementation in Swift 2

I am trying to develop an Observable queue that executes given Observable chains one at a time. The code will be used to encode videos on an iPhone and only one queue will be needed per launch, ...
1
vote
0answers
201 views

Multi-Context CoreData Implementation

I'm using Mulit-Context CoreData for Asynchronous Saving, which follows this architecture: Here is code stack: ...
2
votes
0answers
106 views

Private contexts and their parents in CoreData

I find myself following this pattern a lot in my core data code, which works, but I'm wondering if it is needed... ...
1
vote
1answer
1k views

Styling navigationController per viewController

The design of my application consists of multiple viewControllers which all have different styling applied to them. The following code is used in every viewController to style the viewController: <...
13
votes
1answer
1k views

Interview coding challenge for iOS Part 2 - the application in Objective-C and Swift

I recently interviewed with a company that needed a C/C++ programmer to work on the iOS side of the products. The job description indicated they needed someone with 4 years of Objective-C and iOS ...
5
votes
1answer
807 views

Interview Coding Challeng for iOS Part 1 - the Static Objective-C Library

I recently interviewed with a company that needed a C/C++ programmer to work on the iOS side of the products. The job description indicated they needed someone with 4 years of Objective-C and iOS ...
1
vote
1answer
2k views

Draw grid programatically with borders

I need to draw a grid with some special requirements. My current solution is working but is far away from ideal I guess. Attached you can find the current working solution: Some of my thoughts which ...
1
vote
1answer
1k views

UIViewController without interfacebuilder

I have a template I've been using with Swift for UIViewController and UIView subclasses without a ...
4
votes
1answer
177 views

Convert String to Integer (calculator app)

I'm currently learning Swift and today I created my first application, a simple calculator. My main goal was to practice and create something without any help. After a few hours my application was ...
5
votes
1answer
6k views

Countdown timer in every table cell

I am making countdown app with multiple records, so I am using UITableView to show that records and countdown dates. What I do is just take one timer and reload cells on every second. Is this a best ...
4
votes
1answer
68 views

iOS game of drawing sticks with AI and scoring

My code actually works. I was just wondering if there was alternative ways, maybe even more efficient ways of coding my program. This is suppose to be a game of drawing stick, and it's recording the ...
4
votes
1answer
3k views

Finding consecutive days in an array of dates

The problem: How to get the largest number of consecutive days from an array of unknown number of Date objects, by taking into account days only like 4th of April, 5th of April and so on. Example ...
1
vote
1answer
36 views

Making a TableViewDataSource more independent of the data it utilizes

I have written an ordinary tableView to display a list of players, with the following data structure that's in place. A Conductor (which is the user), has many <...
3
votes
1answer
144 views

REST API client

I am new in iOS development and Swift. I am going to develop a simple application which communicates with external REST services. This is my first experiment. I appreciate feedback on best ...
2
votes
0answers
187 views

Throttling several HTTP parallell requests

I'm using the above piece of code to do some HTTP calls in parallel. This loop is running inside a NSOperation. I must throttle a bit the requests (so I don't overload the server). The code is working ...
2
votes
1answer
1k views

Implementing delegate methods in an UIView class

This is my UIView class: ...
5
votes
1answer
3k views

Swift 3 UIPicker

I have been making a little test app to try and learn Swift 3 / iOS better. I started a while ago with with Swift 2 but stopped, so getting back into it, but there is so much iOS to learn! It seems ...
1
vote
0answers
51 views

Create a new event and view its details

I have A page, where you can create an event using the name, location, enddate startend date, attendee, URL location, repeat options, alert options and etc. There is two scenario when the user can ...
2
votes
1answer
151 views

CommandLine StreamFormatTester

Using Chris Adamson's book Learning Core Audio I'm getting familiar with Core Audio for Mac/iOS. The code examples are 100% Objective-C. I'm trying to follow along using Swift 3. This small piece of ...
1
vote
2answers
2k views

Checking that a 6-digit number is not repeated and not in sequence

Following is the objective C code snippet to check that the 6-digit number is not repeated and not in sequence/reverse-sequence. I have just printed the proper messages in ...
1
vote
1answer
2k views

Showing segue after button action

I have an iOS Swift app with 8 buttons that call the same segue, but this is very repetitive. How can I refactor so it uses the same function prepare? ...
6
votes
0answers
510 views

Swift class to check ApplePencil reachability

I've implemented a class that lets you check out whether there is an ApplePencil connected to the device or not. ...
3
votes
0answers
428 views

Posting iOS notifications from sender or from receiver

In Swift, should I be posting notifications to the iOS notification center from the device sending a text message or from the device receiving it? I'm using ...
3
votes
1answer
4k views

iOS Core Data Model with Swifty JSON

I have been using SwiftyJSON to create my models of Object in Swift. But recently, I moved to CoreData for saving the objects locally. I am new to CoreData and want to know the best practices I should ...
3
votes
1answer
439 views

Singleton class with custom initializer

In a Swift project, I have a class should be used as a singleton: ...
2
votes
1answer
17k views

Setting constraints for dynamic views in iOS

I have an app which uses Stack Views to update its UI depending on the number of pigs. For example below, 1 pig and 4 pigs. I set up Stack Views in Storyboard and set isHidden to true based on how ...
2
votes
2answers
1k views

Property value from an asynchronous operation

I have an app which has a session mechanism. When a user creates an account in the app initially, the API returns an access token, the expiry date of that access token and a refresh token which can be ...
0
votes
1answer
160 views

Simple HTTP API requests in an exam paper download app

So basically I am building an app that helps to download some documents via a rest api. Here is the SearchViewController ...
1
vote
1answer
919 views

Controlling Drone with iOS Speech Recognition

I got a Parrot Mambo which comes with an SDK for creating your own app for controlling it. I decided to use the iOS Speech Recognition library so I could use basic voice commands to control it. The ...
2
votes
1answer
349 views

Simple War game in Swift

I'm new to swift and I want to know if I'm doing something wrong or a harder way. I made a simple war game app. Tames of variables aren't correct, I know, but I was doing it quickly and I didn't worry ...
4
votes
2answers
16k views

Showing activity indicator (loading image) while processing in background

I have a login screen on my iOS app. When I click login button I want to make sure that user should be displayed a loading image in center of the screen. I found lots of different methods online but ...
1
vote
1answer
518 views

Configure Table cell in model class

I'm trying to show data in UITablleView after getting it from an HTTP request. I heard that the best and professional way to do it is configure the cell and do the ...
3
votes
0answers
1k views

Generic wrapper for Alamofire Request's function jsonResponse wrapper

I am trying to wrap a responseJSON function of a Request class of Alamofire because when I send an API request I get a response ...
3
votes
0answers
148 views

Adding swipe support to multiple classes

I have implemented swipe functionality using UIPanGestureRecognizer in a project. What I have done is added PanGesture to ...
1
vote
0answers
57 views

Block breaking with paddle/ball iOS Game

I created an iOS app that recreates the "ball breaking" game where a paddle is used to deflect the ball to break blocks. The main purpose is to get familiar with UI concepts since I have primarily ...
3
votes
1answer
102 views

Categorized Photo Albums

I was told the function "hompage" was too clunky to conveniently make a tableview. The cells will have the information in "PHOTO ALBUM ICONS" and "BUTTON ON TOP OF PHOTO ALBUM ICONS". ...
1
vote
1answer
39 views

Settings the height of rows for multiple screens within a TableViewController

Is there a better way to write this? This is a class that displays a preferences menu. We do this when the user first installs the app during a walk-through where we only show them some of the ...
2
votes
0answers
984 views

Implementation of a like button in iOS for Instagram like app in Swift

I have just completed an implementation a like button for an Instagram-like app, but now that I am looking at it I feel that there is something off. Maybe it is my formatting or maybe I am not quite ...
4
votes
1answer
2k views

Check for iOS version

Here's an approach i came up with for checking IOS versions. ...
1
vote
1answer
79 views

Hard-coded iOS keyboard [closed]

I am starting to write code for a keyboard in iOS. It's pretty much hard-coded and I need suggestions on how I can make it more professional style and more efficient. ...
1
vote
1answer
1k views

Using a webservice with blocks and returning data via callback

I load some data from from my webservice via a method using blocks and callbacks. From my ViewController I make a request to the data loading class and pass the ...
3
votes
1answer
356 views

Creating an area graph in iOS

I am trying to create an area graph from the upper and lower limit values. First I created two line graph from those points as: Sample data points are: ...
0
votes
1answer
3k views

Calling a method only once in an updateScore function in SpriteKit

This works fine, but obviously it's messy and I'm thinking there has to be a better way to do this. Having to constantly remember to flip the bool back is a pain, is there anything else I can do here? ...
1
vote
0answers
2k views

A custom UIView with gradient fill, border, and variable corner radii

Here is a swift port of UIView subclass that I use often in my apps. It allows me to easily set gradients in place of the backgroundColor property, and also makes it very easy to create views that ...
1
vote
0answers
691 views

Spawning nodes with random time interval in SpriteKit

I want to spawn objects with random time interval (from 1 to 3 seconds). I've wrote this function: ...
2
votes
0answers
52 views

Adding or editing a child

I have a class which will add or edit a child. So whenever I click on "save," I need to check the child image. If it's an image, then I need to upload to the image server. Once that's done only, I ...
7
votes
2answers
7k views

Core location background update and upload to server

I want to upload a user's location to a server to send them a location-sensitive alert, so the location needs to be fairly accurate: ...
2
votes
0answers
2k views

Expandable tableView cells

What I wanted to achieve is tableView with clickable cells, anytime somebody click a certain cell, another cell with picker, UITextField etc appears below, it's like a dropdown menu. When browsing ...
1
vote
1answer
32 views

Export class instances to a string (for sharing, backup) and importing them

I have a class (Patient) with many instances.. I need a way to share the instances with other users, so I thought of converting the instance into a string and sharing it, then reconverting it into an ...
3
votes
0answers
112 views

Sesame Street project

I started a tutorial online to get a little bit more knowledge about views. But after I did the basic I decided to finish the game. The game is a little "I spy" game where the user tries to guess the ...

1 2
3
4 5
8