Hackingwithswift.com
Less than 1 minute
Catalog
Availability checking in Swift: backwards compatibility the smart way
Error handling in Swift: try, catch, do and throw
Free iOS 9 tutorials
Hacking with iOS – learn to code iPhone and iPad apps with free Swift tutorials
- Access controlArraysClassesClosuresConditional statementsDictionariesEnumerationsExtensionsFunctionsHow to install Xcode and create a playgroundIntroduction: Swift for Complete BeginnersLoopsOperatorsOptional chainingOptionalsPolymorphism and typecastingPropertiesProtocol extensionsProtocolsStatic properties and methodsString InterpolationStructsSwitch caseTypes of DataVariables and constantsWrap up
- A hands-on guide to the CloudKit dashboardAnimating UIStackView subview layoutDelivering notifications with CloudKit push messages: CKQuerySubscriptionProject 33: What's that Whistle?Reading from iCloud with CloudKit: CKQueryOperation and NSPredicateRecording from the microphone with AVAudioRecorderSetting upWorking with CloudKit records: CKRecord.Reference, fetch(withRecordID:), and save()Wrap upWriting to iCloud with CloudKit: CKRecord and CKAsset
- Adding in players: GKGameModelPlayerCreating a GameplayKit AI using GKMinmaxStrategistCreating the interface with UIStackViewDetecting wins and draws in Four in a RowHow GameplayKit AI works: GKGameModel, GKGameModelPlayer and GKGameModelUpdateImplementing GKGameModel: gameModelUpdates(for:) and apply()Preparing for basic playProject 34: Four in a RowSetting upWrap up
- Choosing a random number source: GKARC4RandomSource and other GameplayKit optionsGenerating random numbers with GameplayKit: GKRandomSourceGenerating random numbers without GameplayKitProject 35: Generating random numbersSetting upShaping GameplayKit random numbers: GKRandomDistribution, GKShuffledDistribution and GKGaussianDistributionShuffling an array with GameplayKit: arrayByShufflingObjects(in:)Wrap up
- Background music with SKAudioNode, an intro, plus game overCreating a player: resizeFill vs aspectFillCreating collisionsOptimizing SpriteKit physicsPixel-perfect physics in SpriteKit, plus explosions and moreProject 36: Crashy PlaneSetting upSky, background and ground: parallax scrolling with SpriteKitWrap up
- Adding a CAGradientLayer with IBDesignable and IBInspectableAnimating a 3D flip effect using transition(with:)Communicating between iOS and watchOS: WCSessionCreating a particle system using CAEmitterLayerDesigning a simple watchOS app to receive dataHow to measure touch strength using 3D TouchLaying out the cards: addChildViewController()Project 37: Psychic TesterSetting upWiggling cards and background music with AVAudioPlayerWrap up
- Adding Core Data entity relationships: lightweight vs heavyweight migrationAdding Core Data to our project: NSPersistentContainerCreating an NSManagedObject subclass with XcodeDesigning a Core Data modelExamples of using NSPredicate to filter NSFetchRequestHow to delete a Core Data objectHow to make a Core Data attribute unique using constraintsLoading Core Data objects using NSFetchRequest and NSSortDescriptorOptimizing Core Data Performance using NSFetchedResultsControllerProject 38: GitHub CommitsSetting upWrap up
- Counting unique strings in an arrayCreating our first unit test using XCTestFiltering using functions as parametersLoading our data and splitting up words: filter()measure(): How to optimize our slow code and adjust the baselineProject 39: Unit testing with XCTestSetting upUpdating the user interface with filteringUser interface testing with XCTestWrap up
How to install an ad blocker in Safari for iOS
How to use @dynamicCallable in Swift
How to use Dynamic Member Lookup in Swift
I screwed up one key accessibility behavior, and now I'm on a mission to do better
Key features in Swift
Learn essential Swift in one hour
Learn what's new in Swift 4.1 with a playground
Safari Content Blocking in iOS: a tutorial by example
Swift 4.1 improves Codable with keyDecodingStrategy
Swift Concurrency by Example
Swift Knowledge Base - free Swift example code
- How to enumerate items in an arrayHow to find an item in an array using firstIndex(of:)How to join an array of strings into a single stringHow to loop through an array in reverseHow to loop through items in an arrayHow to randomize the order of an array: shuffle() and shuffled()How to shuffle an array using arc4random_uniform()How to sort an array using sort()How to tell if an array contains an object
- How to add a border outline color to a UIViewHow to change a view’s anchor point without moving itHow to create a marching ants effect using lineDashPhaseHow to create keyframe animations using CAKeyframeAnimationHow to draw color gradients using CAGradientLayerHow to draw shapes using CAShapeLayerHow to emit particles using CAEmitterLayerHow to make a shape draw itself using strokeEndHow to make a UIView fade outHow to make a UIView glow using shadowColorHow to round only specific corners using maskedCornersHow to round the corners of a UIViewWhat is CALayer?
- How to calculate the distance between two CGPointsHow to calculate the Manhattan distance between two CGPointsHow to calculate the point where two lines intersectHow to compare two CGRects with equalTo()How to draw a circle using Core Graphics: addEllipse(in:)How to draw a square using Core Graphics: addRect()How to draw a text string using Core GraphicsHow to draw lines in Core Graphics: move(to:) and addLine(to:)How to find the rotation from a CGAffineTransformHow to find the scale from a CGAffineTransformHow to find the translation from a CGAffineTransformHow to render a PDF to an imageHow to use Core Graphics blend modes to draw a UIImage differently
- How to add a fragment shader to an SKSpriteNode using SKShaderHow to add physics to an SKSpriteNodeHow to add pixel-perfect physics to an SKSpriteNodeHow to advance time in an SKEmitterNode using advanceSimulationTime()How to change a sprite’s texture using SKTextureHow to change SKScene with a transition: presentScene()How to color an SKSpriteNode using colorBlendFactorHow to create 3D audio sound using SKAudioNodeHow to create a random terrain tile map using SKTileMapNode and GKPerlinNoiseSourceHow to create a SpriteKit texture atlas in XcodeHow to create shapes using SKShapeNodeHow to crop a sprite using SKCropNodeHow to debug physics in a SpriteKit scene using showsPhysicsHow to emit particles using SKEmitterNodeHow to find a touch's location in a node using location(in:)How to generate a random number with GKRandomSourceHow to generate fair random numbers using GKShuffledDistributionHow to generate shaped random numbers using GKGaussianDistributionHow to made an SKSpriteNode render faster using blendModeHow to make a sprite follow a pathHow to make one sprite draw in front of another using zPositionHow to roll a dice using GameplayKit and GKRandomDistributionHow to run SKActions in a groupHow to run SKActions in a sequenceHow to simulate gravity in a SpriteKit sceneHow to stop an SKPhysicsBody responding to physics using its dynamic propertyHow to warp a sprite using SKWarpGeometryGridHow to write text using SKLabelNode
- Check whether all items in an array match a conditionChecking all array elements match a condition: allSatisfy()Fixing ”Ambiguous reference to member when using ceil or round”Fixing ”Class ViewController has no initializers”How to add a custom initializer to a struct without losing its memberwise initializerHow to add associated values to enumsHow to add Markdown comments to your codeHow to add raw values to enumsHow to add warnings and errors to your code using #warning and #errorHow to append one array to another arrayHow to break out of multiple loop levels using labeled statementsHow to calculate division remainder using moduloHow to check for valid method input using the guard keywordHow to check the Swift version at compile timeHow to check whether a date is inside a date rangeHow to check whether a module is available using canImport()How to check whether an integer lies inside a rangeHow to check your program state using precondition()How to compare datesHow to compare two tuples for equalityHow to conform to the Comparable protocolHow to conform to the Equatable protocolHow to conform to the Hashable protocolHow to constrain a protocol associated typeHow to convert a float to a CGFloatHow to convert a float to an intHow to convert a multidimensional array to a single-dimensional arrayHow to convert a string to a doubleHow to convert a string to a floatHow to convert a string to a IntHow to convert a string to a NSStringHow to convert a String to DataHow to convert a Substring to a StringHow to convert an int to a floatHow to convert an Int to a StringHow to convert an NSRange to a Swift string indexHow to convert Data to a StringHow to convert degrees to radiansHow to convert JSON into Swift objects using CodableHow to convert radians to degreesHow to count element frequencies in an arrayHow to count matching items in an arrayHow to create a custom debug descriptionHow to create a custom debug descriptionHow to create a custom OptionSetHow to create an Objective-C bridging header to use code in SwiftHow to create hash values from objects using HasherHow to create multi-line string literalsHow to create Quick Look debug previews for your custom typesHow to delay execution of code using the defer keywordHow to detect when the system is under pressure and you should reduce your workHow to filter a loop using a where clauseHow to find the difference between two arraysHow to find the first matching element in an arrayHow to find the highest value in an arrayHow to find the index of the first matching array elementHow to find the longest initial sequence in an arrayHow to find the maximum of three numbersHow to find the maximum of two numbersHow to find the minimum of three numbersHow to find the minimum of two numbersHow to fix “argument of #selector refers to instance method that is not exposed to Objective-C”How to fix the error “Expression was too complex to be solved in reasonable time”How to fix the error “protocol can only be used as a generic constraint because it has Self or associated type requirements”How to force a crash using fatalError()How to force your program to crash with assert()How to format JSON using Codable and pretty printingHow to generate a random numberHow to get a random element from an array using randomElement()How to group arrays using dictionariesHow to handle unknown properties and methods using @dynamicMemberLookupHow to ignore return values using @discardableResultHow to install a beta version of SwiftHow to list all cases in an enum using CaseIterableHow to loop over non-nil items in an arrayHow to make a custom sequenceHow to make a number positive using abs()How to make a variadic functionHow to make array access safer using a custom subscriptHow to make custom types from strings using ExpressibleByStringLiteralHow to make optional protocol methodsHow to multiply an int and a doubleHow to pass the Fizz Buzz testHow to print debug text in SwiftHow to remove duplicate items from an arrayHow to remove items from an array using filter()How to remove the first or last item from an arrayHow to restrict a protocol to classesHow to reverse sort an arrayHow to run code when an object is destroyedHow to safely use reference types inside value types with isKnownUniquelyReferenced()How to sort the keys of your JSON using CodableHow to specify default values for dictionary keysHow to specify your own date format with Codable and JSONEncoderHow to split an array into chunksHow to split an integer into an array of its digitsHow to store NSCoding data using CodableHow to sum an array of numbers using reduce()How to swap two items in an array using swapAt()How to throw errors using stringsHow to toggle a boolean valueHow to transform a dictionary using mapValues()How to unwrap an optional in SwiftHow to use @available to deprecate old APIsHow to use #available to check for API availabilityHow to use Codable to load and save custom data typesHow to use compactMap() to transform an arrayHow to use compiler directives to detect the iOS SimulatorHow to use conditional conformance in SwiftHow to use flatMap() with an optional valueHow to use ISO-8601 dates with JSONDecoder and CodableHow to use local variable observersHow to use map() to transform an arrayHow to use map() with an optional valueHow to use one-sided rangesHow to use operator overloadingHow to use reduce() to condense an array into a single valueHow to use reflection to inspect type dataHow to use the forEach method to loop over an arrayHow to use the rethrows keywordHow to use the zip() function to join two arraysHow to use try/catch in Swift to handle exceptionsHow to use typealias to make it easier to use complex typesHow to write a closure that returns a valueOptional vs implicitly unwrapped optional: what’s the difference?Private vs fileprivate: what’s the difference?Remove all instances of an object from an arrayRemoving matching elements from a collection: removeAll(where:)Self vs self - what's the difference?Tips for Android developers switching to SwiftUsing stride() to loop over a range of numbersWhat are class and subtype existentials?What are convenience initializers?What are designated initializers?What are generics?What are implicitly unwrapped optionals?What are indirect enums?What are inout parameters?What are keypaths?What are KeyValuePairs?What are lazy variables?What are property observers?What are protocol extensions?What are sets?What are static methods and variables?What are the changes in Swift 1.2?What are the changes in Swift 2.0?What are the changes in Swift 2.2?What are the changes in Swift 3?What does an exclamation mark mean?What does override mean?What does the AppDelegate class do?What does the open keyword do?What does unowned mean?What does weak mean?What is a CGFloat?What is a closure?What is a computed property?What is a delegate in iOS?What is a dictionary?What is a double?What is a float?What is a functor?What is a lazy sequence?What is a monad?What is a nested class or nested struct?What is a nib?What is a protocol associated type?What is a protocol?What is a selector?What is a singleton?What is a storyboard?What is a throwing function?What is a tuple?What is an enum?What is an escaping closure?What is an optional value in Swift?What is AnyObject?What is Automatic Reference Counting (ARC)?What is class inheritance?What is copy on write?What is destructuring?What is function composition?What is key-value observing?What is MVC?What is MVVM?What is NSNumber?What is optional chaining?What is protocol-oriented programming?What is the @objc attribute?What is the @objcMembers attribute?What is the autoclosure attribute?What is the Never return type?What is the nil coalescing operator?What is the Result type?What is the ternary operator?What is trailing closure syntax?What is typecasting?What is whole module optimization?What’s the difference between == and ===?What’s the difference between a class and a struct?What’s the difference between a function and a closure?What’s the difference between a function and a method?What’s the difference between a protocol and a class?What’s the difference between a static variable and a class variable?What’s the difference between Any and AnyObject?What’s the difference between init?() and init()?What's the difference between let and var?When is it safe to force unwrap optionals?When to use a set rather than an arrayWhy is immutability important?
- How to convert speech to text using SFSpeechRecognizerHow to display PDFs using PDFViewHow to extract text from a PDF using PDFKitHow to get a Cover Flow effect on iOSHow to make empty UITableViews look more attractive using DZNEmptyDataSetHow to parse JSON using SwiftyJSONHow to preview files using Quick Look and QLPreviewControllerHow to scan NFC tags using Core NFCHow to search your app’s Spotlight indexHow to show PDF thumbnails using PDFThumbnailViewHow to watermark PDFs inside a PDFViewWhat is CloudKit?
- Adding places to MKMapView using MKPlacemarkHow to add a button to an MKMapView annotationHow to add an MKMapView using MapKitHow to add annotations to MKMapView using MKPointAnnotation and MKPinAnnotationViewHow to detect iBeaconsHow to find directions using MKMapView and MKDirections.RequestHow to look up a location with MKLocalSearch.RequestHow to make an iPhone transmit an iBeaconHow to read the user’s location while your app is in the backgroundHow to request a user's location only once using requestLocation
- CIDetectorTypeFace: How to detect faces in a UIImageHow to choose a photo from the camera roll using UIImagePickerControllerHow to control the pitch and speed of audio using AVAudioEngineHow to convert text to speech using AVSpeechSynthesizer, AVSpeechUtterance and AVSpeechSynthesisVoiceHow to create a barcodeHow to create a PDF417 barcodeHow to create a QR codeHow to desaturate an image to make it black and whiteHow to filter images using Core Image and CIFilterHow to highlight text to speech words being read using AVSpeechSynthesizerHow to loop audio using AVAudioPlayer and numberOfLoopsHow to make resizable images using resizableImage(withCapInsets:)How to pixellate a UIImageHow to play sounds using AVAudioPlayerHow to play videos using AVPlayerViewControllerHow to read the average color of a UIImage using CIAreaAverageHow to record audio using AVAudioRecorderHow to record user videos using ReplayKitHow to render a UIView to a UIImageHow to save a UIImage to a file using jpegData() and pngData()How to scan a barcodeHow to scan a QR codeHow to turn on the camera flashlight to make a torchUIImageWriteToSavedPhotosAlbum(): how to write to the iOS photo album
- How to check for internet connectivity using NWPathMonitorHow to create a peer-to-peer network using the multipeer connectivity frameworkHow to download files with URLSession and downloadTask()How to make a network request wait for an internet connection using waitsForConnectivityHow to support low data mode networking using allowsConstrainedNetworkAccess
- How do you make raw strings in Swift?How to calculate the ROT13 of a stringHow to capitalize the first letter of a stringHow to capitalize words in a string using capitalizedHow to check whether a string contains any words from an arrayHow to concatenate strings to make one joined stringHow to convert a string to a safe format for URL slugs and filenamesHow to convert a string to lowercase lettersHow to convert a string to uppercase lettersHow to detect a URL in a String using NSDataDetectorHow to display different strings based on available space using variantFittingPresentationWidth()How to get the length of a stringHow to get the lines in a string as an arrayHow to load a string from a file in your bundleHow to load a string from a website URLHow to loop through letters in a stringHow to measure a string for Objective-C codeHow to parse a sentence using NSLinguisticTaggerHow to read a single character from a stringHow to remove a prefix from a stringHow to repeat a stringHow to reverse a string using reversed()How to run a case-insensitive search for one string inside anotherHow to save a string to a file on disk with write(to:)How to specify floating-point precision in a stringHow to split a string into an array: components(separatedBy:)How to test localization by setting a debug locale and double length pseudolanguageHow to trim whitespace in a stringHow to use string interpolation to combine strings, integers and doublesNSRegularExpression: How to match regular expressions in stringsReplacing text in a string using replacingOccurrences(of:)
- How do you read from the command line?How to cache data using NSCacheHow to cancel a delayed perform() callHow to check whether one date is similar to anotherHow to check whether your other apps are installedHow to compress and decompress dataHow to convert between camel case and snake case with Codable and keyEncodingStrategyHow to convert dates and times to a string using DateFormatterHow to convert HTML to an NSAttributedStringHow to convert units using Unit and MeasurementHow to copy objects in Swift using copy()How to copy text to the clipboard using UIPasteboardHow to create rich formatted text strings using NSAttributedStringHow to decode JSON from your app bundle the easy wayHow to detect low power mode is enabledHow to detect the dominant language of a text stringHow to detect when your app moves to the backgroundHow to detect which country a user is inHow to find the path to a file in your bundleHow to find the user's documents directoryHow to format dates with an ordinal suffix using NumberFormatter's ordinalStyleHow to generate a random identifier using UUIDHow to group user notifications using threadIdentifier and summaryArgumentHow to handle the HTTPS requirements in iOS with App Transport SecurityHow to identify an iOS device uniquely with identifierForVendorHow to insert images into an attributed string with NSTextAttachmentHow to join an array of strings in a natural wayHow to load and save a struct in UserDefaults using CodableHow to make an action repeat using TimerHow to make one operation wait for another to complete using addDependency()How to make tappable links in NSAttributedStringHow to make the device vibrateHow to make your app open with a custom URL schemeHow to open a URL in SafariHow to parse JSON using JSONSerializationHow to pass data between two view controllersHow to post messages using NotificationCenterHow to read names in a string using NSLinguisticTaggerHow to read the contents of a directory using FileManagerHow to read your app’s version from your Info.plist fileHow to run an external program using ProcessHow to run code after a delay using asyncAfter() and perform()How to run code asynchronously using GCD async()How to run code at a specific timeHow to run code on the main thread using GCD async()How to run code when your app is terminatedHow to save and load objects with NSKeyedArchiver and NSKeyedUnarchiverHow to save user settings using UserDefaultsHow to send notifications asynchronously using NotificationQueueHow to set local alerts using UNNotificationCenterHow to show a relative date and time using RelativeDateTimeFormatterHow to show the price of an SKProductHow to spell out numbers using NumberFormatter's spellOut styleHow to stop the screen from going to sleepHow to store UserDefaults options in iCloudHow to synchronize code to drawing using CADisplayLinkHow to use Core Motion to read accelerometer dataHow to use Core Spotlight to index content in your appHow to use multithreaded operations with OperationQueueHow to use Touch ID to authenticate users by fingerprintMeasuring execution speed using CFAbsoluteTimeGetCurrent()NSTextEffectLetterpressStyle: How to add a letterpress effect to textWhat is the first responder?
- How to check and unwrap optionals in tests using XCTUnwrap()How to check for internet connectivity using NWPathMonitorHow to do conditional test tear down using addTeardownBlock()How to do one-time setup for your testsHow to set baselines for your performance testsHow to test asynchronous functions using expectation()How to test throwing functionsHow to write performance tests using measure()
- How to convert a hex color to a UIColorHow to convert a HTML name string into a UIColorHow to create custom colors using UIColor RGB and huesHow to read the red, green, blue, and alpha color components from a UIColorHow to use an image for your background color with UIColor(patternImage:)How to use semantic colors to help your iOS app adapt to dark mode
- Changing which UITabBarController tabs can be editedFixing ”Failed to obtain a cell from its DataSource”Fixing ”Unable to dequeue a cell with identifier”How do you show a modal view controller when a UITabBarController tab is tapped?How set different widths for a UISegmentedControl's elementsHow to activate multiple Auto Layout constraints using activate()How to add a badge to your UITabBarItemHow to add a bar button to a navigation barHow to add a button to a navigation bar using storyboardsHow to add a button to a UITableViewCellHow to add a custom view to a UIBarButtonItemHow to add a flexible space to a UIBarButtonItemHow to add a number over your app icon using applicationIconBadgeNumberHow to add a section header to a table viewHow to add a shadow to a UIViewHow to add a toolbar above the keyboard using inputAccessoryViewHow to add a UIApplicationShortcutItem quick action for 3D TouchHow to add a UITextField to a UIAlertControllerHow to add blur and vibrancy using UIVisualEffectViewHow to add custom spacing to UIStackView itemsHow to add drag and drop to your appHow to add multiple UIBarButtonItem to a navigation bar using rightBarButtonItemsHow to add peek and pop to a UITableViewHow to add Retina and Retina HD graphics to your projectHow to add scopes to a UISearchControllerHow to adjust a UIScrollView to fit the keyboardHow to adjust image content mode using aspect fill, aspect fit and scalingHow to animate a blur effect using UIVisualEffectViewHow to animate views using animate(withDuration:)How to animate views using UIViewPropertyAnimatorHow to animate views with spring damping using animate(withDuration:)How to animate when your size class changes: willTransition(to:)How to ask users to review your app using SKStoreReviewControllerHow to bring a subview to the front of a UIViewHow to center a view in its containerHow to change the scroll indicator inset for a UIScrollViewHow to change your app icon dynamically with setAlternateIconName()How to check a string is spelled correctly using UITextCheckerHow to check whether an iPhone or iPad is upside down or face upHow to check whether users have enabled the reduced motion settingHow to control a UIProgressView’s animationHow to control which screen edges trigger system gestures using preferredScreenEdgesDeferringSystemGesturesHow to convert a CGPoint in one UIView to another view using convert()How to create a page curl effect using UIPageViewControllerHow to create a parallax effect in UIKitHow to create Auto Layout constraints in code: constraints(withVisualFormat:)How to create custom menus using UIMenuControllerHow to create custom text input using UIKeyInputHow to create keyframe animations using animateKeyframes()How to create live playgrounds in XcodeHow to create popover menus using UIPopoverPresentationControllerHow to customize a view controller’s back button on a navigation bar: backBarButtonItemHow to customize swipe edit buttons in a UITableViewHow to deselect a UITableViewCell using clearsSelectionOnViewWillAppearHow to detect a double tap gestureHow to detect dark mode in iOSHow to detect edge swipesHow to detect keyboard input using pressesBegan() and pressesEnded()How to detect long presses using UILongPressGestureRecognizerHow to detect when the Back button is tappedHow to detect when the user takes a screenshotHow to detect when your size class changesHow to dim the screenHow to disable interactive swipe to dismiss for view controllersHow to disable undo, redo, copy, and paste gestures using editingInteractionConfigurationHow to draw custom views in Interface Builder using IBDesignableHow to draw shapes using UIBezierPathHow to enable large titles in your navigation barHow to find a touch's location in a view with location(in:)How to find a UIView subview using viewWithTag()How to find an aspect fit image’s size inside an image viewHow to find the view controller responsible for a viewHow to fix Auto Layout problemsHow to fix the error “Failed to instantiate the default view controller for UIMainStoryboardFile”How to flip a UIView with a 3D effect: transition(with:)How to force a UIView to redraw: setNeedsDisplay()How to force a view controller to use light or dark modeHow to generate haptic feedback with UIFeedbackGeneratorHow to give a UINavigationBar a background image: setBackgroundImage()How to give a UIStackView a background colorHow to give UITableViewCells a selected color other than grayHow to hide passwords in a UITextFieldHow to hide the home indicator on iPhone XHow to hide the navigation bar using hidesBarsOnSwipeHow to hide the navigation bar using hidesBarsOnTapHow to hide the status barHow to hide the tab bar when a view controller is shownHow to hide your navigation bar when the keyboard shows: hidesBarsWhenKeyboardAppearsHow to identify your Auto Layout constraintsHow to let users choose a font with UIFontPickerViewControllerHow to let users tap on a UITableViewCell while editing is enabledHow to limit the number of characters in a UITextField or UITextViewHow to load a HTML string into a WKWebView or UIWebView: loadHTMLString()How to load a remote image URL into UIImageViewHow to localize your iOS appHow to lock a view controller’s orientation using supportedInterfaceOrientationsHow to make a background image run under the safe areaHow to make a button glow when tapped with showsTouchWhenHighlightedHow to make a clear button appear in a textfieldHow to make a UIView fill the screen using Auto Layout anchorsHow to make gesture recognizers work together using require(toFail:)How to make the master pane always visible in a UISplitViewControllerHow to make UICollectionView headers stay fixed using sectionHeadersPinToVisibleBoundsHow to make UITableViewCell separators go edge to edgeHow to make UITableViewCells auto resize to their contentHow to make UIViewPropertyAnimator scrub with a custom curve: scrubsLinearlyHow to make your user interface in codeHow to mask one UIView using another UIViewHow to measure touch strength using 3D TouchHow to move to the next UITextField when the user presses returnHow to pad a UITextView by setting its text container insetHow to perform a segue programmatically using performSegue()How to position a view using Auto Layout anchorsHow to print using UIActivityViewControllerHow to put a background picture behind UITableViewControllerHow to read a title from a UIPickerView using titleForRowHow to read the battery level of an iPhone or iPadHow to read the interface orientation: portrait or landscape?How to recolor UIImages using template images and withRenderingMode()How to register a cell for UICollectionView reuseHow to register a cell for UITableViewCell reuseHow to reload a UITableView while preserving selectionsHow to remove a UIView from its superview with removeFromSuperview()How to remove cells from a UITableViewHow to render an NSAttributedString to a PDFHow to render PDFs using UIGraphicsPDFRendererHow to render shadows using NSShadow and setShadow()How to resize a custom font using UIFontMetricsHow to respond to the device being shakenHow to run JavaScript on a UIWebView with stringByEvaluatingJavaScript(from:)How to scale, stretch, move, and rotate UIViews using CGAffineTransformHow to send an emailHow to set a custom title view in a UINavigationBarHow to set prompt text in a navigation barHow to set the tabs in a UITabBarControllerHow to set the tint color of a UIViewHow to share content with the Social framework and SLComposeViewControllerHow to share content with UIActivityViewControllerHow to show and hide a toolbar inside a UINavigationControllerHow to stop Auto Layout and autoresizing masks conflicting: translatesAutoresizingMaskIntoConstraintsHow to stop empty row separators appearing in UITableViewHow to stop users selecting text in a UIWebView or WKWebViewHow to stop your UISearchController bar hiding when you scrollHow to stop your view going under the navigation bar using edgesForExtendedLayoutHow to style the font in a UINavigationBar's titleHow to subclass UIApplication using UIApplicationMainHow to support pinch to zoom in a UIScrollViewHow to support right-to-left languagesHow to swipe to delete UITableViewCellsHow to take a photo using the camera and UIImagePickerControllerHow to use dependency injection with storyboardsHow to use Dynamic Type to resize your app's textHow to use IBInspectable to adjust values in Interface BuilderHow to use light text color in the status barHow to use SFSafariViewController to show web pages in your appHow to use system icons in your appHow to use UIActivityIndicatorView to show a spinner when work is happeningHow to use UIKeyCommand to add keyboard shortcutsHow to use UIPickerViewHow to use UISearchController to let users enter search wordsHow to use UIStepper to let users change number valuesHow to use view controller containmentShowing dictionary definitions using UIReferenceLibraryViewControllerWhat are size classes?What are the different UIStackView distribution types?What does the message ”Simulator user has requested new graphics quality: 100” mean?What is a segue?What is a UIViewControllerWhat is a view’s intrinsic content size?What is an IndexPath?What is content compression resistance?What is the safe area layout guide?What is the UIAppearance proxy?What’s the difference between frame and bounds?What’s the difference between leading, trailing, left, and right anchors?Why can I not register for push notifications?
- How to control the sites a WKWebView can visit using WKNavigationDelegateHow to control the user interface of a WKWebView using WKUIDelegateHow to enable back and forward swiping gestures in WKWebViewHow to load HTTP content in WKWebView and UIWebViewHow to monitor WKWebView page load progress using key-value observingHow to run JavaScript on a WKWebView with evaluateJavaScriptWhat's the difference between UIWebView and WKWebView
- How to add conditions to a breakpointHow to add markers to the jump barHow to create a project using Swift Package ManagerHow to create exception breakpoints in XcodeHow to debug view layouts in XcodeHow to fix the error “View controller is unreachable because it has no entry points and no identifier for runtime access”How to load assets from Xcode asset catalogsHow to lock Interface Builder controls to stop accidental changesHow to make Xcode play sounds while debuggingHow to render example content using prepareForInterfaceBuilder()How to repeat code when debugging using the instruction pointerHow to set the clock in the iOS SimulatorHow to use storyboard references to simplify your storyboardsHow to use vector images in your asset catalogHow to used a named UIColor in code and Interface BuilderWhat are breakpoints?What are Swift error breakpoints?What are watchpoints?What is an IBOutlet?
SwiftData by Example
SwiftUI by Example
The defer keyword in Swift: try/finally done right
The guard keyword in Swift: early returns made easy
What's new in iOS 10 for developers
What's new in iOS 11 for developers
What's new in iOS 9 for developers
What's new in Swift 2.0
What's new in Swift 2.2
What's new in Swift 3.0
What's new in Swift 3.1
What's new in Swift 4.0
What's new in Swift 4.1
What's new in Swift 4.2
What's new in Swift 5.0
What's new in Swift 5.1
What's new in Swift 6.0?
What's new in Swift?
- A new Set data structureClasses can now have static methods and propertiesClosures can now be marked @noescapeConstants no longer require immediate initializationImplicit bridging has been reducedMultiple if let bindingsThe flatMap() method transforms optionals and arraysThe zip() function joins two sequencesTypecasting now includes as!
- ++ and -- are deprecatedComparing tuplesCompile-time Swift version checkingMore keywords can be used as argument labelsRenamed debug identifiers: line, function, fileStringified selectors are deprecatedTraditional C-style for loops are deprecatedTuple splat syntax is deprecatedTupleVariable parameters have been deprecated
- A new Float16 typeEnum cases as protocol witnessesMulti-pattern catch clausesMultiple trailing closuresRefined didSet semanticsself is no longer required in many placesSwift Package Manager gains binary dependencies, resources, and moreSynthesized Comparable conformance for enumsType-based program entry pointswhere clauses on contextually generic declarations
- ActorsAsync awaitasync let bindingsAsync sequencesCodable synthesis for enums with associated valuesContinuations for interfacing async tasks with synchronous codeEffectful read-only propertiesExtending property wrappers to function and closure parametersExtending static member lookup in generic contextsGlobal actorsif for postfix member expressionsInterchangeable use of CGFloat and Double typeslazy now works in local contextsSendable and @Sendable closuresStructured concurrency
- Add sleep(for:) to ClockbuildPartialBlock for result buildersConcurrency in top-level codeConstrained existential typesDistributed actor isolationif let shorthand for unwrapping optionalsImplicitly opened existentialsLightweight same-type requirements for primary associated typesMulti-statement closure type inferenceOpaque parameter declarationsRegular expressionsStructural opaque result typesType inference from default expressionsUnavailable from async attributeUnlock existentials for all protocols
What’s new in SwiftUI for iOS 18