Hot answers tagged

29 votes
Accepted

Rest APIs - mobile specific challenges

The API being designed follows the Rest style of resources-centric URI and CRUD operations mapped to HTTP verbs. This is your problem right here. You have limited your resources to (I'm assuming) ...
user avatar
12 votes
Accepted

Unit test which asserts that current thread is the main thread

Let me show you my favorite unit test principles: A test is not a unit test if: It talks to the database It communicates across the network It touches the file system It can't run at ...
user avatar
10 votes

How to ensure multiple clients don't poll the server at the same time?

Essentially you would need to proxy that web service with one of your own that does rate limiting. The devices wouldn't know anything about each other, and you can cache/re-implement the service if ...
user avatar
  • 2,595
10 votes
Accepted

Who is responsible for setting color in MVVM?

The View is the place which has intimate knowledge of your graphical runtime environment, of how color is expressed in it, and even of the fact that you are actually running within a graphical runtime ...
user avatar
  • 31.4k
9 votes

Why are there no cross-platform mobile applications?

As the co-founder of Codename One which does pretty much that I can answer that pretty easily. You can cross compile (which is what we do) but you can't have a single binary that will work everywhere ...
user avatar
9 votes
Accepted

Unit Testing in VIPER Architecture: Possible?

Oh it's possible. It just doesn't look like what you want it to look like. What you're complaining about is the use of output ports1,2,3 to communicate results rather then returning results. Does ...
user avatar
7 votes

How narrow should my unit tests be?

The question you should actually be asking yourself is this: is my code testable? If you find yourself writing elaborate tests or using elaborate mocks in your tests, it is the fault of the code ...
user avatar
7 votes

JSON API or Plain JSON

I'm not interested in JSON, I'm interested in the objects that are created from JSON. Like in your example, turning plain JSON into objects is easy. How difficult is it for new developers? Mostly they ...
user avatar
  • 37.4k
6 votes

Usage of MVVM in iOS

I am only just approaching these questions myself but I will give the best answers I can and make some observations. We are told that iOS' MVC expects us to break our program up into models, views ...
user avatar
  • 2,918
6 votes

Massive View Controller - IOS - Solutions

We can use MVVM to resolve this issue. The Model-View-ViewModel, or MVVM pattern as it’s commonly known, is a UI design pattern. VM takes all logic about preparing model data for UI from VC. Example:...
user avatar
  • 167
6 votes
Accepted

Is Apple sample code the "correct" way to go?

Apple's sample code is just that, sample code. No guarantee that it works, that it is bug free, that it is the best way to achieve something. Use it to study some area that you don't know much about, ...
user avatar
  • 37.4k
6 votes

How do I create my own Objective-C to Swift converter?

This is a pretty big task. But then again, so are most things worth doing in programming. We start by breaking it down into smaller and smaller tasks until we get them down to the level of a problem ...
user avatar
6 votes
Accepted

In mobile games that work across android and iOS is game logic written twice?

Three words: cross-platform compatibility. If you write your game in HTML and Javascript, it will run on any platform where there is a web browser on the device (which is most devices nowadays). If ...
user avatar
6 votes
Accepted

The right place for "app logic" in MVVM context

In MVVM, the business logic is built into the Model. The ViewModel is there to bridge between the View and the Model, so it's logic only pertains to driving the display and updating the model from ...
user avatar
5 votes
Accepted

IOS app updates that don't require App Store submission

Apple now explicitly allows interpretted code like Javascript to be 'Hot Code Pushed' to a device without an update. 3.3.2 An Application may not download or install executable code. Interpreted ...
user avatar
  • 166
5 votes

IOS app updates that don't require App Store submission

From the iOS guidelines, any app which downloads code in any form is (or at least should be) automatically rejected for the App Store. Most likely is that your app is downloading something which would ...
user avatar
  • 161
5 votes

Security in an iOS game?

Short answer: No. It helps to have an appropriate mental model of the problem you're facing. Imagine that your app is a filing clerk (program binary) working in a rented office (the user's phone). He'...
user avatar
5 votes
Accepted

How do you write tests for methods that interact with data in system files?

You have to mock or emulate, and you have two very good reasons to do so. You have to mock or emulate whatever parts of the system your code interacts with, precisely because: You don't want to ...
user avatar
  • 31.4k
5 votes

Can I use GitHub as my mobile app's data store?

I'm reading the Term of Service of the site and i think that you can use GitHub to host your JSON file. But pay attention to this point: If your bandwidth usage significantly exceeds the average ...
user avatar
  • 421
5 votes
Accepted

What would cause a company to need to move their app on the iOS App Store to different "app"?

If one builds an app with 64-bit support using current versions of Xcode, it is no longer compatible with iOS devices running iOS 5.0 or earlier. Perhaps a developer wants to separately support ...
user avatar
  • 7,878
5 votes
Accepted

What should a rest api return for an empty guid?

An 'empty' guid is still a valid guid, so parsing it shouldn't require any extra logic. The question is why are you using it at all? It seems like a mistake to me to assign special meaning to a ...
user avatar
  • 64.1k
5 votes
Accepted

Why JS MVC frameworks prefer data binding to UI element reference?

The purpose of data binding is to decouple the view from the model. Neither the model nor the view should know about each other. Data binding is the glue that connects the model to the view and ...
user avatar
5 votes

Push notification from web application to my mobile app

There is no need to reinvent the wheel and there are plenty of solutions out there that makes pushing notifications to mobile devices easier. I personally would recommend Firebase Cloud Messaging by ...
user avatar
5 votes

What is a good approach for saving a Swift model that's a struct containing structs to Core Data?

You have some options: 1 - Convert them to class. So you can inherit from NSManagedObject and do the rest like the tutorials you usually find in internet. 2 - Make a rapper around any struct you ...
user avatar
5 votes
Accepted

Can you modify the front-end source code of a mobile app?

Yes of course. People like to think that because a lay person can't read the source code for compiled or even "transpiled" applications in the same way you can with javascript on a website that it's ...
user avatar
  • 64.1k
5 votes

Can you modify the front-end source code of a mobile app?

It's not just that people might be able to hack into your front-end app. They might be connecting directly to your server with an app that they wrote themselves. I can get around whatever security ...
user avatar
  • 37.4k
4 votes

Private apps for iOS and Android

You can develop and distribute private apps among selected clients. In iOS, ad-hoc distribution is there, but you'll need to hook up your mobile device to a Mac OSX. Ad-hoc distribution is possible ...
user avatar
  • 41
4 votes

Why does the Mailbox app need their own backend?

Your suspicion is about right. There really should be nothing that the client couldn't be able to take care on its own unless the server also offered to save information that otherwise could not be ...
user avatar
  • 22.3k
4 votes

Is there a technical reason why you can't develop iOS apps on a Linux computer?

I think it should said you can develop for iOS on other platforms, you just can't build final applications on them. It's been explained in the accepted answer why you can't build outside of OS X, ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible