Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

A list of method declarations. Classes conforming to a protocol must implement any required methods and may implement any optional methods.

6
votes
0answers
28 views

Library for RCON clients

I wrote a library implementing the RCON protocol to automate interaction with Minecraft servers. I know that there are already a couple of implementations out there, but neither I found was convincing ...
3
votes
1answer
89 views

Adding dragging ability to a UIView using protocols

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
1answer
78 views

OO design for chat protocol

I'm writing a typical client-server architecture for a chat program. My goal is to make the protocol flexible so that I could add more functionality in the future. (Any good software should allow that)...
2
votes
1answer
72 views

Classes for representing teleconferencing numbers

I'm developing an app that joins tele-conference calls so we use conference numbers a lot. I've got this basic structure to encapsulate the information regarding a conference number. ...
0
votes
1answer
56 views

Efficiently structuring data with protocol oriented approach in Swift

I need to integrate some server API calling in which I'm likely to get response as: ...
1
vote
1answer
165 views

Webservice class with parser using generics

I'm currently building a small web stack in swift for use in my iOS apps. It consists of multiple components and I want to make it resource specific; To that end I have a ...
1
vote
1answer
92 views

Unit testing needs only optional methods of protocol in Swift

I have a protocol which has quite more methods, it looks like: ...
2
votes
1answer
33 views

Text based dispachment and processment

I implemented a text based protocol that is able to process any message that follows the following format ...
1
vote
1answer
140 views

Core-data object with relationships conforming protocol in swift

I have a situation where I have to use protocol to be conformed by NSManagedObject which has relationships with other entities. My protocol is like: ...
2
votes
1answer
75 views

Wrapping messages into common header, ANSI C

I have a protocol where I send lots of different messages using two or three different header types (let's call them "Type A" and "Type B" messages). To simplify unit testing, my idea was to do ...
10
votes
1answer
2k views

Network protocol using TCP, sending images through sockets

I would like to ask about your opinion about my code. The idea is simple: I designed my own protocol, where client asks the server about the image, and the server sends the image, following the below ...
1
vote
0answers
340 views

Mocking protocol with class/static functions in Swift

I am using one of the open-source Objective-C keychain wrappers to store data in iOS keychain. For test cases, I have created protocol as: ...
1
vote
2answers
89 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
322 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
227 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
194 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
417 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
461 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
103 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
88 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
4k 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 ...