Spotlight Search Allows the User to Find Your App Records from the iPhone / iPad Native Search Bar

Spotlight Search Finding a Book in the 8Bookss App

Scenario

Our app will allow users to add, or remove, specific record fields to, or from, the native iPhone / iPad Spotlight search. In our example of the Books app, the Book Title will be our Spotlight search term. The user can choose to add the title to Spotlight in the New Book or Edit Book views, and, optionally, remove the title from Spotlight in the Edit Book view.


Floating Pop-up Pickers Allow Users to Select from a Pre-Defined List, and Pass the Selected Value Back to the Calling View Controller.

Book Source Animated Floating Pop-Up Picker

Scenario

Our app will allow users to launch a Pop-Up Picker, select from a list of values, then pass the selected value back to the original view. In our example, the New Book and Edit Book views contain 3 pop-up pickers: Genre, Source and Format. Genre covers the category of books (Thriller, Romance, etc.), Source covers the source or publisher (Amazon, Kobo, public library, etc.) and Format covers the medium (e-book, hardcover, etc.).

This article will focus on Source


Add an Animated, Floating Menu to Any View in Your App

Books Table View Showing the In-Place Sort Floating Menu

Scenario

Our app will allow users to sort the Books table view by utilising an animated, floating menu. The menu is triggered by tapping a ‘hamburger’ menu button, and offers 4 sort in-place criteria: By Title, Author, Series, and (User) Rating.


WKWebView Shows a Specified URL Website Page Content with a Loading Progress Bar Indicator.

Scenario

Our app will allow users to load and display content of a specific URL of a website page, abiding by Apple’s rules on unrestricted content.

Technique

Swift uses WebKit & WKWebView to load an external website page into your app. WKWebView has associated functions to ensure full implementation. You also need to utilise UIProgressView to monitor the website page load, so the user knows that the loading is actually happening (rather than a blank screen until website page fully loads).

However, to abide by Apple’s policies, the…


Query the App Public Database and Download or Report Users Shared Data

Scenario

Our app will allow users to upload their app records to Apple’s public iCloud database, so all app users can share their selected data (books, recipes, anecdotes, jokes, etc.). The users should be able to upload, query, and download from the public database, as well as report any objectionable posted material by other users (as per Apple’s User Generated Content policy).

Technique

We shall utilise Xcode CloudKit Dashboard interface to set up the app iCloud.com containers for Development and Production of the public database. Then create the Record Type (e.g., ‘Book’) that will include the data fields and the indexes, which…


Share Your Interesting Data Records with Users of the App at Apple’s Public Database

Scenario

Our app will allow users to upload their app records to Apple’s public iCloud database, so all app users can share their selected data (books, recipes, anecdotes, jokes, etc.). The users should be able to upload, query, and download from the public database, as well as report any objectionable posted material by other users (as per Apple’s User Generated Content policy).

Technique

We shall utilise Xcode CloudKit Dashboard interface to set up the app iCloud.com containers for Development and Production of the public database. Then create the…


Scenario

Our app contains book records in a Core Data database. We defined one of the Book attributes as Published Date. We wish to present a table view, sectioned by Publication Year, where each section contains the books published in that specific year.

Technique

We need to use the Swift DateFormatter() and the Calendar function of the Publication Date attribute to extract the Year component. Then we need to exclude any nil Publication Date values and sort the valid records by Publication Date. …


Make Your Code Snippets Shine on Medium

Scenario

You are writing a Medium article, and wish to include code snippets, of any language, within the article.

Audience

Medium writers, usually about programming, who wish to include their programming language code snippets inside their articles.

Techniques

Medium allows you to include code snippets, of any language, in your article with 2 different techniques:

One: Use Command+Alt/Option+6 (on Mac) to add a code snippet block (grey colour). You can then copy from your IDE (e.g., Xcode) and paste inside the block. The result of the action looks like this:

// Command+Alt/Option+6 generates this grey block, in which you can paste your code…

Save Camera Photos to Core Data, Photo Album, and iCloud.

The Scenario

New Book and Edit Book views offer the user the option to use the device camera, to capture photos, and add them to Core Data and, optionally, to the device Photo Album, and/or user’s iCloud database.

The Audience

The article is for Swift developers who seek complete, integrated, code-centric solutions to speed up their development projects. The code below can be added, with minimal customization, to any New or Edit view of your app.

Data Model

The article is based on the AppsGym Books model app, which is published on Apple’s App Store (as 8Books). You can review the app and also download the…

Mazen Kilani

I published 47 Swift iOS apps/games and 2 Flutter Android apps. I share complete Xcode projects, free (no ads), at AppsGym.com.

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