BROKEN exercise/simulation of application for editing dynamic objects

Overview

Inspector

This is an exercise, a simulation of a scenario. This application is a simplification.

Application works with lists of dynamic objects with dynamic properties. Application allows user to inspect a selection of dynamic objects and edit properties of the selected objects.

WARNING: This application is BROKEN, It does not work as intended. Serves as a starter for a discussion.

This is a sample for a question at Apple Developer Forums.

Problem Definition

MODEL

  • The Model consists of Dynamic Things.
  • Dynamic Things have dynamic properties
  • Properties are not known to the application developer (they can be created externally, by a user)

ENVIRONMENT

  • The environment contains multiple dynamic collections of Things, we call them Filters
  • The exact Filters are not known to the application developer

TOP LEVEL VIEW

  • User can list Dynamic Things from a Filter
  • There might be views of Dynamic Things that are described externally (not known to the app developer)

SELECTION AND INSPECTOR

  • User can select one or multiple Dynamic Things in the list
  • An Inspector displays properties of Things in the selection
  • If multiple Things are selected, inspector displays values from properties that have only one distinct value, otherwise displays an empty value
  • User can use Inspector to change some properteis of selected Things
  • User can change properties of one or more Things at once using Inspector

View Hierarchy


 Window
   |
   +-- Content View (*>)
         |
         +-- Navigation View
         |     |
         |     +-- [sidebar] List of Thing Filters
         |     |
         |     +-- ThingListView(<*) – list of things, selectable, multiple
         |
         +-- Inspector(<*) – of selection in the above
 
 
 (*>) Selection – state, source of truth
 (<*) Selection - binding to


          Navigation         Inspector
 |<----------------------->|<--------->|

 +----------+--------------+-----------+
 | Filter 1 |**Thing 1*****| Selected: |
 | Filter 2 |  Thing 2     |  1,3      |
 | ....     |**Thing 3*****|           |
 |          | ...          | Name: ___ |
 +----------+--------------+-----------+
                 ^
                 |
                 +------- this can be 2D canvas, can be anything to present
                          a collection of selectable objects.
 
 
 Note: The ThingListView might as well be some kind of Canvas, or any other view,
       it does not have to be just a list view.

Known Issues

Issue #1: Binding set called on no change

Offending code location: Inspector.swift -> class Inspector -> var body -> nameBinding -> set

  1. Pick a Filter (Thing collection)
  2. Select multiple (more than one) items
  3. One of (any):
    • Change selection to one item
    • Switch to another Filter

Result: All previously selected items will be changed.

Expected: No change happens.

What happened: set of a binding to a text filed is called on selection change.

File Description

  • InspectorApp.swift - regular SwiftUI app with an environment object. Nothing special here.
  • DynamicThing.swift - definition of core model objects.
  • Environment.swift - definition of the model
  • ContentView.swift - definition of an application content view – NavigationView with Inspector
  • ThingListView.swift - List of Things - target for the NavigationView. Uses multiple selection.
  • ThingView - view of a single thing in a list, simulating dynamic content/layout
  • Inspector.swift - View of an inspector for Dynamic Things. Simulates editing of a dynamic variable of one or multiuple Things

Authors

License

  • MIT
You might also like...
Cellular Automata for basic water simulation

Water Simulation TODOs Make dynamic color based on pressure Make half-filled textures Integrate phone velocity to change gravity Tweak parameters Clea

Cellular Automata for basic water simulation

Water Simulation TODOs Make dynamic color based on pressure Make half-filled textures Integrate phone velocity to change gravity Tweak parameters Clea

IOSAnimationSample-master - An iOS Animation playground to exercise different iOS Animations
IOSAnimationSample-master - An iOS Animation playground to exercise different iOS Animations

iOS Animation Sample This app is an iOS Animation playground to exercise differe

An exercise to use a map(google map) for navigation.

map-navigation An exercise to use a map(google map) for navigation. It have the features of navigating your for a destination, drawing your travel pat

A document-based SwiftUI application for viewing and editing EEG data, aimed at making software for viewing brain imaging data more accessible.
A document-based SwiftUI application for viewing and editing EEG data, aimed at making software for viewing brain imaging data more accessible.

Trace A document-based SwiftUI application for viewing and editing EEG data, aimed at making software for viewing brain imaging data more accessible.

RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing.
RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing.

RichEditorView RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing. Written in Swift 4 Supports iOS 8+ through Cocoapod

StarryStars is iOS GUI library for displaying and editing ratings
StarryStars is iOS GUI library for displaying and editing ratings

StarryStars StarryStars is iOS GUI library for displaying and editing ratings Features StarryStars' RatingView is both IBDesignable and IBInspectable

