Adam Smith discussed “Architecture 101” with regards to building iOS apps during this week’s meetup. We develop apps and we tend to leave all the code in the View Controller class. This is not a good practice. Adam shared that each of our classes should ideally have a single responsibility (and therefore should only do one thing).
The single responsibility principle is a computer programming principle that states that every module or class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility. Robert C. Martin expresses the principle as, “A class should have only one reason to change.” – Wikipedia
So how does the SRP relate to iOS programming? Well Adam shared a simple app that he built that downloaded Game of Thrones data and images from the apple website. He had created a Table View that all the devs know well: TableViewControllerDelegate.
Any usage of TableViewDelegates requires certain TableView methods in order to fulfill the contract of the TableViewDelegates protocol. Through the course of his presentation Adam refactored the TableViewController so that it only took care of the aspects of being a view controller. He completely extracted the functionality of networking and TableViewControllerDelegate out of the ViewController.
When Adam puts together a talk, I like how he leaves in common mistakes so we can watch him take them out as he explains what and why he is doing what he is doing in the code. And he’s really approachable with questions.
During this meetup we also had 3 new Hawaii iOS Developers attend. I met Leo, Jerome, and Jordan. After the meetup I showed some apps that I had written the week before we ARKit. Looking forward to the next meetup where I will be discussing ARKit further.
Still thinking about the comment Chae made when I was discussing the shortcomings of ARKit (namely that you have to map the room before ARKit works). Chae added that ARKit is an attempt by Apple to make this technology easy to use. The real value of ARKit will come when it is successfully combined with other technologies like Machine Learning and Computer Vision.
If you’re interested in attending the next meetup, please RSVP!
Over the past 3 days I participated in a Water Management Conference in Punalu’u. My job was to attend the conference and get feedback from participating Native Hawaiian Fishpond owners regarding what they need most in an app to monitor the tide, oxygen, and salinity of their fishponds.
Here are the findings with attributions regarding who said what:
Tide graph data needs to do in and out data.
Temperature reading is easy to get
Please add it to the app.
Uses Tide Graph tide app
Thinks about using other paid features
But has not made the jump.
Loading all that NOAA data in Pacioos makes the web app slow.
Told me about the Pacific Disaster Center (PDC) which is an international app for emergency managers
Wants to find student workers
Shared Career Fair in October
Grab the tide data.
Get the longitudinal data.
Then sell it as a conservation project.
Has experienced many problems using apps
One big gripe was that in using an app, photos needed to be taken inside the app and the app maker did not make adding photos from the photo library possible.
Had to take photo and assign GPS data to the photo
Had to upload GPS data by hand. Not ideal.
Check out the Liquid app (SeaGrant)
The app has to load and be FAST
Needs to look pretty and be easy to use.
MAKE THE APP SUPER READABLE
Need to have click-consistency in the app: Where you click should produce the same interaction every single time.
Differentiate between finger touch to comb over data and swipe to new graph with two fingers – differentiate based on how many fingers are used to do the gesture.
In order to do tide predictions we need at least 18.9 years of tide data. This is the scientific standard for data.
2 years of data is not enough to do predictions.
We have 10 years of NOAA data on the Kaneohe buoy
Anomalies in tide data readings might be due to turbulence in the water flow
Send the app user a notification if the sensor is giving readings that it is being tampered with so we can go and check on it to make sure it hasn’t been moved or stolen.
60 points of data “meaned” and we are still getting anomalous data.
Please smooth out the data.
Be sure to put the sensor at 30cm from the water.
Allow scientists using the app to show the reading in ft and m.
Wants to be able to compare his fishpond to other fishponds
What combination of salinity, oxygen, and tide flow worked best for other fishponds to grow limu, oysters, and fish?
We want easy access to the data.
Too many data points is not helpful.
Kehaulani (Mokauea Fishpond)
Want to be able to say that makaha1 is here at this GPS
Kids can make conclusions with their own eyes at the fishpond
Mokauea fishpond is an educational resource for kids age 8-12
We want them to get familiar with high/low tide dynamics
Currently using the app Tide Tracker
Tried out different ones
Likes Tide Tracker most
Needs to know when tide is lowest
This is best time to take kids out
Also best time to do work and pick limu
Also best time to build rock wall.
This requires the app to do tide predictions
Wants the kids to kilo – look with their eyes and learn
Need to be able to see the tide approaching
NOAA data cannot predict king tide for specific locations.
MOON PHASE IS HUGE
Mahina – Teach Hawaiian names for moon phases like the Hawaiian moon phase song
Visually showing the current moon phase is helpful in teaching moon phases to kids
Important to show sunset/sunrise times
Also important to show Moonrise/Moonset times
Make the app brighter.
Make the text size HUGE, hard to read for older people.
Show “minus tide” in clear clear clear visuals. Like show that part of the graph in a different color and make it stand out. This is the part that Kehaulani wants the most.
Minus tide is best time to go gather limu and move rocks.
Add step button feature to advance to next minute/hour/day
Maybe easier to use a single button with a fixed location
Having a sliding gauge might make it hard to get JUST THAT RIGHT LOCATION AND INFO
Landscape view is helpful
TOTALLY INTERESTED IN SEEING OTHER PEOPLE’S FISH POND DATA! THEN WE CAN SEE WHAT IS WORKING FOR THEM AND ADJUST OUR SALINITY, FLOWS, ETC TO MORE CLOSELY MATCH THEIR WORKING SETTINGS
Not all makahas have 2 gates
Get students stoked on science to get jobs to stay here on the island.
Feedback on the Loko I’a app
Scrolling readjusts the axis.
Forcing you to orient yourself every time you scroll to a different view.
Needs to port the app to Android
Interested in student workers to keep building out the Loko I’a app.
If all fishpond owners have the same question, then we can build in force to solve that one issue.
In order to determine if they all have the same needs, they need to be able to compare longitudinal data, real-time data, and predictive data.
Salinity allows us to predict other things.
Photosynthesis only happens during the day and stops at night.
Then there are also unsorted thoughts that I overheard and jotted down on a piece of paper during the conference:
“Whatever data we can get, it all comes down to cost.”
Make the data useful for us. The goal is to provide accurate fishpond data.
Doing oyesters in a shallow pond is tough. We need an accurate assessment.
Make a big calendar that shows the contributions from everyone.
There are 7 makaha at He’eia Fishpond: 4 salt water and 3 fresh water. It’s important to name each makaha. Makaha 2 is called “Hihimanu.”
“It’s good to name things to give them life.”
We need time to work with the low tide.
Tidal lag is affected by moon phase.
We need to know where the water came from.
We need a quantity of parameters to determine the models.
Goal is to have a map and be able to see the parameters you want to see for all ponds.
We need a map to show all the fishponds.
Goal is to make the fishpond productive and we need to quicken the pace to learn that.
Important to integrate the moonphase because some fish orient themselves to the moon phases.
Make the app as user-friendly as possible.
The goal of the conference is to get sensors into the hands of people.
YSI and Seabird are very expensive sensors.
“There’s not much time between the tides to move rocks.”
The app should share, “This is exactly what we need and this is how we do it.”
I still have a few lingering questions such as: “What is the best way to allow users to select the attributes for each site? Tableview? Buttons to new view controllers? Still thinking on this one.
All in all a fantastic opportunity to learn more about the history and ancient practices of combining fresh and salt water to create brackish water to cultivate aquaculture to entice fish to grow big and strong. Email me if you have any questions!
We’ve all been waiting to try it out. All I needed was a deadline to give me the push into installing Xcode 9 beta 4 and upgrading iOS on my iPhone from 10.3.3 to iOS 11. The gains are huge. Perhaps the best thing I’ve noticed on iOS 11 has been the screen recording feature. Amazing!
During this meetup we had a chance to cover ARKit. I’m floored. Absolutely floored by this technology. I set up the this session so that we could have witness the tech hands-on. In order to prepare for this session I watched the WWDC 2017 video on ARKit. Then I searched YouTube for a tutorial video from Jared Davison.
While I was searching for tutorials I was busy installing Xcode 9 and iOS 11 on my devices. Both of these pieces of software are needed to develop and play with Augmented Reality for the iPhone.
I really like how ARKit projects have a very interesting screen lag. Sounds strange but, this is starting to feel like the future.
Next week Adam Smith will be covering Architecture 101 at the meetup. Please RSVP if you’re interested in attending. Don’t forget, we’re meeting at the iLab on Thursdays at 6pm!
During this meetup I prepared a tutorial on setting up Firebase Realtime Databases. We hit a snag in the set up of the database when I put the configuration call in the wrong place in the App Delegate. Good thing the one of the developers had done the tutorial before. As a group we were able to debug the connection and get the tutorial to work as expected.
During the group debugging session Adam commented that he wished we could always have a group of developers programming together as we located the bug much faster. 10 eyes are better than 2!
If you’re interested in attending the next Hawaii iOS developer meetup, we’ll be covering ARKit to do augmented reality with the iPhone. Please RSVP if you’re interested in attending!
Focus Grouping at Water Conference in Punalu’u in August 7-9
Follow our progress on Github
But first, who am I?
My name is David Neely. I am the Technology and Web Coordinator at the Manoa Career Center. I am most proud of the Pocket Workshops we recently created to allow students to view career development workshops on their mobile devices wherever and whenever they want.
I believe in leveraging the ubiquity of mobile phones to provide every person with superpowers unique to their needs.
I am also the organizer of the Hawaii iOS Developer Meetup. We are a group of nearly 100 developers who meet every Thursday at the iLab here at UHM to discuss the evolving best practices of developing apps for the iPhone, iPad, Mac, and Apple Watch. Next week we’re going to discuss ARKit for the iPhone to do some Augmented Reality on the iPhone with iOS 11. If you’re interested in attending the meetup or have questions about iOS development, please come and see me after the talk.
Finding a need at Purple Mai’a’s Native Hawaiian Tech Conference
One of the developers at the Hawaii iOS Developer Meetup shared that she would be attending the Purple Mai’a Contest on March 25, 2017 and asked me if I’d be interested. The contest brought together Native Hawaiian Water Management caretakers and app makers.
I checked out their website and watched the video from the contest the year before. It looked awesome! So I signed up.
The contest provided an excellent opportunity to do service work at the Kanewai, the loi near the dorms, and learn more about the most pressing Native Hawaiian water issues. I learned from the many talks at the conference that “Water dictates the cultural practices of the land.”
They had a few white boards around the space for writing thoughts to share with other attendees. I wrote on the wall just before getting in line for lunch, “If the water could talk, what would it say?”
Discovering startlingly steep drops in the cost of water management sensors
Brian shared that he was working on a project that leverages the falling price of water sensors that presents a outstanding opportunity to democratize water sensor data. Here’s how he pitched it:
Expensive water sensors used to cost up to $20,000 to purchase
Now those sensors can be had for less than $100!
Brian’s team installed those sensors to monitor tides at He’eia Fish Pond in Kaneohe
They also have a web interface to show the real-time data on desktop computers
But there’s a problem
If you’re working at the He’eia Fish Pond, you’re not going to have access to a desktop computer. They needed an app to display real-time data to allow the caretakers of the findpond to know exactly how much water was flowing from each of the makahas.
Lucky me, I had an opportunity to join the team and I jumped at it.
We met a bunch of times to discuss the state of He’eia Fishpond and the cultural practices that are informed by the flow of both fresh and salt water into the pond.
But why does Hawaiian Fishpond tide data matter so much?
Hawaiian fishponds are unique and advanced forms of aquaculture found nowhere else in the world. The techniques of herding or trapping adult fish with rocks in shallow tidal areas is found elsewhere but the six styles of Hawaiian fishponds, especially large walled ponds, were technologically advanced and efficient as their purpose was to cultivate pua, baby fish, to maturity.
Fishponds provided Hawaiians with a regular supply of fish when ocean fishing was not possible or did not yield sufficient supply (Kelly, 1976).
The compact style of wall slows water flow, allows the pond to maintain a base water level even at the lowest tides, and forces more water to the mākāhā or sluice gates. He’eia Fishpond has six mākāhā – three along the seaward edge that regulate salt water input and three along He`eia stream that regulate fresh water input.
By allowing both fresh and salt water to enter the pond, the pond environment is brackish and therefore conducive to certain types of limu. By cultivating limu, much like a rancher grows grass, the caretaker could easily raise plant-eating fish and not have to feed them.
Leveraging Open Source Software (OSS) to build a rapid prototype
As I designed the app, I identified 3 pain points. In order to build the app I would need to query the datapoint with a network call, validate and parse the returned JSON, and display that data in an interactive chart.
Luckily I had some experience with open source software and managed to find 3 libraries that would make my job much easier. Here is a list of the OSS I used for this project:
SwiftyJSON is an open source library written in Swift for iOS that allows developers to validate and parse JSON with very clean and simple calls.
AlamoFire is an open source library written in Swift for iOS that allows for clean and simple asynchronous network requests. Errors and callbacks are easy to structure and respond to with this library.
SwiftCharts is an open source library written in Swift for iOS that gives developers deep control over how they present JSON data in a nice, very customizable, interactive graph.
By leveraging the open source software libraries SwiftyJSON, AlamoFire, and SwiftCharts, I was able to build the minimum viable product that queried the endpoint, validated and parsed the JSON, and displayed 24 hours of tide data in an interactive chart for the iPhone.
Here’s a gallery of screenshots that shows the progressive development of the app:
Focus Grouping at Water Conference in Punalu’u on August 7-9
On Aug 7-9 we will be conducting a makers conference in Punalu’u where fish pond owners for each of the neighbor islands will come to Oahu to learn how to build and maintain their very own inexpensive water sensors. They will each build their own sensor to take them back to their fish ponds.
Now that we have version 1.0 of the app, we can show them that they will be able to see their real-time data on their phone.
During the water workshop, I’m planning to ask the fishpond owners what features they want in the app and what matters most. I am a big believer in Eric Ries’s Lean Startup Methodology. I want the fishpond owners to validate the product before we build it out.