-
Notifications
You must be signed in to change notification settings - Fork 2
1. Toy example applications
Jaehun You edited this page Mar 16, 2023
·
2 revisions
Several toy example applications are provided to demonstrate the basic features of swift
.
For convenience, you can download example databases: database.zip
- A combobox for selecting a database into which the generated number is saved
- A button for generating a new number
- A label for showing the current status (database updated, random number generated, etc.)
- A label for showing the recently generated number
-
generate() -> int
: Generate a random number and return it -
write() -> bool
: Save the given number into the database
- A read-only text field that prints out the log messages
Not required.
- A combobox for selecting a database into which the polled number is saved
- A spinbox for adjusting the polling period
- A label for showing the polled count (how many numbers have been polled): this will confidently show when the polling occurs
- A label for showing the recently polled number
-
poll() -> int
: Return a predictable number e.g.time.time() % 100
-
write() -> bool
: Save the given number into the database
- A list whose each row shows the database name, path, and a button to remove the row from the list
- A button to add a row (new database)
Not required.
- A combobox for selecting the database from which the value of 'A' is fetched
- A combobox for selecting the database from which the value of 'B' is fetched
- A label showing the sum of recently fetched 'A' and 'B'
- A button for calculating the sum
-
read() -> int
: Read the given database and return the fetched number