BhaveshDhaduk / Delegation-In-Swift

A project (Xcode 9) demonstrating delegates/delegation in iOS with Swift 4. I use delegation to get notified and do whatever I want when a file has finished downloading.

Home Page:http://iosbrain.com/blog/2018/02/05/tutorial-delegates-and-delegation-in-swift-4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delegation-In-Swift

This is a project (Xcode 9) demonstrating delegates/delegation in iOS with Swift 4. I use delegation to get notified and do whatever I want when a file has finished downloading.

Go to my article, Tutorial: delegates and delegation in Swift 4, and we'll discuss the following:

I'm going to talk about "delegates" and "delegation." I’ll lead you through a simple example of implementing the delegation design pattern in Swift 4, with full source code. My intent here is to show you how delegation works without getting bogged down in some crazy complex example. To help you become the best of the best, I'm going to introduce you to one of the greatest design tools to aid in object-oriented software development, UML. I'll show you a UML diagram that I drew up to design and document the implementation of the delegation design pattern used in the sample app we'll build together. Here’s the app we'll build:

alt text

Here's the UML diagram for the app's code:

alt text

alt text

Xcode 9 project settings

To get this project running on the Simulator or a physical device (iPhone, iPad), go to the following locations in Xcode and make the suggested changes:

  1. Project Navigator -> [Project Name] -> Targets List -> TARGETS -> [Target Name] -> General -> Signing
  • Tick the "Automatically manage signing" box
  • Select a valid name from the "Team" dropdown
  1. Project Navigator -> [Project Name] -> Targets List -> TARGETS -> [Target Name] -> General -> Identity
  • Change the "com.yourDomainNameHere" portion of the value in the "Bundle Identifier" text field to your real reverse domain name (i.e., "com.yourRealDomainName.Project-Name").

About

A project (Xcode 9) demonstrating delegates/delegation in iOS with Swift 4. I use delegation to get notified and do whatever I want when a file has finished downloading.

http://iosbrain.com/blog/2018/02/05/tutorial-delegates-and-delegation-in-swift-4

License:Other


Languages

Language:Swift 100.0%