Tony Trejo

In this post I will be talking about the Api and Model used in the Home view and Market view of the Binance App.

Image for post
Image for post

Before I start cloning that App maybe you need to know what is an API.

What is an API?

It is common to find APIs provided by some Apps, fortunately for us Binance provides his own API documentation.

API Documentation

What is Binance?

Binance is one of the largest and most popular exchanges around the world. I would like to suggest you invest in bitcoin, but that is another topic. …

In this post I will be using Generics to refactor a common mistake creating a Network layer, don’t do this on your code.

Image for post
Image for post
Photo by @zgc1993

Before I start talking about the Network layer let's talk a little bit about generics.

So what does Apple say about generics?

Generic code enables you to write flexible, reusable functions and types that can work with any type, subject to requirements that you define. You can write code that avoids duplication and expresses its intent in a clear, abstracted manner.Generics in Network Request

My own definition of generics would be:

A generic it is just a template that can be used by any type and with that avoid repeated code. …

In this post I will be applying three REAL use cases for Closures, these closures are used everywhere in any application.

  • Asynchronous Callback (URLSession, DispatchQueue, DispatchGroup)
  • Synchronous Callback (Append String, Sort)
  • Property Callback (Network, Append String, Sort)
Image for post
Image for post
Photo by Nicolas Lobos @lobosnico

What is a Closure?

A simple definition can be a closure is a function without the keyword func.

With that being said let’s start with some usual cases.

  • Case No 1 “Closure used in an Asynchronous Callback”

In this post I will be talking about the implementation of the VSAccountManagerDelegate, this is the last part of the AppleSSO series, enjoy it.

Image for post
Image for post
Photo by Vasily Koloda @napr0tiv

What the documentation says?

That means that we are almost done with the AppleSSO implementation.

Let’s first update the UI, we need to include two TextViews and a new button.

Your UI would be something like I show you below.

In this post I will be talking about protocols in Swift and the things you should know about protocol applied to classes, structs and enums.

Image for post
Image for post

What is a protocol?

A protocol is something that defines a particular use case. The protocol can defines methods, properties and other necessary pieces used by whoever complies with that protocol.

Let’s create different types of protocols, without any property or method.

protocol SimpleProtocol { // 1
protocol ClassProtocol: class { // 2
protocol AnyObjectProtocol: AnyObject { // 3
protocol AnyProtocol: Any { // 4
protocol ObjectProtocol: NSObject { // 5
@objc protocol ObjcProtocol { // 6
  1. This is the default syntax of one protocol.
  2. This is a protocol that inheritance from class, so for that reason this protocol is limited only to classes (you can not use this protocol in structs or enums), another important thing to know if that class is deprecated in favor of AnyObject simply without a warning. …

In this post I’ll be talking about classes and structs also we will use playgrounds to show you those differences.

Image for post
Image for post

First you will to know how use playgrounds, If you want to know how to use Xcode Playgrounds the links below can help you with that.

What is a Swift Class?

In simple words a class is something written by a programmer and defines properties and actions. Those properties and actions will be used when you create an instance of this class, usually called object.

Let’s create a CrytoExchange class.

// MARK: CrytoExchange classclass CrytoExchange { // 1   // MARK: Properties  let name: String = "CryptoMex" //…

In this post I will be talking about how to install Xcode and previous version for develop iOS applications.

Image for post
Image for post

First of all you will need a Mac computer, I’ll recommend you check the Apple’s site and see what are the computers that you can buy.

The IDE (Integrated Development Environment)

So now that you have your computer you need to download the Xcode that is the IDE used by Apple to create his amazing Apps. …

In this post I will be talking about how to check the access status using the VideoSubscriberAccount framework.

Image for post
Image for post

One of the important things to do when you want to implement AppleSSO is import VideoSubscriberAccount in your project, that framework is already provided by Apple, so you just need to import that framework like this.

import VideoSubscriberAccount

That object coordinates your app’s authentication requests with a TV provider’s authentication service.

That framework provides a method to knows what is the current status of the VSAccountManager,

open func checkAccessStatus(options: [VSCheckAccessOption : Any] = [:], completionHandler: @escaping (VSAccountAccessStatus, Error?) …

In this post, I will be talking about why you should try to be an iOS Developer.

Image for post
Image for post

There are tons of opportunities to find a job as an iOS Developer. I know the current situation is very difficult for everybody.

I was thinking about how I can help others to learn something new so I will create an iOS Course based on the requirements that I found in some job offers.

First I want to show you that investing your time in learning iOS Development opens up many opportunities for you. …

In this post I will be talking about how to create a builder that conforms the sign in foundations for User-Password, Facebook, Google process.

Image for post
Image for post

What is a builder pattern?

The builder pattern is a design pattern (creational pattern) that allows us to create complex objects using sequence of actions.

With that being said let’s code an example.

The example

The goal of this example will be create a generic sign in instance that allows us to create different types of Sign in process, those are listed below:

  • UserSignIn
  • FacebookSignIn
  • GoogleSignIn

First we need to define a protocol that contains all the properties used in the builder. …


Tony Trejo

Experienced Software Engineer with 12+ years of experience.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store