Description
The app allows to search compounds through ‘PubChem’ and helps to keep information on solutions made of those compounds.
- The app is written and tested on
Swift 4.1
andXcode 9.3
. - The app is available on App Store.
Installation
- Clone or download the repository: https://github.com/jaeseung16/SearchPubChem.git
- Open
SearchPubChem.xcodeproj
in Xcode - Build and run
How to Use
Compounds Tab
Search the open chemistry database ‘PubChem’ at the National Institutes of Health (NIH) for chemical compounds. The app helps to find a compound by name from the collection of more than 90 million compounds. It downloads and stores the molecular formula, weight, and structure.
Compounds
- Selecting the Compounds tab will present a table of compounds.
- If there are any solutions made of a compound, 💧 will appear next to the compound’s name.
- When a compound is selected, a view with the detailed information will appear. Follow the instruction in Details for a compound.
- When the + button is selected, a view for search will appear. Follow the instruction in Search for a compound.
Details for a compound
- Click <Compounds to return back to the table of compounds.
- Click the magnifier icon to open the PubChem page for the compound.
- Click the trashcan icon to delete the compound. This function may not be available if there is a solution made of the compound.
- Click one of the solutions made of the compound to display the information. See Details for a solution below.
Search for a compound
- Type a compound name into the text field, which is filled with ‘water’ by default.
- Click Search to begin searching the database. An activity indicator will appear until the search is finished.
- If the search succeeds, the downloaded information will appear.
- If the search fails, an alert will appear.
- Click Save to store the information about a compound.
- Click Cancel anytime to dismiss the scene.
Solutions Tab
Choose compounds downloaded from PubChem and make a solution. The app allows to record a list of compounds with amounts dissolved in a solution. For the saved solutions, the app displays their compositions in gram and mol.
Solutions
- Selecting the Solutions tab will present a table of solutions.
- When a solution is selected, a view with the detailed information will appear. Follow the instruction in Details for a solution.
- When the + button is selected, a view for search will appear. Follow the instruction in Making a solution.
Details for a solution
- Click <Solutions to return back to the table of compounds.
- Click the action icon to share a csv file containig the information about the solution.
- Click the trashcan icon to delete the solution.
- Choose between actual and % to display the actual or percent amounts of individual compounds.
- Choose the unit between
gram
andmol
.- When gram is selected, actual displays the amounts in the unit of gram or % does in the percentage of weights.
- When mol is selected, actual displays the amounts in the unit of mol or % does in the percentage of the number of molecules.
- Select one of compounds to display its structure and formula. See Mini details for a compound below.
Making a solution
- Enter a label for a new soltion.
- Click Add Compounds to bring a collection of compounds. See Compounds collection below.
- The names of the compounds selected from Compounds collection will be displayed in the table view.
- The unit for the amount can be chosen among gram, mg, mol, and mM.
- The amount may be entered.
- Click Save to create and add a new solution.
- Click Cancel anytime to dismiss the scene.
Compounds collection
- Select or deselect compounds by clicking the images of compounds.
- Selected compounds will be displayed.
- Click + to bring a view for searching a compound. See Search for a compound.
- Click Done to return back to Making a solution.
- Click Cancel anytime to dismiss the scene.
Mini details for a compound
- Click Done to return back to Details for a solution.
Version History
ver 2.1
- Fix the ‘magnifier’ icon for opening the PubChem page for the compound
- Enhance JSON parsing using Codable types
- Update the interface for iPad
ver 2.0 (11/9/2019)
- Supporting 3D conformers
- If a 3D conformer is available from PubChem, it will be downloaded. Check whether “Conformer” appears at the bottom of the image downloaded after a search is finished. Also, check whether “3D” appears at the upper right corner of the image of a molecule. The conformer scene supports the pan and pinch gestures!
- Supporting the dark mode