MShttp://markstruzinski.com/
Recent content on MSHugo -- gohugo.ioen-usThu, 16 Aug 2018 23:04:13 -0400iOS Universal Links Tipshttp://markstruzinski.com/2018/08/ios-universal-links-tips/
Thu, 16 Aug 2018 23:04:13 -0400http://markstruzinski.com/2018/08/ios-universal-links-tips/<p>We have been expanding our use of universal links lately. While links are complicated and difficult to set up, once they are configured properly, making incremental updates to them is pretty trivial, and they are a great feature. We have implemented a few deep links so far. We also use the site association file to validate site ownership for password autofill. We will soon be using the site association file for implementing the Shared Web Credentials feature as well.</p>
<p>Here are a few lessons learned along the way:</p>
<ul>
<li>Always plan on testing against a domain hosted over SSL with an official signed certificate (self-signed will not work)</li>
<li>Typing a URL directly into Mobile Safari will not trigger the universal link. You&rsquo;ll need to get it into an external source and select it from there.</li>
</ul>
<p></p>Alfred Diffs With Kaleidoscopehttp://markstruzinski.com/2018/07/alfred-diffs-with-kaleidoscope/
Tue, 31 Jul 2018 18:21:18 -0400http://markstruzinski.com/2018/07/alfred-diffs-with-kaleidoscope/<p>I&rsquo;ve recently started trying to identify bottlenecks in my workflow and take a little bit of time to see if I can make things a little easier with automation. It&rsquo;s always a tradeoff between the time spent automating something and actually getting work done. In this case, I can say the balance tipped way over to the side of saving me a great amount of time.</p>
<p></p>Expanding on Generic Json Parsinghttp://markstruzinski.com/2018/04/expanding-on-generic-json-parsing/
Thu, 12 Apr 2018 18:21:18 -0400http://markstruzinski.com/2018/04/expanding-on-generic-json-parsing/<p>Expanded JSON Parsing with Generics</p>
<p>In the <a href="http://markstruzinski.com/post/generic-json-parsing">last post</a>, I went over a very simple way to use generics when parsing a small object that had a value type determined at runtime. Today, I&rsquo;d like to expand on that concept a bit and show how I implemented that concept into a parent struct that contained arrays of this object.</p>
<p></p>Generic JSON Parsinghttp://markstruzinski.com/2018/03/generic-json-parsing/
Mon, 26 Mar 2018 14:31:43 -0500http://markstruzinski.com/2018/03/generic-json-parsing/<p>I have been working a lot in model layers lately. One benefit of this has been converting our older JSON parsing code over to using Swift 4&rsquo;s enhanced JSON parsing capabilities. Using the <code>Codable</code> protocol has allowed me to delete hundreds of lines of boilerplate and streamline a lot of repetitive and error-prone code.</p>
<p>A lot of this work is pretty straightforward, where we are mapping properties to types, and sometimes including a <code>CodingKey</code> protocol object to ensure property names are mapped to JSON keys correctly. However, I ran across one interesting scenario and I wanted to share my solution to it.</p>
<p>I&rsquo;ll present a simple generic object and its associated json in this post, and then show how that expanded out to a pretty nice solution once that smaller object became part of the full service in a future post.</p>
<p></p>CocoaConf Boston 2014http://markstruzinski.com/2014/11/cocoaconf-boston-2014/
Sun, 16 Nov 2014 00:00:00 +0000http://markstruzinski.com/2014/11/cocoaconf-boston-2014/<p>I attended the Boston stop of the <a href="http://cocoaconf.com">CocoaConf</a> tour this year.
As always, it was a quality experience. I learned a ton, and I&rsquo;m still
processing all the valuable information that was crammed into my brain.
The Klein family puts together a great mix of technical content, community
interaction, and fun events.</p>
<p></p>Unit Testing Patterns for Asynchronous Networking Communicationshttp://markstruzinski.com/2013/10/unit-testing-patterns-for-asynchronous-networking-communications/
Thu, 10 Oct 2013 00:00:00 +0000http://markstruzinski.com/2013/10/unit-testing-patterns-for-asynchronous-networking-communications/<p>A common issue I always run into is how to test asynchronous methods,
especially networking calls. I used test the result of the calls, such as the
parsing of return data, because testing the entire method proved impossible.
I recently read an <a href="http://www.objc.io/issue-2/async-testing.html">article</a> from the excellent <a href="http://www.objc.io/">objc.io</a>
publication on asynchronous testing. By combining the patterns used in this
article with some refactoring, I finally have my networking code under unit
tests.</p>
<p>Here&rsquo;s what I did:</p>
<p></p>A Change in Directionhttp://markstruzinski.com/2013/05/a-change-in-direction/
Tue, 14 May 2013 00:00:00 +0000http://markstruzinski.com/2013/05/a-change-in-direction/<p>In hitting brick walls, taking road trips for work, and feeling guilty about
about posting in weeks, I have reconsidered the return on investment when fully
implementing logic tests.</p>
<p></p>Setting up iOS Logic Tests [Part 4]http://markstruzinski.com/2013/04/setting-up-ios-logic-tests-part-4/
Mon, 08 Apr 2013 00:00:00 +0000http://markstruzinski.com/2013/04/setting-up-ios-logic-tests-part-4/<p>This is part 4 in a <a href="http://markstruzinski.com/blog/2013/02/01/unit-testing-series/">multi-part series</a> on iOS unit testing and
integration testing. In the <a href="http://markstruzinski.com/blog/2013/02/19/setting-up-ios-logic-tests-part-3/">last post</a>, we discussed setting up
Core Data and the Magical Record library. This week, we’re going to set up our
logic testing bundle. Let’s get started.</p>
<p></p>Orientation Changes in iOS 6http://markstruzinski.com/2013/03/orientation-changes-in-ios-6/
Mon, 11 Mar 2013 00:00:00 +0000http://markstruzinski.com/2013/03/orientation-changes-in-ios-6/<p>In a current project, I had the need to have one specific view controller
present its view in landscape orientation only. Pre-iOS 6, I would have
overridden the <code>shouldAutoRotateToInterfaceOrientation</code> method and returned
<code>UIInterfaceOrientationLandscape</code>. In iOS 6, this method is deprecated. I began
researching how orientation issues should be handled going forward, and here is
the way I made my specific scenario work.</p>
<p></p>Quick Tip: TextExpander/Octopress New Code Blockhttp://markstruzinski.com/2013/02/quick-tip-textexpander/octopress-new-code-block/
Mon, 25 Feb 2013 00:00:00 +0000http://markstruzinski.com/2013/02/quick-tip-textexpander/octopress-new-code-block/<p>Just a quick tip. This blog is built using <a href="http://octopress.org/" title="Octopress - a blogging framework for hackers">Octopress</a>.
Octopress uses <a href="https://github.com/mojombo/jekyll" title="Jekyll static blog generator">Jekkyl</a> to create a static HTML site using markdown
files for the content. I’ve been slowly building up some markdown
specific <a href="http://www.smilesoftware.com/TextExpander/index.html" title="TextExpander home page">TextExpander</a> snippets and <a href="http://www.keyboardmaestro.com/" title="Keyboard Maestro">Keyboard Maestro</a>
macros to make things easier.</p>
<p></p>Setting Up iOS Logic Tests [Part 3]http://markstruzinski.com/2013/02/setting-up-ios-logic-tests-part-3/
Tue, 19 Feb 2013 00:00:00 +0000http://markstruzinski.com/2013/02/setting-up-ios-logic-tests-part-3/<p>This is part 3 in a <a href="http://markstruzinski.com/blog/2013/02/01/unit-testing-series/">multi-part series</a> on iOS unit testing and
integration testing. In the <a href="http://markstruzinski.com/blog/2013/02/13/setting-up-ios-logic-tests-part-2/">last post</a>, we discussed setting
up <a href="https://github.com/samvermette/SVProgressHUD">SVProgressHUD</a>.</p>
<p></p>Setting Up iOS Logic Tests [Part 2]http://markstruzinski.com/2013/02/setting-up-ios-logic-tests-part-2/
Wed, 13 Feb 2013 00:00:00 +0000http://markstruzinski.com/2013/02/setting-up-ios-logic-tests-part-2/<p>This is part 2 in a <a href="http://markstruzinski.com/blog/2013/02/01/unit-testing-series/">multi-part series</a> on iOS unit testing and
integration testing. In the <a href="http://markstruzinski.com/blog/2013/02/08/setting-up-ios-logic-tests/">last post</a>, we discussed setting up
the project and adding some dependencies with CocoaPods.</p>
<p>Today, I’m going to go through setting up some initial code to use the 3rd
party libraries to make sure that the libraries are working. Then we’ll set up
logic tests and see what breaks with CocoaPods (spoiler: compiler
errors ahead!).</p>
<p></p>Setting up iOS Logic Tests [Part 1]http://markstruzinski.com/2013/02/setting-up-ios-logic-tests-part-1/
Fri, 08 Feb 2013 00:00:00 +0000http://markstruzinski.com/2013/02/setting-up-ios-logic-tests-part-1/<p>I&rsquo;m continuing on my task to get a full project using iOS unit tests and
integration tests. My first step is to set up logic tests in Xcode. I recently
watched an excellent <a href="http://www.lynda.com/iOS-tutorials/Unit-Testing-iOS-Applications-Xcode/91949-2.html?srchtrk=index%3a0%0alinktypeid%3a2%0aq%3aios+unit%0apage%3a1%0as%3arelevance%0asa%3atrue%0aproducttypeid%3a2">unit testing course</a> on <a href="http://www.lynda.com">Lynda</a>.
In that course, Ron Lisle goes over the advantages of using logic tests.
The most compelling factor in using logic tests over application tests is speed.</p>
<p></p>Unit Testing Serieshttp://markstruzinski.com/2013/02/unit-testing-series/
Fri, 01 Feb 2013 00:00:00 +0000http://markstruzinski.com/2013/02/unit-testing-series/<p>I have wanted to get better at unit testing and the tooling around it for some
time. I usually start out determined to get a good amount of the code covered
by unit tests, and to possibly get some UI tests built around user interactions.
Unfortunately, deadlines intervene, and the tests get abandoned. With my most
recent project, I decided to put all of these practices in place.</p>
<p></p>Keyboard Maestro macro to open in browser from ReadKithttp://markstruzinski.com/2013/01/keyboard-maestro-macro-to-open-in-browser-from-readkit/
Wed, 16 Jan 2013 00:00:00 +0000http://markstruzinski.com/2013/01/keyboard-maestro-macro-to-open-in-browser-from-readkit/<p>I recently switched to <a href="http://www2.ed.gov/pubs/CompactforReading/index.html">ReadKit</a> for reading <a href="https://www.instapaper.com/">Instapaper</a>
articles on my mac. I switched over from Read Later (no longer available).
Read Later was my app of choice for a long time, but it is no longer in active
development. The team was hired by <a href="http://www.pocketmac.com/">Pocket</a>, and
they are working solely on the mac app now. Read Later was good, but some much
needed updates were never implemented. The display for articles was frequently
skewed, and the app had started to crash a lot.</p>
<p></p>Homescreen January 2013http://markstruzinski.com/2013/01/homescreen-january-2013/
Thu, 03 Jan 2013 00:00:00 +0000http://markstruzinski.com/2013/01/homescreen-january-2013/<p>I’m going to try to do a post once per month detailing my current iPhone
homescreen. If it works out well, I might also do one a month for the iPad as
well. Below is a screenshot of my current homescreen.</p>
<p></p>CodePilothttp://markstruzinski.com/2012/12/codepilot/
Wed, 12 Dec 2012 00:00:00 +0000http://markstruzinski.com/2012/12/codepilot/<p>I’ve been using a handy little utility named <a href="http://codepilot.cc">CodePilot</a>
since Xcode 3.x. CodePilot runs as a plugin and does a few things simply. It
will open any file that has been indexed in your project, and also allows for
searching symbols within a file.</p>
<p></p>OCUnit - Script to Kill Simulator After Tests Runhttp://markstruzinski.com/2012/10/ocunit---script-to-kill-simulator-after-tests-run/
Wed, 10 Oct 2012 00:00:00 +0000http://markstruzinski.com/2012/10/ocunit---script-to-kill-simulator-after-tests-run/<p>I’m in the process of adding OCUnit tests to an existing iOS code base. Throughout this process, the biggest pain point I have encountered has been the simulator taking over the screen after an application test suite has run.</p>
<p></p>BackBlaze, MDS Worker, and Spotlighthttp://markstruzinski.com/2012/08/backblaze-mds-worker-and-spotlight/
Wed, 22 Aug 2012 00:00:00 +0000http://markstruzinski.com/2012/08/backblaze-mds-worker-and-spotlight/<p>I recently began experiencing my system fans kicking in and running all the time.
The fans began running so much that I almost didn&rsquo;t notice them any more.
When I pulled the Activity Monitor up, the <a href="http://osxdaily.com/2009/09/14/mdworker-what-is-mdworker/">md worker</a> was using over
100% of my system resources consistently.</p>
<p>After looking up what md worker does, it appears to be a process spun off by
spotlight to index your drive for quick searching. Even after a reboot, the
fans would kick back in after a short idle time of maybe a minute.
This process was seriously heating up the mac.</p>
<p></p>Xcode File Template for Kiwi Testshttp://markstruzinski.com/2012/08/xcode-file-template-for-kiwi-tests/
Sat, 18 Aug 2012 00:00:00 +0000http://markstruzinski.com/2012/08/xcode-file-template-for-kiwi-tests/<p>I started using <a href="https://github.com/allending/Kiwi" title="allending/Kiwi">Kiwi</a> to drive unit tests on my most recent project. Kiwi is an excellent <a href="http://en.wikipedia.org/wiki/Behavior-driven_development" title="Behavior-driven development - Wikipedia, the free encyclopedia">BDD (Behavior Driven Development)</a> framework that helps drive your code design by making test expectations very clear. It greatly increases the readability of your unit tests.</p>
<p></p>Quick Wipe of iOS Simulator Using Alfredhttp://markstruzinski.com/2012/05/quick-wipe-of-ios-simulator-using-alfred/
Wed, 02 May 2012 00:00:00 +0000http://markstruzinski.com/2012/05/quick-wipe-of-ios-simulator-using-alfred/<p>When I am rapidly prototyping new features, I frequently need to blow out the entire app structure from the simulator and start fresh.</p>
<p>To do this manually, I would follow the following steps.</p>
<p>From Simulator (when simulator is open)*:
1. Go to Menu Bar
2. Click iOS Simulator
3. Click Reset Content and Settings</p>
<p></p>Persisting Data Using the Plist Format: Part 2/2http://markstruzinski.com/2012/02/persisting-data-using-the-plist-format-part-2/2/
Thu, 23 Feb 2012 00:00:00 +0000http://markstruzinski.com/2012/02/persisting-data-using-the-plist-format-part-2/2/<p>This is a follow up to my <a href="http://markstruzinski.com/blog/2012/02/03/persisting-simple-data-using-the-plist-format/">previous post</a> on persisting PList data to
disk as a form of transient storage for data. This second part will just show
an easy way to pull that data from disk and get it into memory in an easily
usable format.</p>
<p>All of our Plists are stored as dictionaries. The keys for the dictionaries are
stored as constants in a code file (<code>Constants.h/.m</code>). This allows for compile
time checking and keeps us from having to litter our code with magic strings
when trying to access the values.</p>
<p></p>Persisting Simple Data Using the Plist Format: Part 1/1http://markstruzinski.com/2012/02/persisting-simple-data-using-the-plist-format-part-1/1/
Fri, 03 Feb 2012 00:00:00 +0000http://markstruzinski.com/2012/02/persisting-simple-data-using-the-plist-format-part-1/1/<p>Recently, we had the need to save some simple transient data to disk. For data
of any significant size, we would have looked at Core Data for our persistence.
In this case, we decided to use the PList format to save data to disk and pull
it back off. We went through several ideas to store this data.</p>
<p>Some of the ideas we considered for persistence included:</p>
<ul>
<li>Core Data</li>
<li>JSON saved in a flat file format</li>
<li>PList saved directly to disk from a Cocoa object such as an NSArray or NSDictionary</li>
</ul>
<p></p>Goodbye, Stevehttp://markstruzinski.com/2011/10/goodbye-steve/
Thu, 06 Oct 2011 00:00:00 +0000http://markstruzinski.com/2011/10/goodbye-steve/<p>I didn’t become an Apple user until a few years ago. I came to the platform out
of curiosity. I bought myself a Macbook to start teaching myself how to code
iOS apps. I quickly found myself amazed at the ingenuity and simplicity of the
entire platform. It was the way everything tied together, and always seemed to
work in the way you expected. The more I lived in the Apple world, the more
impressed I became. In 3 years, I have gone from using Apple’s products as a
hobby to a full time developer on their platform. For the first time in my life,
I have questioned that someone actually pays me to work on this stuff. I guess
if you ask yourself that question, you are doing the right thing with your life.</p>
<p></p>Quick Xcode 4 Tip: Deleting Derived Data to Rescue Code Completionhttp://markstruzinski.com/2011/09/quick-xcode-4-tip-deleting-derived-data-to-rescue-code-completion/
Fri, 30 Sep 2011 00:00:00 +0000http://markstruzinski.com/2011/09/quick-xcode-4-tip-deleting-derived-data-to-rescue-code-completion/<h3 id="quick-tip">Quick Tip:</h3>
<p>I had an issue on a very large project in XCode. Starting 2 days ago, all of my syntax highlighting was completely broken. This is bad, but even worse, my code completion worked only partially. I was getting autocomplete for local variables only. When calling framework methods with a lot of parameters, I rely pretty heavily on code completion. I tried all of the usual fixes.</p>
<p></p>On Discovering New APIshttp://markstruzinski.com/2011/06/on-discovering-new-apis/
Sat, 11 Jun 2011 00:00:00 +0000http://markstruzinski.com/2011/06/on-discovering-new-apis/<p>In working with any programming language, I&rsquo;ve always found that if you seem to be fighting things to get work done, you&rsquo;re probably doing it wrong. This is especially true in Cocoa Touch. When I was first learning the frameworks, I read a lot of blogs, books, and any other materials I could get my hands on. Almost everyone said something to the effect of <em>&ldquo;You don&rsquo;t get it? Read the docs again.&rdquo;</em></p>
<p>It took me a while to realize that Apple has excellent documentation. It&rsquo;s gotten a lot better in the Microsoft world, but in the C# 2.0 and 3.5 days, you would frequently go in search of a particular framework method or property, and come across a blank page that was obviously generated by some kind of tool. Or, my favorite was when you had a property that was named something like ToolsArray, and the description would contain verbiage like &ldquo;The array that holds the tools&rdquo;.</p>
<p></p>Using NSXMLParserhttp://markstruzinski.com/2010/06/using-nsxmlparser/
Mon, 07 Jun 2010 09:21:37 -0700http://markstruzinski.com/2010/06/using-nsxmlparser/<p>This is my first stab at an iPhone project. I&rsquo;m writing an app that consumes an RSS feed and parses it to retrieve a few bits of information for display on the screen. This is my first attempt at an implementation. Coming from a .NET background, it is quite a paradigm shift when switching to the heavily convention based world of Cocoa development.</p>
<p>If I was writing this app in .NET, I&rsquo;d go out looking for the proper class libraries to parse the XML and begin framing out a class to perform all the functions I needed to populate an object to be persisted to the UI.</p>
<p></p>Abouthttp://markstruzinski.com/about/
Mon, 01 Jan 0001 00:00:00 +0000http://markstruzinski.com/about/Hi. I'm Mark Struzinski. I've been a software developer for 15+ years, and have been doing iOS for about 7. I'm an iOS dev lead for a major retailer. I love working on the iOS ecosystem. There is always something new to learn, or a new approach to try. I enjoy helping others as much as developing software. In addition to writing on this website, I am also a co-organizer of the [Mooresville Mobile](https://www.