Flint Demo for iOS
This is a sample project that uses Flint framework for Feature Driven Design.
This Master/Detail app provides simple "notes" gathering features with photo attachments. It demonstrates the use of Flint to:
- Define the Feature and Actions of an app
- Support conditional features (feature flagging, requiring purchase, platform versions etc.)
- Disabling features for which required system permissions are not authorized (e.g. Photos)
- Use Flint's Routes feature to implement custom URL schemes and deep linking
- Use Flint's Activities to automatically support Handoff, Spotlight search etc.
- Automatic analytics tracking
- Contextual logging
- Flint's "FlintUI" debug tools for browsing the feature hierarchy, Timeline, Focus logs and Action Stacks
How to build and run
Currently only Carthage is supported, so you'll need that installed.
- Check out the project
carthage bootstrap --platform iOS --cache-builds
- Build and run the project in Xcode 9.2 or higher
Using the app
The app lets you create "documents" that have a name and some body text and an optional photo attachment. You can edit them, remove them and share them.
Using the "Debug" option you can drill down into the Flint debug UIs to experiment with Flint and the insights it can give you.
To browse the Features and Actions in the app
- Go to the
Debugoption on the main screen
- Choose "Browse Features and Actions"
Here you can the hierarchy of Features and their actions, the types they expect, their analytics IDs and so on.
To view the Flint Timeline
- Add and edit some documents. Swipe to delete some.
- Now go to the
Debugoption on the main screen
- Choose "Timeline"
Here you can see a Twitter-style feed of the actions you performed. You can tap for more details of what happened.
To test URLs (Routes)
- Create some documents with simple names like "test1", "test2", "test3" and so on and edit the text in some of them
- Switch away and launch Safari
- Enter a URL into the address bar like
fdemo://open?name=test2where you replace the
test2part with the document you want to view, and press return/Go
Each time you do this, Flint should open each document you requested with the URL.
You should also find success with the custom "legacy" URL scheme that similates an app that used to have a different scheme, using
x-fd://open?name=test2 and so on.
To test Handoff
NOTE: The demo app does not support data sync (if anybody knows how we can make a sample app that works with sync without requiring any developer portal shenanigans to build and run, please let us know!).
So Handoff support is "faked" at the moment in that the demo app will send the name of the file to the receiving device as part of the Handoff data, and if the receiving device has a document of the same name it will open it – but the content will differ and the photo attachment will not be sent across either.
You will need to build the app for two devices. You cannot test Handoff with the simulator.
- Build and run the app on two iOS devices that use the same iCloud account
- Create a series of documents on one device, giving them useful text in the content so you can see which is which
- Tap one of the documents to open it on the first device.
- On the second device, make sure the app is not already running and go to the task switcher, dock or lock screen and look for the Handoff icon from "FlintDemo"
- Tap on the icon / perform the required gesture and the app should open.
To test Spotlight
It's a bit of a hack but as a proof of concept, FlintDemo will register any document you open with Spotlight as part of the Handoff registration also.
To test it:
- Create a series of documents on one device, giving them useful text in the content so you can see which is which, using some unique words
- Go to the home screen, pull down for search, and type in some of those "unique words" or "Flint demo" to see the documents
- Tap a document to open the app on that document