Understand Flutter and native iOS communication.
This iOS project is the home page that will be integrated with the Flutter module. This project contains a text label to show note preview and a button that can be clicked to show Flutter page. The note is saved locally using UserDefaults for simplicity.
- Setup CocoaPods in iOS project.
- Using FlutterEngine, FlutterViewController, FlutterMethodChannel, FlutterLifeCycle to communicate with Flutter module.
- AppDelegate.swift
- SceneDelegate.swift
- ViewController.swift: configure the UI.
- /Flutter
- FlutterNoteManager.swift: singleton bridge between native iOS and Flutter that handles communication using MethodChannel.
- /Notes
- Note.swift: the note model.
- NoteReceiverDelegate.swift: a delegate protocol that will be called when user click a button to send a note to native.
- NoteUserDefaults.swift: handle save and load functionality to UserDefaults.
- /Util
- Constants.swift