{"id":5445,"date":"2026-08-30T19:50:34","date_gmt":"2026-08-30T10:50:34","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/ios-shortcut-technical-logic-deepdive-2\/"},"modified":"2026-08-30T19:50:35","modified_gmt":"2026-08-30T10:50:35","slug":"ios-shortcut-technical-logic-deepdive","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/compare-tips\/iphone-ios-shortcut\/ios-shortcut-technical-logic-deepdive\/","title":{"rendered":"Technical Challenges and Solutions in iOS Shortcut Development"},"content":{"rendered":"<p>In our previous article, &#8220;Creating Photos with &#8216;Location Data &#038; Maps&#8217; Using Just an iPhone,&#8221; we covered the overview and installation method of the shortcut. This time, we will detail the logic behind it and the technical challenges we were forced to solve during the development process.<\/p>\n<p><a href=\"https:\/\/www.icloud.com\/shortcuts\/8825b6e71426404c87c0d909fe48248c\" target=\"_blank\" rel=\"noopener\" data-blogcard=\"1\">Add Location Data to Photos V3<\/a><\/p>\n<h2>Automated Composition System Integrating Metadata<\/h2>\n<p>The development objective this time is to accurately extract a set of metadata from multiple selected photos, reconfigure it into a format suitable for printing, and save them as new files. Since accurate identification of the shooting location is essential for post-investigation using field guides, we incorporated logic to automatically execute the following functions:<\/p>\n<ul>\n<li>Batch processing and image optimization: Supports the selection of multiple photos and adopts a loop structure that repeats processing for each image. In accordance with postcard standards (postcard size, etc.), vertically oriented photos are automatically rotated 90 degrees to convert them into landscape orientation.<\/li>\n<li>Generation of visual map information: Retrieves a map centered on the shooting coordinates, crops it into an oval shape for aesthetic appeal, and places it on top of the photo.<\/li>\n<li>Inclusion of detailed information: Turns a total of seven variables\u2014date acquired, region, postal code, address, latitude, longitude, and altitude\u2014into text and overlays them along with the map.<\/li>\n<\/ul>\n<h2>Four Technical Challenges Faced During Implementation<\/h2>\n<p>During the development process, we encountered four main challenges stemming from the specifications of iOS Shortcuts and privacy restrictions.<\/p>\n<ol>\n<li>Uncertainty of location data: Even if the iPhone&#8217;s &#8220;Precise Location&#8221; setting is enabled, case-by-case shooting environments or communication conditions may rarely result in EXIF data missing location coordinates. In this case, the subsequent map retrieval action errors out, causing the entire workflow to halt.<\/li>\n<li>Access permission popup issue: Actions involving location access, such as &#8220;Search for Places,&#8221; require system permission. However, when executed from a shortcut icon created on the home screen, the popup requesting permission fails to display properly, causing the process to freeze.<\/li>\n<li>Insufficient pinpoint display on maps: The map image acquired via the standard action does not display a pin indicating the shooting location. A visual marker is indispensable for increasing accuracy as a record.<\/li>\n<li>Handling high-volume processing: Manual processing one by one presented an operational challenge of being inefficient when compiling observation records from multiple locations.<\/li>\n<\/ul>\n<h2>Building Solutions Through Advanced Logic<\/h2>\n<p>To address these challenges, we implemented the following logic using conditional branching and rendering hacks to find a solution.<\/p>\n<ol>\n<li>Repetitive processing and EXIF checks: We first place a &#8220;Repeat with Each&#8221; action to process each of the multiple selected images one by one. At the beginning of the loop, an &#8220;If&#8221; statement determines whether &#8220;photos have location data,&#8221; and if the information is missing, a popup notification is triggered to skip that specific image. Since there is no fundamental solution other than manually assigning coordinates when location data is absent, prioritizing logic to prevent stoppage due to errors was implemented.<\/li>\n<li>Initialization of access permissions: To avoid freezing on the home screen, execution must always be initiated from within the &#8220;Shortcuts&#8221; app itself upon initial setup or settings changes. By authenticating location access as &#8220;Always Allow&#8221; within the app once, stable operation for subsequent uses was secured.<\/li>\n<li>Pin overlapping and oval cropping: Since the center of the map image matches the shooting coordinates, a pin was reproduced by text-overlaying the &#8220;\ud83d\udccd&#8221; emoji at the &#8220;Center.&#8221; Furthermore, cropping the map image itself with an &#8220;Oval&#8221; mask enhanced the aesthetic design on postcards.<\/li>\n<li>Multi-item overlay: Variables such as acquisition date, region, postal code, address, latitude, longitude, and altitude were formatted into a single text box and placed at the appropriate position on the photo along with the map image.<\/li>\n<\/ol>\n<h2>Conclusion<\/h2>\n<p>This tool realizes the addition of location data to photos using standard iPhone features. By incorporating conditional branching to determine the presence or absence of EXIF data in multiple photos, we achieved a workflow that operates even under uncertain data environments. Furthermore, we resolved access permission issues through operational procedures involving initial execution from within the app itself, and addressed reduced map visibility by introducing a hack of overlaying an emoji.<\/p>\n<p>We hope this shortcut proves helpful to those who similarly cherish keeping records or enjoy exploratory activities with their children.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our previous article, &#8220;Creating Photos with &#8216;Location Data &#038; Maps&#8217; Using Just an iPh [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":3205,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=3203","footnotes":""},"categories":[1177],"tags":[1151],"class_list":["post-5445","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-iphone-ios-shortcut","tag-1151","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=5445"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5445\/revisions"}],"predecessor-version":[{"id":5448,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5445\/revisions\/5448"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/3205"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=5445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=5445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=5445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}