Use `if let` statements for unwrapping of return statements

Description

+Possible pattern for generation of `guard` statements (see attached PentalPlayer.swift).

NOTE: the Swift version of initWithCoder() method does not return anything.

can be converted to:

Note: covered with ShouldUseIfLetStatementInInitializer() test, but without generation of `guard` statement.

Environment

None

Activity

Show:
Alex Petuschak
March 12, 2018, 3:17 PM
Edited

+See this sample (from Keegan):
http://swiftify.me/0xc2y0/1

line 15 is currently:

.. but could be:

Assignee

Alex Petuschak

Reporter

Alex Petuschak

Labels

None

Git Branch Name

None

GitHub Issue

None

Components

Fix versions

Priority

High
Configure