A list of method declarations. Classes conforming to a protocol must implement any required methods and may implement any optional methods.
0
votes
0answers
44 views
View controllers and delegation for a weightlifting app in Swift
I've got several UIViewControllers that are trying to do too much so I'm trying to learn how to clean them up so that they only have code that does UI things (...
-1
votes
2answers
70 views
Swift inheritance versus composition
Say I'm using Parse Server and utilising the PFObject class from the iOS SDK. Say I want to have a Chat class.
To use inheritance code (design 1):
...
2
votes
0answers
205 views
Binary protocol variability V3.0
Summary: Parsing an incoming stream of events from a binary communication protocol, if we have some variations in devices to support and would not like to have one huge switch to include everything.
...
4
votes
2answers
177 views
Binary protocol variability V2.0
Up-to-date Version of this question: Binary protocol variability V3.0
Summary of the problem: Parsing an incoming stream of events from a binary communication protocol, if we have some variations in ...
3
votes
3answers
345 views
Binary protocol variability
Please note: An updated solution is here
Let’s imagine that we designed more or less universal firmware for a microcontroller unit to be used across multiple types of devices. So we have something ...
1
vote
1answer
178 views
Simple Text Prediction
This is a simple implementation of text prediction using a list of keywords and UITextChecker.
This is working correctly, but I think I could have implemented ...
2
votes
1answer
69 views
Have I created the <mutableDeepCopying> protocol properly?
I’m working in Objective-C, SKSpriteKit and am trying to create a class which will work in both OS X and iOS for flexibility.
I have just created a new protocol for my programs: ...
3
votes
1answer
69 views
Managing a wish list from an API
I have a class that I use to manage a list to/from an API in Swift. Using a clean code approach, I'm wondering if, how, and why I should change it when I have a class that uses it for just one or two ...
14
votes
1answer
3k views
Let's play some Swift Poker
Before you can do any sort of card game, you must first write some code to define your deck of cards.
One thing I've noticed in looking at some of Apple's Swift interfaces is that they very much so ...