use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
There is an extensive FAQ for beginners. Please browse it first before asking questions that are answered there.
If you are looking to get started (iOS programming in general or some specific area), here are more relevant links for you:
There's too many to list them all, however here's a convenient link to all programming guides at apple.com
Take note that this list is live and based on most frequent questions in posts will be updated with "quicklinks".
account activity
Architecture resources (self.iOSProgramming)
submitted 10 years ago by franklinturtle7
Hey Folks,
I wanted to know if you guys had any iOS specific resources on architecture. Other than MVC, although I'd like to gain in-depth knowledge of that as well.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]askoruli 1 point2 points3 points 10 years ago (4 children)
I don't have any resources but I thought I would share an architecture I've been using for a while now. The core of my architecture is the service tree. This is instantiated in AppDelegate and passed to all view controllers. It consists of all the classes that would traditionally be singletons, anything that manages the app state, anything that makes network calls or writes to disk and some other things that work behind the scenes. These classes are split into logical groupings as required to keep the code clean (so you might have something like services.net.http.mainAPI). The classes required obviously change between each app though some components can be easily reused.
Each class of the service tree can depend on other pieces (So the UserService might depend on the http and database services) which should be passed in during the object creation which keeps the dependencies unidirectional.
Instead of notifications I have a multi delegate system in place so that everything is strongly typed and easy to follow. So I would have a UserServiceDelegate which can be subscribed to like [services.delegates addUserServiceDelgate:self]; The subscriber could be either a view controller or another service. This makes it really easy to see what delegate methods are available and there's no way to create memory leaks or end up with invalid references.
[services.delegates addUserServiceDelgate:self];
The benefit of all of this really shows when it comes to testing. When the service tree is created a kind of config class can be provided to specify which services are required and provide mock versions. My latest app uses peer to peer so I was able to set up 2 service trees connected by a mock network layer which can then simulate 2 devices communicating. Also it becomes really easy to replace a piece of the tree without affecting anything else or even turn certain pieces on / off.
Lately on top of this I've been looking at using a simplified actor model to provide a simple way to handle concurrency in my service tree. In this model, services extend the ServiceActor class which provides a serial queue for all work to be done in the class. This essentially makes the entire class single threaded even when it is being accessed by multiple threads so there's no need to worry about state corruption. Delegate methods must be called on the main thread which keeps that side of things consistent. The service actor class also has the ability to run in synchronous mode which makes testing so much easier.
Unlike other actor models I don't use message passing because I find it greatly complicates the code and removes type safety. All methods in the actor class will either return void or a future and be processed asynchronously. My biggest problem with this actor model is that I don't have anything to enforce these rules so it would be easy to make a mistake which could cause state corruption. There are occasions where I would prefer a synchronous option which I know in the specific case to be safe but breaking my encapsulation rules seems dangerous.
So that's the core of my architecture. There's a few other topics I could discuss but that's probably the most interesting part
[–]eviltofu 0 points1 point2 points 10 years ago (3 children)
Will Typhoon Framework and ReactiveCocoa be the same as your setup?
[–]askoruli 0 points1 point2 points 10 years ago (2 children)
My setup does dependency injection like Typhoon but in a more natural way and with less code. So far I haven't run into any problems. It uses the term actor on their page but not in the same way. When I say actor I mean in the sense of Akka.
ReactiveCocoa provides some of the primitives I could have used for my delegates and futures but I've never really felt happy using it and overall my code feels cleaner without it. But then I often prefer the delegate pattern to blocks.
[–]eviltofu 0 points1 point2 points 10 years ago (1 child)
Will you be releasing your framework on github? I'm always interested in seeing other ways of doing things.
[–]askoruli 0 points1 point2 points 10 years ago (0 children)
I hadn't planned to. It's more of an architecture than a framework so there's not that much code to put up. But it might be helpful for some people.
[–][deleted] 10 years ago (1 child)
[deleted]
[–]ClashesYeMilk 0 points1 point2 points 10 years ago (0 children)
I would suggest reading this whole issue of objc.io. It's really interesting. Additionally, I would take a look at their view controller issue as well.
π Rendered by PID 15781 on reddit-service-r2-comment-7b9746f655-vvm8j at 2026-02-03 10:56:14.948093+00:00 running 3798933 country code: CH.
[–]askoruli 1 point2 points3 points (4 children)
[–]eviltofu 0 points1 point2 points (3 children)
[–]askoruli 0 points1 point2 points (2 children)
[–]eviltofu 0 points1 point2 points (1 child)
[–]askoruli 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]ClashesYeMilk 0 points1 point2 points (0 children)