Swift getting started tutorial 12-optional links, swift getting started tutorial 12-

Source: Internet
Author: User

Swift getting started tutorial 12-optional links, swift getting started tutorial 12-

Optional chain

Original Blog, reprinted, please indicate the source
My blog address

Http://blog.csdn.net/hello_hwc
The optional chain provides an optional way to access the attributes, methods, and subscript scripts of an object. The returned values of the optional chain must be optional.
Advantage: Alternative force resolution (symbol !, For example, instance. location !. Y), because forced parsing of nil values will cause runtime errors
My experience: For a chain call, such as instance. Frame. Origin. x and so on, is it possible to add the nil part?

For example, if frame and Origin are nil, use instance. Frame ?. Origin ?. X

Feature of the optional link: if the optional value is nil in the middle, the entire optional link fails and nil is returned.

Let's give a simple example.

class A{var varA:B?}class B{var varB:C?var varBArray = [D]()subscript(index:Int)->D?{if(index < varBArray.count){return varBArray[index]}else{return nil}}}class C{var varC:String = "from C"func printC(){println(varC)}}class D{var varD1:Int = 10var varD2:E = E()} class E{func printE(){println("from E")}}var instance = A()

1. Call attributes through optional links
Note: Because the optional types are returned, it must be implicitly parsed using a sentence such as if let.
if let temp = instance.varA?.varB?.varC{println(temp)}

2. Call methods through optional links
instance.varA?.varB?.printC()


3. Use the optional link to call the subscript script
if let temp = instance.varA?[5]?.varD1{println(temp)}

This explains why this is used.

Instance. varA? [5] uses the optional link to access the subscript script, and returns D ?, Then return D? You can use the optional link to access the instance. varA? [5]?. VarD1

4. Long optional chain calls

instance.varA?[5]?.varD2.printE()


Help me explain the bank's SWIFT system

About SWIFT

SWIFT is the financial industry-owned co-operative supplying secure, standardised messaging services and interface software to 7,800 financial institutions in more than 200 countries. SWIFT's worldwide community includes des banks, broker/dealers and investment managers, as well as their market infrastructures in payments, securities, treasury and trade.
SWIFT consistently implements quantifiable business value and proven technical excellence to its members through its comprehensive messaging standards, the security, reliability and 'five nines' availability of its messaging platform and its role in advanced STP. the guiding principles of SWIFT are clear: to offer the financial services industry a common platform of advanced technology and access to shared solutions through which each member can build its competitive edge. over the past ten years SWIFT message prices have been blocked ced by over 70%, system availability approaches 5x9's reliability-99.999% of uptime.

I. SWIFT Introduction

SWIFT, also known as the World Interbank bank financial and Telecommunications Association, is an international cooperation organization between banks. Founded in 1973, SWIFT is currently used by most banks in most countries around the world. The use of SWIFT provides secure, reliable, fast, standardized, and automated communication services for bank settlement, thus greatly improving the settlement speed of banks. Because the SWIFT format is standardized, the current letter of credit format mainly uses SWIFT messages, so it is necessary to understand SWIFT.

Ii. SWIFT features

1. SWIFT requires membership. Most of China's professional banks are members of the company.

2. SWIFT charges are low. For the same amount of content, SWIFT only charges about 18% of TELEX (TELEX), and only about 2.5% of CABLE (telegram.

3. High Security of SWIFT. SWIFT is more reliable and confidential than telex, and has a high degree of automation.

4. The SWIFT format is standardized. SWIFT organizations have unified requirements and formats for SWIFT messages.

Iii. SWIFT message representation.

1. project Representation

SWIFT is composed of projects (fields), such as 59 BENEFICIARY (beneficiaries), which is a project. 59 is the full text of ......>

Complete SWIFT 3D tutorial

Search.verycd.com/..a83168b/

Swift 3D-Flash third-party software and video tutorial

Swift 3D-Flash third-party software and video tutorial Swift 3D-Flash third-party software and video tutorial Publisher: gogo Release Date: Latest Update Time: Chinese Name: third-party software and video tutorials of Swift 3D-Flash: the first link is Swift 3D v3
Materials → computer tutorials

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.