MobileMakers Week 4 Day 1

Welcome back to another day at MobileMakers. Today was the first day of week 4. Following up on the weekend challenge, I was able to finish all the required steps except for displaying the pins in the map. This is due primarily because i’m getting “0” for both latitude and longitude so my pin appears some place near Africa. I’m going to have to spend some time on it during the week and make it work.

I also have to dedicate some time to review all of last weeks videos and get some clarification on certain things. My main issue is still wrapping my head around custom delegation. I get the idea of it but knowing where to implement it is what gets me.

Morning Hackwhich

This morning was super light. We got a super brief keynote on data modeling and we refactored one of last week’s hackwhich to MVC.

We learned what data modeling is and how it can help us to constructevely discuss and decide on what set of class methods your data model will be made out of. We also learned how data modeling helps us to identify relationships between these objects, write code to reflect the decisions previously made, make decisions based on the Model-View-Controller design pattern and write business logic into the model object in which it pertains.

Data Modeling

Well all that is fine and dandy, but what is Data Modeling? Data modeling is the process of defining classes of objects in order to represent the data our application needs. So.. in English, a data model are the nouns fo the application and how they connect. For example, imagine for a second we own a stock trading application. The data model (nouns) will be the stock, the company and the portfolio.

Model View Controller (MVC)

This MVC is widely discussed in the world of iOS, in fact, iOS was built on MVC. What is MVC you ask? Well MVC is a design pattern. A design pattern which happens to be the recommended design pattern for iOS Applications.

This design pattern clearly defined the roles of objects and how the communicate. The Model-View-Controller pattern emphasizes that all “Business Logic” for a model object should reside in that model object’s class.

Business Logic

Simply put, business logic is any logic that enables CRUD.

Create
Read
Update
Delete

SuperyheroPedia2

For this morning class, we simply created a model object by subclassing NSObject. Our model had three properties, one class method, one instance method and one instacetype initializer.

Our class and instance methods had a completion handler and we refactored our reused code from our main view controller and moved it to our model.

Here is the link in GitHub

Challenge

Well, like I said, today was super light. For the afternoon challenge, we needed to refactor a base project that you we were given and implement either class or instance methods in our model objects. The decision of wether to make it a class or instance method that was done by the instructions.

So for that same reason, there will be no code displayed today and rather I would only share the link in GitHub.

Here is the link in Github.

--

--

--

iOS Dev, Tech junkie, Dad & Husband.

Love podcasts or audiobooks? Learn on the go with our new app.

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
Gabe Morales

Gabe Morales

iOS Dev, Tech junkie, Dad & Husband.

More from Medium

My iOS Wishlist

Conceptual logo for the latest Apple iPhone operating system, iOS 16

4 Things I Hate About iOS

Getting Started: Xcode & Your First iPhone App

Apple In-App Purchase Experimental Tips