iOS quickstart

To get started with TensorFlow Lite on iOS, we recommend exploring the following example:

iOS image classification example

For an explanation of the source code, you should also read TensorFlow Lite iOS image classification.

This example app uses image classification to continuously classify whatever it sees from the device's rear-facing camera, displaying the top most probable classifications. It allows the user to choose between a floating point or quantized model and select the number of threads to perform inference on.

Add TensorFlow Lite to your Swift or Objective-C project

TensorFlow Lite offers native iOS libraries written in Swift and Objective-C. To get started quickly writing your own iOS code, we recommend using our Swift image classification example as a starting point.

The sections below walk you through the steps for adding TensorFlow Lite Swift or Objective-C to your project:

CocoaPods developers

In your Podfile, add the TensorFlow Lite pod. Then, run pod install:


pod 'TensorFlowLiteSwift'


pod 'TensorFlowLiteObjC'

Bazel developers

In your BUILD file, add the TensorFlowLite dependency.


  deps = [


  deps = [

Importing the library

For Swift files, import the TensorFlow Lite module:

import TensorFlowLite

For Objective-C files, import the umbrella header:

#import "TFLTensorFlowLite.h"

Or, the TensorFlow Lite module:

@import TFLTensorFlowLite;