A class should have only one responsibility.
class ViewController: UIViewController {
func fetchDataFromServer() { //Perform network request code... }
func insertDataIntoDatabase() { //Perform database insertion code... }| lane :upload_testflight_on_pushing_tag do |options| | |
| # Tag: Release-1.0.0-100 (Release-Version-Build) | |
| tag_components = sh("git tag --sort=taggerdate | tail -1").split("-") | |
| version = tag_components[1] | |
| build = tag_components[2] | |
| # Increment version and build number | |
| increment_version_and_build_number(version: version, build: build) | |
| # Generate iPA |
| final class Brightness { | |
| // Config | |
| private let maxBrightness: CGFloat | |
| private(set) var defaultBrightness: CGFloat = 1.0 | |
| var isEnabled = true { | |
| didSet { | |
| if isEnabled { |
| /// Display ToolTip View | |
| /// | |
| /// Example: | |
| /// ```swift | |
| /// let paragraph = NSMutableParagraphStyle() | |
| /// paragraph.lineSpacing = 18 | |
| /// let attributes = [ | |
| /// NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16), | |
| /// NSAttributedString.Key.foregroundColor : UIColor.white, | |
| /// NSAttributedString.Key.paragraphStyle : paragraph |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
Add new custom schema to schema.graphql file
Create custom request/response mapping resolvers file in resolvers folder.
The file should look like this:
Mutation.putUser.req.vtlMutation.putUser.res.vtlUpdate CustomResources.json file in stack folder
| { | |
| "version" : "2017-02-28", | |
| "operation" : "PutItem", | |
| "key" : { | |
| "shopID": $util.dynamodb.toDynamoDBJson($ctx.args.shopID), | |
| "vendorID": $util.dynamodb.toDynamoDBJson($ctx.args.vendorID) | |
| }, | |
| "attributeValues": { | |
| "name": $util.dynamodb.toDynamoDBJson($ctx.args.name) | |
| }, |
| { | |
| "version" : "2017-02-28", | |
| "operation" : "Query", | |
| "query" : { | |
| "expression" : "author = :author", | |
| "expressionValues" : { | |
| ":author" : $util.dynamodb.toDynamoDBJson($ctx.args.author) | |
| } | |
| }, | |
| ## false -> DESC ORDER |
| { | |
| "version" : "2017-02-28", | |
| "operation" : "PutItem", | |
| "key" : { | |
| "shopID" : $util.dynamodb.toDynamoDBJson($ctx.args.shopID), | |
| "id": $util.dynamodb.toDynamoDBJson($ctx.args.id) | |
| }, | |
| "attributeValues" : { | |
| "staffName" : $util.dynamodb.toDynamoDBJson($ctx.args.staffName), | |
| "modifiedDate": $util.dynamodb.toDynamoDBJson($ctx.args.modifiedDate), |