Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free

"swift" posts

  • By Barney Waiganjo
    Working with iOS View Animations and Transitions in Swift VKwo826Z04oZh4JHc0AmU15CYraDoF4fQLdSAMMqc6QK9n9vH_ds0Ijh2YFLvw1mpbjB9T7ch7Fy3nOmZhGtDA5nWqtFhG90oSMGl8cvQNyLu1jc2dwcz-_C8MNNgw_m7fprloJX

    If you use an Apple device, you’ve probably seen a bunch of animations from third-party apps or Apple’s stock apps. If you ever wished you knew how to do that, but thought it looked too complicated, your wish is about to come true. Follow along with me and you’ll discover that creating animations in iOS is not only uncomplicated, but also fun.

    Animations grab a user’s attention and allow them to focus on what’s important on the screen. Animations also highlight changes on the screen and can help a user learn to navigate your app. But who are we kidding, everyone loves animations. They’re just so cool.  

    Tools You’ll Need

    To follow along with this tutorial, assuming you are an iOS developer looking to explore the world of animations, you will need a couple of prerequisites:

    • A Mac running the latest point release of macOS X Sierra or later.
    • Xcode …
    Read More
  • By Kelley Robinson
    How to Test Your iOS Application on a Real Device Screen Shot 2018-07-31 at 4.25.07 PM

    There are some features of iOS apps that don’t work from the iOS simulator. Maybe you want to test how your application works with the device camera or send an SMS message from your application. For these examples and more you’ll need to test and debug your app using a real device.

    This post will walk through how to run the Xcode simulator on your iPhone or other iOS device and show you how to fix some common errors you’ll see along the way.

    How to select your iPhone as the “Simulator” Device

    Simulator is in quotes here since this will create an actual app on your phone; it’s no longer a simulation. Open up a project in Xcode and click on the device near the Run ▶ button at the top left of your Xcode screen.

    Plug your iPhone into your computer. You can select your device from the …

    Read More
  • By Sam Agnew
    Sending text messages from your iOS app in Swift using MFMessageComposeViewController Screen Shot 2018-07-17 at 6.45.06 PM

    Do you ever want to send text messages in your iOS app from your user’s phone number? While you can’t do this directly without your user’s consent, you can display a pre-composed message for your user to send using MFMessageComposeViewController.

    If you want to programmatically send an SMS from a different phone number, you can do this with Swift using Twilio.

    That’s cool. Let’s send a message!

    If you already have an app and want to get straight to the point, here’s the code you need to display the message composition interface:

    let composeVC = MFMessageComposeViewController()
    composeVC.messageComposeDelegate = self
    
    // Configure the fields of the interface.
    composeVC.recipients = ["13142026521"]
    composeVC.body = "I love Swift!"
    
    // Present the view controller modally.
    if MFMessageComposeViewController.canSendText() {
        self.present(composeVC, animated: true, completion: nil …
    Read More
  • By Kelley Robinson
    How to do Phone Verification in iOS Apps with Twilio Verify and Swift iOS phone verification message

    Security is at the top of everyone’s mind and phone verification is a simple way to secure your application and help prevent bot accounts. Phone verification is a common security tool used when people sign up for a product or give you their phone number for the first time.

    Confidence in your users’ phone numbers decreases fraud and increases reliability of notifications. Let’s take a look at how to verify phone numbers from an iOS application using Swift and the Twilio Verify API.

    mulaney i smell a robot

    This tutorial will walk you through the process of SMS phone verification step by step. You can check out the final project on my GitHub.

    What you’ll need

    To code along with this post, you’ll need:

    Setting up

    Navigate to the …

    Read More
  • By Kayeli Dennis
    Building Reusable iOS Components in Swift ei1MoM9cqEUQoseUZ1fpzblpTtpjK57YFUArLmVFPgOis3ZmqCYMqpubojrk5DTPo8DwWsIXc-xV9Hn5-mJga7eQhlhdoQ9q1kVmoAB-FaQXnYrbHdfPvXrucIzeVR0OvGNQF8TI

    Keeping it DRY (Don’t Repeat Yourself) is every software developer’s priority in seeing a product through to completion. It not only helps make debugging easier, but also provisions easy testing and writing less code whilst achieving more. More than once, I’ve found myself building reusable components to reduce the repetitiveness in my code. For instance, building an iOS application will involve building multiple table view controllers. This means one will end up writing the same pieces of code in a couple of places that feed the table view controllers with data. Why not just build a wrapper and reuse it throughout the app as a plugin?

    Hopefully by the end of this article I’ll convince you to start building reusable components in Swift for iOS application development. To demonstrate reusable components, we’ll build a dummy app that simulates a company providing employees with meals and then soliciting a feedback form …

    Read More
  • By Sam Agnew
    Handling Incoming Phone Calls with Server Side Swift, Vapor and Twilio Screen Shot 2018-06-01 at 11.37.46 AM

    You’re building a Vapor app and want to be able to handle phone calls? Let’s walk through how to add Twilio Programmable Voice to the barebones Vapor “Hello World” app.

    Swift Package Manager

    For this project we’re going to use Swift Package Manager to set everything up and install dependencies. Make sure you have Swift 4.0 or greater installed before moving on. You can check your Swift version by running the following in your terminal:

    swift --version
    

    Vapor has a convenient command line tool which can be used to generate templates for projects. Installing this will also take care of other necessary dependencies.

    You can install it using Homebrew with the following command:

    brew tap vapor/homebrew-tap
    brew install vapor
    

    Now initiate a new Swift project with the following terminal command in the directory where you want your code to live:

    swift package init --type …
    Read More
  • By Angela Mugo
    Migrating Swift iOS Apps from MVC to MVVM w0ApU8yEXOQiOaKjv-wYaUGfcWOCtUzTWv8_EmGR5LX5wptM0eQ6DEBeQr0kEgX4cQHaGvxnQV3sHDC_sbvXSNUIl-WByh80uAx_srp92AX2XMSWwRAPAhCVN9nFvi2PN5jJ3rEr

    Design patterns are reusable solutions to common problems in code. MVVM (Model-View-Viewmodel) and MVC (Model-View-Controller) are both design patterns. While MVC is a very common and easy-to-implement design pattern, it has been faulted as very inefficient while working with large code bases. If you’ve built a product, you’ve probably built using MVC. Other common design patterns include MVP (Model-view-presenter) and VIPER (here is a little write up that describes them). In this post, we’ll be concentrating on MVVM and MVC.

    Why use design patterns? We use them because design patterns are typically easier to reuse and debug than an unproven design. Say you solve a problem without any particular design, and at the moment, it works. However, in the future you get a bug. When you go back to debug, it may be hard to figure out where some things are and why you even did them in the …

    Read More
  • By Sam Agnew
    Receiving and Responding to Text Messages with Server Side Swift, Vapor and Twilio Screen Shot 2018-05-29 at 7.05.00 PM

    You’re building a Vapor app and want to be able to respond to SMS messages? Let’s walk through how to add Twilio SMS to the barebones Vapor “Hello World” app.

    Swift Package Manager

    For this project we’re going to use Swift Package Manager to set everything up and install dependencies. Make sure you have Swift 4.0 or greater installed before moving on. You can check your Swift version by running the following in your terminal:

    swift --version
    

    Vapor has a convenient command line tool which can be used to generate templates for projects. Installing this will also take care of other necessary dependencies.

    You can install it using Homebrew with the following command:

    brew tap vapor/homebrew-tap
    brew install vapor
    

    Now initiate a new Swift project with the following terminal command in the directory where you want your code to live:

    swift package init --type …
    Read More
  • By Sam Agnew
    How to receive a POST request with server side Swift using Vapor Screen Shot 2018-05-21 at 9.41.09 PM

    After displaying text on a web page, receiving a POST request is the “Hello, World” v2 of building a web app. Let’s walk through how to do that using the popular server side Swift web framework, Vapor.

    Swift Package Manager

    For this project we’re going to use Swift Package Manager to set everything up and install dependencies. Make sure you have Swift 4.0 or greater installed before moving on. You can check your Swift version by running the following in your terminal:

    swift --version
    

    Vapor has a convenient command line tool which can be used to generate templates for projects. We won’t be using that functionality in this post, as our needs are more simple, but installing this will also install other necessary dependencies.

    You can install it using Homebrew with the following command:

    brew tap vapor/homebrew-tap
    brew install vapor
    

    Now initiate a new …

    Read More
  • By Rose Maina
    Working with Xcode Auto Layout in Swift and iOS Projects Auto Layout in Xcode

    Have you ever had trouble designing an application to look good in both landscape and portrait orientation? Do not despair! Auto Layout is here to the rescue.

    Originally Apple had only one screen size, which was developer friendly since they did not have to be terribly flexible fitting into different screen sizes. Fast forward to today, it has become quite frustrating to design an app that supports different screen sizes. To make this transition easier, Apple introduced Auto Layout. It’s a relatively new concept and may be confusing to use for the very first time, but all it does is simply make your app look good across all devices. It has therefore become imperative to master this concept and we shall be going through the knowledge required to flex.

    By the end of this tutorial, we will have learned:

    • Why Auto layout is important
    • Different sections on Xcode
    • How to …
    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.