Hey! I have been learning how to program swift because I want to write iOS apps.
For the first, I considered start with recognize my previous concepts in this new language for me, here is my “fizzbuzz” example:
My guide to learn Swift and iOS are the follow videos and books:
- Swift Mastering The Core Concepts
- Building iOS 10 Applications with Swift
- iOS Programming The Big Nerd Ranch Guide 6Th Edition
My First App
First, I need to understand this:
- How to create a single view iOS app.
- How to use the story board.
- How to put a buttons and labels.
- How to connect the view and the controller.
- How to make an event (push a button)
With these learnings, I was be able to create a basic iOS app.
I created a simple view with many input text, labels and buttons. My first approach was make a println in console when pushed the button.
Finding a REST Library
I need find libraries for add to my iOS App, so I installed Cocoa Pods for this job.
I will use a library for make REST request, so I found Alamofire.
The init command produces a Podfile, where I add my dependency:
Sending a message to slack
Previously I wrote a post where I describe how to send messages to slack channel, you can read again here.
For send a post request with alamofire library, I need to write this:
This was my first iOS app, although I have a lot of errors, I’m so excited because I can do a simple post request.
Thanks for reading!