Mechanical editing support for Package.swift manifests

Mechanical editing support for Package.swift manifests. Implements Swift Evolution proposal SE-301

PixPic, a Photo Editing App
PixPic, a Photo Editing App

PixPic PixPic, a Photo Editing App Built by Our iOS Interns What's the best way to teach interns how to write an iOS app? Just let them do it! This ap

Phimp.me - Photo Image Editor and Sharing App. Phimp.me is a Photo App for iOS that aims to replace proprietary photo applications. It offers features such as taking photos, adding filters, editing images and uploading them to social networks. PixPic, a Photo Editing App
PixPic, a Photo Editing App

PixPic PixPic, a Photo Editing App Built by Our iOS Interns What's the best way to teach interns how to write an iOS app? Just let them do it! This ap

Robust CloudKit synchronization: offline editing, relationships, shared and public databases, field-level deltas, and more.
Robust CloudKit synchronization: offline editing, relationships, shared and public databases, field-level deltas, and more.

CloudCore CloudCore is a framework that manages syncing between iCloud (CloudKit) and Core Data written on native Swift. Features Leveraging NSPersist

High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.
High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.

High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.

StarryStars is iOS GUI library for displaying and editing ratings
StarryStars is iOS GUI library for displaying and editing ratings

StarryStars StarryStars is iOS GUI library for displaying and editing ratings Features StarryStars' RatingView is both IBDesignable and IBInspectable

Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

iOS camera engine with Vine-like tap to record, animatable filters, slow motion, segments editing
iOS camera engine with Vine-like tap to record, animatable filters, slow motion, segments editing

SCRecorder A Vine/Instagram like audio/video recorder and filter framework in Objective-C. In short, here is a short list of the cool things you can d

Custom iOS camera and photo picker with editing capabilities
Custom iOS camera and photo picker with editing capabilities

Overview Paparazzo is a component for picking and editing photos. Key Features 📷 Taking photos using camera 📱 Picking photos from user's photo libra

A simple sticker editing iOS app
A simple sticker editing iOS app

StickerMator StickerMator is a SwiftUI based iOS app that runs with iPhone and iPad. using this app you can add stickers to your photos, image manipul

Rich Markdown editing control for iOS
Rich Markdown editing control for iOS

MarkdownTextView Rich Markdown Editing for iOS MarkdownTextView is an iOS framework for adding rich Markdown editing capabilities. Support for Markdow

Owner
Stefan Urbanek
Software engineer and data warehouse practitioner. On sabbatical, toying around with complex systems modelling, simulations and DSLs.
Stefan Urbanek
UI Kit for the STREAMD anime app. Generic UI objects go here, nothing to do with anime

STREAMDUIKit UI Kit for the STREAMD anime app. Generic UI objects go here, nothi

STREAMD 1 Jan 14, 2022
LifetimeIsLongSample - Longer lifetime for objects created with NavigationLink

Longer lifetime for objects created with NavigationLink! Thanks to https://stack

monotone 0 Dec 31, 2021
Example repo of working with Core Data in a SwiftUI application

CoreData in SwiftUI This repository serves many purpose. But mostly so I can experiment with Core Data in SwiftUI, and also so I can use it show my ap

Donny Wals 4 Jan 30, 2022
A simple application for retrieving lunch menus of selected restaurants around FIT CTU

lunch_guy-ios (in progress) A simple application for retrieving lunch menus of selected restaurants using https://github.com/tomaskadlec/lunch_guy API

Tomas Sykora, jr. 12 Feb 10, 2022
Arctanyn 0 Dec 24, 2022
Ios-exercise - In this exercise applicant should implement a new feature into an existing sample app

Cooking app In this exercise applicant should implement a new feature into an ex

Kristīne 0 Feb 7, 2022
Colour blindness simulation and testing for iOS

Color Deficiency Snapshot Tests This package makes it easier for you to understand the implications of your app's design on users with various types o

James Sherlock 69 Sep 29, 2022
An augmented reality (AR) ghost hunting simulation for iPhone

ARanormal An augmented reality (AR) ghost hunting simulation for iPhone About ARanormal was the first game by Jesdo Software, released for iPhone in O

Jesse Douglas 1 Nov 2, 2021
US bank coding exercise challenge

USBankcodingexercise US bank coding exercise challenge This repo has two projects Project to demo MVVM design pattern problem statement - read data fr

null 0 Nov 25, 2021
This is a Swift implementation of a D2Q9 Lattice-Boltzmann fluid flow simulation.

DMCLatticeBoltzmann This is a Swift implementation of a D2Q9 Lattice-Boltzmann fluid flow simulation. This package defines three products. The DMCLatt

Mitch Chapman 1 Aug 15, 2022