Dabbling Badger
Exploring machine learning, software engineering, medicine, art, and science.
Today I would like to talk briefly about Swift’s current ecosystem, some of the libraries and areas of support that I think are missing, and what Swift needs to become a contender as ‘the one language to rule them all’.
In SwiftUI TextField
is the goto View
for capturing freeform input from your users. It works great out-of-the-box for capturing strings, but as with any stock API there are limitations and behavior that may catch you off-guard, especially if you try to work with optionals and other data types. This article will provide some observations, tips, and tricks I have learned to help you work effectively with TextField
.
Navigation stacks are a fundamental user interface component in iOS. We use them everyday as we tap in and out of messages in Mail, search our contacts to make a phone call, and adjust the settings on our phones. Being so crucial to the user experience, I was a bit surprised to find a navigation related bug in SwiftUI. Navigation titles from dismissed views were piling up at the top of the navigation bar in an overlapping mess. What the heck?! Here, we will go over sample code that both recreates this behavior and demonstrates current fixes.
One of the most frustrating aspects of working with SwiftUI is trying to debug unexpected behavior. I recently ran into a noodle-scratcher while adding search and interactivity features to views inside of a List
. Here, I will briefly show you a few unexpected behaviors you might run into when working with navigable List
views and show you the quick and dirty fix!
SwiftUI, Apple’s declarative framework for rapid user interface development, is an awesome alternative to UIKit, but still missing some key features. Here, I will discuss a few of the common issues surrounding keyboard dismissal and provide two solutions and workarounds that I have found after an embarrassing amount of googling and combing of StackOverflow.
Distance matrices are a really useful data structure that store pairwise information about how observations from a dataset relate to one another. In machine learning they are used for tasks like hierarchical clustering of phylogenic trees (looking at genetic ancestry) and in natural language processing (NLP) models for exploring the relationships between words (with word embeddings like Word2Vec, GloVe, fastText, etc.). Here, we will briefly go over how to implement a function in python that can be used to efficiently compute the pairwise distances for a set or sets of vectors.