Skip to content

A simple iOS list app built with SwiftUI, showcasing the implementation of CRUD operations.

Notifications You must be signed in to change notification settings

cyliong/list2-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

list2-ios

This is a simple iOS list app (to-do list, tasks, shopping list, recipes, and the like) built with SwiftUI, showcasing the implementation of CRUD operations with DAO pattern.

iOS 14 or higher is required to run the app. If there is a need to support earlier versions of iOS, refer to a similar project, list-ios.

Features

  • Display a list of items (List, ForEach)
  • Navigate to a page to add or edit items (NavigationLink, custom view with Form and TextField)
  • Swipe to delete items (onDelete(perform:))
  • Store items in database (DAO, SQLite)

Data Access Layer

The project implements a data access layer with the Data Access Object (DAO) pattern. It uses generics, inheritance and Singleton pattern to make the creation of data access objects, as well as performing CRUD operations easier.

The data access layer is built on top of the GRDB library. However, a version built on top of the FMDB library can be found on the fmdb branch.

Otherwise, if you are looking for an alternative database option other than SQLite, check out the integration of SwiftUI and Realm on the realm branch.

Widget

This project also implements a widget that can be added to the Home screen, with the following features:

  • Display a list of items from a database shared between the app and widget (SQLite database stored in an App Group container)
  • Tap the widget to launch the app
  • For medium and large widgets:
    • Tap the Add button to launch the app's New Item screen (Deep linking with a Link control, onOpenURL(perform:), NavigationLink(destination:isActive:))
    • Tap a list item to launch the app's Edit Item screen (Deep linking with Link controls, onOpenURL(perform:), NavigationLink(destination:tag:selection:))
  • Widget will be updated when list items are modified from the app (using WidgetCenter's reloadTimelines(ofKind:))

UI Testing

The project includes a sample implementation of UI test using the XCTest framework.

Dependencies

  • GRDB

Requirements

  • Xcode 13.3 or higher
  • iOS 14 or higher
  • Swift 5 or higher

About

A simple iOS list app built with SwiftUI, showcasing the implementation of CRUD operations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages