Get Updates By E-mail 

Swift

Swift programming language libraries, components, tutorials and news.

FaceCropper – A Library That Crops Out All Faces From A Given Image Using The iOS 11 Vision API

  •  
  •  
  •  
  •  
  •  

FaceCropper is an open source library that utilizes the new iOS 11 Vision API to automatically find images within a photo from Taejun Kim
.

FaceCropper will automatically create new images containing each face found within a given image.

This snippet shows basic usage of FaceCropper:

let image = UIImage(named: "image_contains_faces")
image.face.crop { result in
  switch result {
  case .success(let faces):
    // When the <code>Vision</code> successfully find faces, and <code>FaceCropper</code> cropped it.
    // <code>faces</code> argument is a collection of cropped images.
  case .notFound:
    // When the image doesn't contain any face, <code>result</code> will be <code>.notFound</code>.
  case .failure(let error):
    // When the any error occured, <code>result</code> will be <code>failure</code>.
  }
}

This image from the readme shows an image with faces extracted:

FaceCropper

You can find FaceCropper on Github here.

A nice example of using the new vision API.


  •  
  •  
  •  
  •  
  •  

ARKit – An Augmented Reality Game Created With ARKit And SceneKit

  •  
  •  
  •  
  •  
  •  

ARTetris is a source code example from Exyte showing how to create an augmented reality Tetris game using SceneKit and iOS 11’s ARKit.

ARTetris neatly shows how to create an augmented reality SceneKit game.

This video demonstrates ARTetris in action:

You can find ARTetris on Github here.

A nice ARKit example.


  •  
  •  
  •  
  •  
  •  

HapticButton – Swift UI Component For Easily Creating Custom Buttons With Haptic Feedback

  •  
  •  
  •  
  •  
  •  

HapticButton is an open source button component that is triggered based on touch pressure with haptic feedback inspired by the iOS 10 and 11 control center.

With haptic button you can customize the color, and text of the button, and add an image if desired. You can set the level at which haptic feedback is triggered.

This animation from the readme shows a few buttons created with Haptic Button:

HapticButton

You can find HapticButton on Github here.

A nice easy to use component for creating buttons with haptic feedback.


  •  
  •  
  •  
  •  
  •  

Kuery – A Swift 4 Library For Better Core Data Queries Using Smart Keypaths

  •  
  •  
  •  
  •  
  •  

Kuery is an open source Swift library for Core Data from Kishikawa Katsumi that utilizes Swift 4’s Smart Keypaths.

With Kuery you have type safety, and code completion for your queries unlike when using NSPredicate directly.

These snippets from the readme show a couple of simple queries using NSPredicate:

NSPredicate(format: "name == %@", "Katsumi")
NSPredicate(format: "age > %@", 20)

These are the same queries with Kuery:

Query(Person.self).filter(\Person.name == "Katsumi")
Query(Person.self).filter(\Person.age > 20)

You can find Kuery on Github here.

A nice way to perform Core Data queries.


  •  
  •  
  •  
  •  
  •  

Umbrella – Swift Library That Simplifies Working With Several Popular Analytics Providers

  •  
  •  
  •  
  •  
  •  

Umbrella is an open source Swift library providing an abstraction layer that simplifies working with several different Analytics platforms from Jeon Suyeol.

Umbrella provides support For Firebase, Flurry, Mixpanel, and Answers analytics. You can also create custom providers if required.

This code snippet shows how easy it is to register analytics providers and log an event:

let analytics = Analytics<myappevent>()
analytics.register(provider: FirebaseProvider())
analytics.register(provider: FlurryProvider())
analytics.register(provider: MyCustomProvider())
analytics.log(.purchase(currency: "USD", price: 9.99, transactionID: "20170709123456"))

You can find Umbrella on Github here.

A nice straightforward library for working with analytics.


  •  
  •  
  •  
  •  
  •