- Overview
- Getting Started
- Debugging and Logging
- Table Views
- Returning Data to a Presenting View Controller
- Navigation Controller Back Button Behaviour
- How to manually rename view controller
- Add storyboard controls to stack view
- Toolbar
- Button Border Colours
- Keyboard Navigation with the Next Button
- Home Screen Quick Actions
- Long Press Gesture Handling
- Simulator
- Type X does not conform to protocol NSObjectProtocol
- Launch URL in Safari
- Location Manager
- Internationalisation/Localisation
- Attributed Strings
- Share Sheet (UIActivityViewController)
- Document Handling - Uniform Type Identifiers (UTI)
- Core Data and CloudKit
- iCloud File Management
- Fonts
- Artwork
- Distribution
- Screen Recording
- Identifying iPad Models
- Root Certificates
- Miscellaneous
- Guides
- Force reboot iPhone X
- Compiler Error Messages
- Useful Commands
- Other information
- Xcode
- Resources
iOS Development
Overview
This document relates to developing iOS applications on macOS Sierra versions 10.12.6 to 10.13.3 using Xcode versions 9.0.1 to 9.2 and iOS 10.3.1 together with Swift 4.
Getting Started
Xcode
Also, select Help > Xcode help
from the Xcode menu, then Xcode overview
.
- Xcode: What is a target and scheme in plain language?
- gitignore - A collection of useful .gitignore templates
- Stackoverflow: How to upgrade Xcode by keeping the previous version?
To show line number and a page guide, go to Xcode > Preferences > Text
Editing. Select Line numbers
and Page guide at column:
.
Installing Simulators
To download and install older iOS simulators:
Xcode -> Preferences -> Components -> Simulators
https://stackoverflow.com/questions/4262018/xcode-simulator-how-to-run-older-ios-version
See also:
Downloading Simulator Runtimes
Simulator runtimes are downloaded using Xcode, under Preferences -> Components.
They are saved under
/Library/Developer/CoreSimulator/Profiles/Runtimes/
. Restart Xcode
after manually removing old simulator runtimes from that folder.
Creating Simulators From The Command Line
$ xcrun simctl help create
$ xcrun simctl list devicetypes runtimes
$ xcrun simctl create 'iPhone 12 Pro Max (iOS 14.4)' 'iPhone 12 Pro Max' iOS14.4
$ xcrun simctl create 'Apple Watch Series 6 - 44mm (watchOS 7.2)' 'Apple Watch Series 6 - 44mm' watchOS7.2
$ xcrun simctl create "Apple Watch Series 9 (45mm)" \
"com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-9-45mm" \
"com.apple.CoreSimulator.SimRuntime.watchOS-10-4"
$ xcrun simctl list devices
$ xcrun simctl help pair
$ xcrun simctl pair ${WATCH_UUID} ${PHONE_UUID}
$ xcrun simctl list devices pairs
See iOS Simulator from the Command Line for more information.
Removing Redundant Simulators
For help on using the simctl
command:
$ xcrun simctl help
For help on the delete
subcommand:
$ xcrun simctl help delete
To delete all unavailable devices:
$ xcrun simctl delete unavailable
Initial Learning
Read The Swift Programming Language (Swift 4) also available as a free iBook from the App Store.
Follow the Start Developing iOS Apps (Swift) tutorial
Review the documents listed under the
What's next? Where to Go from Here
section of the Start Developing iOS Apps (Swift) tutorial
Debugging and Logging
See WWDC 2020—Explore logging in Swift
Since macOS 11.0, iOS 14.0 and watchOS 7.0 Logger statements can use String interpolation, including formatting arguments, e.g.
mylogger.log("\(myItem, align: .left(columns: 25)) \(myValue, format: .fixed(precision: 2))")
Other options for align and format can be found when using Xcode by using code completion. See also Generating Log Messages from Your Code | Apple Developer Documentation.
Values can be masked by using hashes, allowing comparisson of values without obvious exposure in the log. E.g.
mylogger.log("My secret is: \(mySecret, privacy: .private(mask: .hash))")
Logs can be collected on macOS with a connected device, e.g.
$ man log
$ log collect --device --start '2021-03-31 10:22:00' --output my.logarchive
Logs can be opened in the Console
application. However, it appears logging
is normally disabled for the Apple Watch. You now need to install a profile
which enables logging for a few days. It's still very flaky to use.
- https://forums.developer.apple.com/forums/thread/696463
- https://developer.apple.com/bug-reporting/profiles-and-logs/?name=sysdiagnose
Log Levels
- Debug—Useful only for debugging—Not persisted
- Info—Helpful for troubleshooting—Persisted only during
log collect
- Notice (Default)—Essential for troubleshooting—Persisted
- Error—Execution error—Persisted
- Fault—Program bug—Persisted
Persisted log levels are only persisted within a storage limit for the device. Faults are potentially retained longer than errors, and errors longer than notices.
See also:
- Basic debugging using logging for Swift and Objective-C apps
- debugPrint(_:separator:terminator:)
- Logging
- debugging - Swift: print() vs println() vs NSLog() - Stack Overflow
- Share and Copy Files Between an App and iTunes
- swift - Read and write data from text file - Stack Overflow
- ios - Append data to txt file in Swift 3 - Stack Overflow
- File System Programming Guide
- Technical Q&A QA1747 - Debugging Deployed iOS Apps
See also callStackSymbols() which provides an array of strings showing the state of the call stack, which could be dumped to a debug log etc.
Table Views
TableViews are quite useful for many if not most uses. Note that a table view
has content which consists of either Static Cells
or Dynamic Prototypes
.
The Start Developing iOS Apps (Swift) tutorial shows how to use Dynamic
Prototypes
, but if you know the content of the table view at compile time, it
is quite straight-forward to implement in the storyboard. Briefly;
Drag a
Table View Controller
onto the storyboard from the Object Library.Use the Attributes Inspector to change the Table View
Content
toStatic Cells
.Consider changing the
Style
toGrouped
Set the number of rows for the initial section and add elements to match the behviour of the majority of the sections. These wil be duplicated when you create more sections.
Change the number of sections to create the additional sections.
Create a
UITableViewController
class and assign it to theCustom Class
property of the table view in the Identity Inspector.
See also:
- ios - Swift programmatically navigate to another view controller/scene - Stack Overflow
- ios - Create UITableView programatically in Swift - Stack Overflow
- ios - How to add programmatic constraints to a UITableView? - Stack Overflow
- iOS - Swift - UITextView scroll to bottom extension · GitHub
- ios - Adding UITextField on UIView Programmatically Swift - Stack Overflow
- ios9 - Swift/iOS 9: using Popover Presentation with a UITableViewCell - Stack Overflow
- ios - Expanding and collapsing UITableViewCells with DatePicker - Stack Overflow
- Close iOS Keyboard by touching anywhere using Swift - Stack Overflow
Disabling Cell Selection in Dynamic Table
To disable cells being highlighted when selected in a dynamic table view, use
the storyboard to select the prototype cell in the Document Outline. It will
be a child of the Table View. In the Attributes Inspector, under the Table
View Cell
properties, beneath the Identifier
section, change the
Selection
option to None
.
Returning Data to a Presenting View Controller
Implement the delegate pattern. See the Dismissing a Presented View
Controller
in the Presenting a View Controller
section of the
Presentations and Transitions
chapter of the
View Controller Programming Guide for iOS
Create a simple protocol defining a suitable method to pass the data.
The presented view has an optional delegate property of that protocol type.
The presenting view implements the delegate protocol. It sets the presented view delegate to itself before the view is presented, perhaps in the
prepare(for:sender:)
method of the presenting view, which will be called when the segue is activated.When values change on the presented view, it can make appropriate calls to the delegate method(s) to update the presenting view's data model.
Navigation Controller Back Button Behaviour
The back button of a pushed view is actually defined in the presenting parent. The logic seems to be that the pushed view's back is logically the pushing view.
If the presenting view does not have a navigation item, the back button text
of the called view will be Back
. Add a navigation item by dragging a
Navigation Item
from the object library to beneath the controller element of
scene in the outline view.
Then select the new navigation item in the outline view and set the title for the presenting page. If you want presented pages to show a different text for the back button, enter the values in the navigation item's back button setting in the attributes inspector.
The text for the back button of the pushed view should change appropriately in
the interface builder to display either the title of the presenting view or if
the back button text has been defined, it'll use that. Note that at run-time,
if the text to be displayed for the back button is too long for the device
screen size, it is replaced with the localised version of Back
.
See also:
Split View Controllers and Navigation
In a split view, in some situations, a detail view navigation controller uses the title of the master navigation controller to name the left back button of the detail view navigation bar. One such scenario is in portrait mode on an iPad Pro (12.9-inch). The title can be set in the storyboard.
To display the left back button on the detail view, in the storyboard, select
the Navigation Item
in the detail view controller and use the Attributes
inspector
to set the Left Items Supplement
checkbox. Alternatively, set it
at runtime with code similar to
myViewController.navigationItem.leftItemsSupplementBackButton = true
.
How to manually rename view controller
The easiest method is to right click the classname in the class definition file and choose the refactor method. But if you want or need to fix things manually, follow these steps:
Rename it in the project navigator by selecting
ViewController.swift
and hitting return.Rename the class and also the header comment
Open
Main.storyboard
Select the View Controller by clicking on its scene dock or select the View Controller in the outline view
Open the Object Inspector (Option-Command 3)
Under
Custom Class
select the renamedClass
Add storyboard controls to stack view
Shift-click each of the controls to select them
Select
Editor > Embed In > Stack View
Toolbar
Open the storyboard and select the related navigation controller
In the Attributes inspector, Navigation Controller section, select
Shows Toolbar
Within a view controller that displays the toolbar, programmatically create instances of UIBarButtonItem
Assign an array containing the buttons to the view controller's
toolbarItems
propertyIn the storyboard, select each view controller that you do not wish to display the toolbar on and select the
Hide Bottom Bar on Push
in theAttributes inspector
How to show and hide a toolbar inside a UINavigationController
Button Border Colours
Keyboard Navigation with the Next Button
Making the next button move to the next edit field involves giving each
UITextField
a integer tag, each tag value incrementing from the previous. In
the controller handle when the return (next/send/done/etc) key is pressed, get
the tag value of the current UITextField
, increment it, and find the
associated UITextField
from the owning super view, (most likely the view of
the current controller) and set it to become the first responder.
Your view controller implements the UITextFieldDelegate
and defines the
textFieldShouldReturn(textField:)
method.
The tags can be set for the text fields in the interface builder. The
Connections Inspector is used to associate the delegate with the
view controller which implements the UITextViewDelegate
.
- https://stackoverflow.com/questions/31766896/switching-between-text-fields-on-pressing-return-key-in-swift
- https://stackoverflow.com/questions/1347779/how-to-navigate-through-textfields-next-done-buttons
- https://stackoverflow.com/questions/27888608/how-do-i-set-the-delegate-for-a-text-field-in-the-interface-builder-to-files-ow
Home Screen Quick Actions
- https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/Adopting3DTouchOniPhone/
- https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW36
- Using UIApplicationShortcutItems
- UIApplicationShortcutItem
Long Press Gesture Handling
- https://developer.apple.com/documentation/uikit/touches_presses_and_gestures/handling_uikit_gestures/handling_long-press_gestures
- https://stackoverflow.com/questions/3924446/long-press-on-uitableview
Simulator
Local files are stored in a directory under
~/Library/Developer/CoreSimulator/Devices
. To find out the id of the
device, open the Devices and Simulators window in Xcode. Window > Devices
and Simulators
Select either Simulators
or Devices
as appropriate, then
select the device. The Identifier
is displayed under the details of the
device at the top of the window.
iCloud in Simulator
Resync simulator with iCloud by selecting Debug > Trigger iCloud Sync
from
simulator menu.
Type X does not conform to protocol NSObjectProtocol
Implement NSObject protocol.
https://stackoverflow.com/questions/40705591/class-does-not-conform-nsobjectprotocol
Launch URL in Safari
Location Manager
See also:
- Core Location | Apple Developer Documentation
- About Location Services and Maps
- Changes to location tracking in iOS 11 – mackuba.eu
Desired Accuracy
The following observations have been noted in testing on iPhone X with iOS 11:
- 10 metres - seems to turn on GPS and cause frequent calls to the delegate. Additionally, provides speed and bearing information.
- 100 metres - infrequent calls to the delegate and doesn't seem to use GPS. Locations are frequently less accurate than 100 metres to the point where obtaining locations with an HDOP of less than 100 metres is unlikely.
- Setting the distance filter causes the OS not to call the location manager until the distance criteria has been met. This is likely to be an important value in reducing battery usage.
See also:
- Apple URL Scheme Reference - Map Links
- ios - How to add apple map marker via query string in the url? - Stack Overflow
- MKMapItem - MapKit | Apple Developer Documentation
Deferred Locations
Note: I have been unable to get deferred locations working with iOS 11 on iPhone SE nor on iPhone X.
- xcode - How to work with deferred location iOS 6? - Stack Overflow
- ios - iOS7: Is it more power efficient to defer updates or to set desired accuracy to low-accuracy - Stack Overflow
Simulating Locations
The Xcode Debug has a Simulate Location
option, which is disabled unless the
app is running in a simulator with the debugger attached to the running app
process. However, it seems to be broken in Xcode 9.2. At best it will
provide one point per LocationManager session then stop.
However, in the simulator menu Debug -> Location
there are options to choose
between a City Run
, City Bicycle Ride
or Freeway Drive
that simulate
real trips. Note: This is in the simulator application, not Xcode.
Internationalisation/Localisation
In Xcode 15 and later, localisation uses Xcode Localization Catalogs instead of XLIFF files. Existing projects can be migrated to use String Catalogs by right-clicking a localised file and choose the migrate option.
See the following in Xcode help for the full documentation:
For older versions of Xcode, see:
Xcode's XLIFF based translations can be managed using OmegaT. See OmegaT.html for some notes on its use.
Attributed Strings
- Standard Attributes
- How to make tappable links in NSAttributedString - free Swift 4 example code
- Swift: Creating styled and attributed text with NSAttributedString and NSParagraphStyle (updated)
Share Sheet (UIActivityViewController)
- Add sharing to your Swift app via UIActivityViewController
- How do I share files using share sheet in iOS
Document Handling - Uniform Type Identifiers (UTI)
- Introduction to Uniform Type Identifiers Overview
- Creating your own UTI for an iOS app
- Technical Q&A QA1587: How do I get my application to show up in the Open in... menu.
- System-Declared Uniform Type Identifiers
- About document types and the UTIs
Editing Documents Inplace
- https://developer.apple.com/documentation/uikit/uiapplication/openurloptionskey/1623123-openinplace/
- https://stackoverflow.com/questions/15707874/good-way-to-manage-the-documents-inbox-folder-in-an-ios-app
Core Data and CloudKit
Watch WWDC 2017 - What's New in Core Data. Covers topics such as query optimisation with indexes and persistent history tracking. That latter is probably the most effective technique to use for updating offline changes etc. to the cloud.
To handle when records have been deleted, you probably need to preserve the
primary key value in order to delete the same record on the Apple Watch. You
do this by defining the relevant attribute as one to Preserve After
Deletion
.
In the Xcode model editor, Select the attribute and open the Data Model
inspector
panel. In the Advanced
sub-section of the Attribute
section,
there is the option to Preserve After Deletion
.
- CloudKit - iCloud - Apple Developer
- CloudKit | Apple Developer Documentation
- Core Data | Apple Developer Documentation
- Designing for CloudKit
- Allowing Your Users to Manage Data Stored in iCloud - Support - Apple Developer
- ios - Using Core Data, iCloud and CloudKit for syncing and backup and how it works together - Stack Overflow
- Cloud Kit vs Core Data on iCloud |Apple Developer Forums
- Core Data Programming Guide: What Is Core Data?
- Synchronizing data with CloudKit – Guilherme Rambo – Medium
- Xcode 6 iOS 8 iCloud core data setup - Stack Overflow
- How to Sync User Data Across iOS Devices with CloudKit | Toptal
- Syncing with CloudKit in a clean architecture (swift)
Core Data and Concurrency
To run a debug session with a device and check CoreData Concurrency...
Product > Scheme > Manage Schemes...
.Select a scheme in the list, then click
Edit...
.Select
Run Debug
in the left sidebar.Select the
Arguments
tab.Under
Arguments Passed On Launch
add:-com.apple.CoreData.ConcurrencyDebug 1
https://oleb.net/blog/2014/06/core-data-concurrency-debugging/
- https://stackoverflow.com/questions/31391838/making-com-apple-coredata-concurrencydebug-1-work
- https://stackoverflow.com/questions/36465603/ios-core-data-dispatch-async-background-queuing-crash
- https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html
Running Debug Builds with Production CloudKit
Add the following key to your entitlements
file
as a Key of type String
and a of value Development
or Production
.
com.apple.developer.icloud-container-environment
The entitlements file can be found within the project hierarchy. It should be named $PROJECT_NAME.entitlements. It can be opened in Xcode using Finder.
- https://stackoverflow.com/questions/30182521/use-production-cloudkit-during-development
- https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
iCloud File Management
Fonts
Artwork
Install the ImageMagick
package from MacPorts. See
InstallingMacPorts.
Artwork can then be created from a larger original (e.g. 2048x2048) with:
$ convert $FILENAME -resize '40x40!' converted_file.png
To create a scalable PDF image:
$ convert $FILENAME -resize '40x40!' convert_file.pdf
See also:
Generating App Icons
- App Store Promotional Artwork Guidelines
- Technical Q&A QA1686: App Icons on iPhone, iPad and Apple Watch
- Generate iOS & Android app icons straight into a Phonegap project | Birchenough.co.uk
- iOS APP ICONS Generator - a shell script which aim to generate iOS APP icons easier and simply
Miscellaneous
Distribution
- 5 Options for Distributing Your iOS App to a Limited Audience
- ios - Install apps on device without iTunes - Stack Overflow
- [xcode - iOS development: GameCenter and In-App always activated by default - Ask Different}(https://apple.stackexchange.com/questions/110536/ios-development-gamecenter-and-in-app-activated-default)
Free Developer Account
Note: apps distributed using ad hoc distribution with a free developer account will not run on a device after the provisioning profile expires. The certificate for the provisioning profile expires after a maximum of seven days.
Provisioning Profiles
- iphone - iOS Provisioning profile expiring after 6 days - Stack Overflow
- ios - Xcode 8.3 / Xcode 9.0 Refresh provisioning profile devices - Stack Overflow
- Provision profile expires - Paid account | Apple Developer Forums
Ad Hoc Distribution
Ad hoc distribution allows you to distribute and install builds on internal test devices. The device IDs (UDID) need to be included in your developer account and your provisioning profile certificate needs to include these device IDs, otherwise, they either fail to install, or simply fail/crash on startup.
There are instructions in Xcode Help under Xcode Help > Archive, distribute, and test > Test a beta version > Distribute to registered devices (iOS, tvOS, watchOS).
Create the build in Xcode 9.2 by selecting the build target as Generic iOS
Device
in Xcode's toolbar. Then select Product > Archive
from the main
menu. This will build the app, then display the Organizer
window containing
this and previous builds. You can display this window in the future by
selecting Window > Organizer
from the main menu.
Xcode 10 introduces a new build system. It can be changed by selecting your
project, then File > Project settings
from the main menu. Then under
Shared Project Settings:
, Build System:
you can switch to Legacy Build
System
.
To export the build for distribution:
Click the
Distribute App
button (previously namedExport...
) in theOrganizer
window.Select a method of distribution.
Choose an appropriate value for the
App Thinning
option,None
creates a single universal app that runs on all supported devices. Note that in Xcode 10.1, thinned apps won't install via ad hoc distribution, so leave this option asNone
in that situation.Uncheck
Rebuild from Bitcode
- there doesn't seem to be a way to analyse crash logs when apps are distributed with this option set.Optionally, choose to
Strip Swift symbols
If you want to distribute the app so it can be installed by users using Safari, choose the
Include manifest for over-the-air installation
Click
Next
.If you chose to create a manifest, fill in the
Distribution manifest information
. This is information is not remembered by Xcode, so store the details somewhere else for future reuse.Click
Next
.Choose the
Automatically manage signing
option. This should work in most cases. Xcode 10 doesn't seem to create a new ad hoc provisioning profile after an old one expires, so it is necessary to create one within iTunes Connect, download and import it into Xcode. Also, when you start using a new device for internal testing, you will need to update the certificates within iTunes Connect to include the new device and manage signing manually. You need to create an ad hoc provisioning profile that includes the devices registered for ad hoc distribution.Click
Next
. The artefacts are created and signed.Click
Export
and choose a target location for the exported files to be saved.If distributing for installation via Safari, upload
manifest.plist
and all the.ipa
archives to a single directory on your website. Create an HTML page containing anhref
link of the following format:<a href="itms-services://?action=download-manifest&url=https://HOST/PATH_TO_FOLDER/manifest.plist">Click here to install</a>
If installation fails, there is unlikely to be an error message to analyse. When you click the link, you should immediately see a dialog asking if you would like to install the app. If it fails before that point, it may be because the app is already installed and was installed from another source, most likely the official app store. Either install using Xcode, or uninstall the old version first.
The website's log should see some GET requests. One should be for the
manifest.plist
file. That GET request should show the model that it looks
up in the manifest file, e.g. iPhone10,6
. The next GET request should be
for the IPA file listed for that model in the manifest.plist
file.
If the install starts but fails after it appears to have downloaded the IPA file, it is most likely a problem with the signing certificate, or the device not having been registered in the developer account. See Register a single device in the Developer Account Help, under Register Devices > Register a single Device.
You may also need to 'reset' your registered devices after commencing a new developer membership year, otherwise the ad hoc app will fail to properly install on the device.
To install using Xcode;
connect your device to the build machine, e.g. via a lightning cable
Open the
Devices and Simulators
window (Window > Devices and Simulators
from the main menu)Select the
Devices
tabSelect the device under
Connected
in the left sidebarClick the
+
symbol underneath the list ofINSTALLED APPS
Browse to and select the relevant
.ipa
archive fileThe application installs on the target device
See also:
- distribute Ad Hoc ios app on Personal WebServer
- Locating Device Identifiers
- Exporting Your App for Testing (iOS, tvOS, watchOS)
- iphone - How to install app from TestFlight via itunesconnect as an internal tester in ios? - Stack Overflow
Beta Testing with TestFlight
- TestFlight - Apple Developer
- TestFlight beta testing overview (iOS, tvOS, watchOS) - iTunes Connect Developer Help
- Technical Note TN2285: Testing iOS App Updates
- Using Apple's new TestFlight Beta Testing
Sandbox Testing
You need unique valid e-mail addresses for each sandbox tester. Apparently, the sandbox account cannot be used in the simulator environment.
Warning—Logging into a production version of an Apple environment causes the sandbox account to become invalid and cannot be used again.
- Apple Pay Sandbox Testing
- Create a sandbox tester account
- How to create a Sandbox Tester Account on iTunes Connect - Medium
- Setting up sandbox test users for CloudKit development | Latitude iOS
- Apple sandbox tester “this field is invalid” for password
App Store Release Process
- Technical Note TN2420 - Version Numbers and Build Numbers
- How To Change Your App Icon at Build Time
- App Store Review Guidelines - Apple Developer
- Technical Note TN2431: App Testing Guide
Crash Logs
See Technical Note TN2151: Understanding and Analyzing Application Crash Reports for full details.
As a generalisation, if you want to symbolicate a crash report from a device connected to your machine running Xcode and the app has been installed via the app store, you need to download the dSYM files that were generated during compilation on the App Store. The App Store build with have a different UUID to the build in the Xcode archive.
In Xcode (version 11.3), display the
Organizer
,Window > Organizer
, and select theArchives
tab.Select the appropriate app in the
iOS App
sidebar.Select the appropriate build that was uploaded to the App Store.
In the right sidebar, click the
Download Debug Symbols
button.Open the
Devices and Simulators
window,Window > Devices and Simulators
.Select the device in the left sidebar.
Click the
View Device Logs
button.Select and right-click the appropriate crash report in the left sidebar.
Select the
Re-Symbolicate Log
option.Right-click the crash report and select the
Export Log
option, saving it somewhere.Open the saved report in Xcode,
File Open...
and associate it with the appropriate project.The crash report should then be displayed in the project.
Diagnosing issues using crash reports and device logs | Apple Developer Documentation
- Adding identifiable symbol names to a crash report | Apple Developer Documentation
- Understanding the exception types in a crash report | Apple Developer Documentation
- Technical Q&A QA1747 - Debugging Deployed iOS Apps
- Retrieve dSYMs for Bitcode apps
- ios - How is a .dSYM file created? - Stack Overflow
- iphone - dSYM file from device - Stack Overflow
- iphone - Can I still symbolicate a distribution build that stripped its debug symbols? - Stack Overflow
- Getting dSYM's from Enterprise App | Apple Developer Forums
- Demystifying iOS Application Crash Logs
U.S. Export Regulations
- https://www.bis.doc.gov/index.php/policy-guidance/encryption Apparently link is not persistent, so if broken, go to main site and follow menu options; Policy Guidance - Encryption and Export
- Annual Self Classification Report If the link is broken; from the main site, Policy Guidance - Encryption and Export - Reports and Reviews - Annual Self-Classification
- Reporting App Encryption use to the US Government Note: Be very careful about following advice from anyone other than a legal expert. The responsibility to comply remains yours. It looks like that even if you're only doing something as simple as using HTTPS, at the very least you need to submit the annual self-classification report whether or not you are a U.S. citizen.
- iTunes Connect Encryption Info
Screen Recording
- How to record the screen on your Mac, iPhone or iPad - Macworld UK
- How to Capture and Record An iPhone Or iPad Screen Video? - Apptamin
Identifying iPad Models
Root Certificates
Miscellaneous
Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead.
In the storyboard, enter a rowHeight of 44 for the table view, instead of leaving it at automatic.
Excluding Files from Backup
Guides
- Apple Developer Documentation
- How it works - Apple Developer Program
- The Swift Programming Language (Swift 4)
- View Controller Programming Guide for iOS
- Code Signing Guide
- Support - Code Signing
- Xcode Keyboard Shortcuts and Gestures
- Guides and Sample Code
- MyLife: A simple app for starting iOS development
- Unit Testing Apps and Frameworks
- App Programming Guide for iOS
- iOS Human Interface Guidelines
- iOS Design Guidelines
- About App Development with UIKit
- SegueCatalog: Customizing and Unwinding with View Controller Containment
- Using Unwind Segues
- Working with unwind segues in Swift
- Core Data Programming Guide
- iCloud Design Guide - Designing for Core Data in iCloud
- Core Data for iOS: Part 4 - Core Data syncing with iCloud
- Information Property List Key Reference
- Auto Layout Guide
- Document Picker Programming Guide
- View Programming Guide for iOS
- Collection View Programming Guide for iOS
- Table View Programming Guide
- UITableView Fundamentals for iOS
- Text Programming Guide for iOS
- Location and Maps Programming Guide
- LLVM Compiler Overview
- LLDB Quick Start Guide
- Bonjour Overview
- App Distribution Guide
- HTTPS Server Trust Evaluation
- Popover Controllers in iOS
Force reboot iPhone X
Press and quickly release volume up button
Press and quickly release volume down button
Press and hold the side/power button until the Apple logo is displayed. Can take 10 seconds or longer.
https://support.apple.com/en-gb/HT201412
Compiler Error Messages
Type 'MyClass' does not conform to protocol 'NSObjectProtocol'
Make MyClass
extend NSObject
and all the methods required by
NSObjectProtocol
are provided with a default implementation.
Useful Commands
The following sed
command run on macOS will comment out all os_log
statements with a type of .debug
.
$ sed -i '~' -E 's/(^[[:space:]]*)(os_log\(.*[[:space:]]+type:[[:space:]]+\.debug)/\1\/\/ \2/g' *.swift
Other information
- iOS 11 - Apple (UK)
- About iOS 11 Updates - Apple Support
- iOS GPX Framework - a iOS framework for parsing/generating GPX files
- YapDatabase - an extensible database for iOS & Mac
- iOS SDK: Keeping Content from Underneath the Keyboard
Xcode
Swift Language Version
$ xcrun swift --version
Check the path to ensure it is the intended version of Xcode that xcrun
is
executing:
$ xcrun --find swift
The version can be changed in the Xcode project settings, under Build
Settings > Swift Compiler - Language > Swift Language Version
.
See https://stackoverflow.com/questions/30790188/how-do-i-see-which-version-of-swift-im-using
Resources
-- Frank Dean - 23 Dec 2017
Related Topics: Internationalisation, iOSTips, MacOSXTips, OmegaT.html, Swift.md, ViewRangerTips, watchOSDevelopment, Xcode