This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct FormList: View { | |
| @State var isProfileExpanded = true | |
| var body: some View { | |
| Form { | |
| Section { | |
| DisclosureGroup(isExpanded: $isProfileExpanded) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension Item { | |
| static var stubs: [Item] { | |
| [ | |
| Item(title: "Computers", children: [ | |
| Item(title: "Desktops", children: [ | |
| Item(title: "iMac", children: nil), | |
| Item(title: "Mac Mini", children: nil), | |
| Item(title: "Mac Pro", children: nil) | |
| ]), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ItemsList: View { | |
| let items: [Item] | |
| var body: some View { | |
| List(items, children: \.children) { | |
| Text($0.title) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| service: alf-todoapi | |
| package: | |
| artifact: .build/lambda/TodoAPI/lambda.zip | |
| custom: | |
| todosTableName: todos-${self:provider.stage} | |
| provider: | |
| name: aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct TodoLamdaHandler: EventLoopLambdaHandler { | |
| //... | |
| // Main handler | |
| func handle(context: Lambda.Context, event: APIGateway.Request) -> EventLoopFuture<APIGateway.Response> { | |
| guard let handler = Handler.current else { | |
| return context.eventLoop.makeSucceededFuture(APIGateway.Response(with: APIError.requestError, statusCode: .badRequest)) | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import AWSLambdaEvents | |
| extension APIGateway.Request { | |
| private static let jsonDecoder: JSONDecoder = { | |
| let decoder = JSONDecoder() | |
| decoder.dateDecodingStrategy = .formatted(Utils.iso8601Formatter) | |
| return decoder | |
| }() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct TodoLamdaHandler: EventLoopLambdaHandler { | |
| //... | |
| init(context: Lambda.InitializationContext) throws { | |
| // HTTP Client Setup | |
| let timeout = HTTPClient.Configuration.Timeout( | |
| connect: .seconds(30), | |
| read: .seconds(30) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct TodoLamdaHandler: EventLoopLambdaHandler { | |
| //... | |
| init(context: Lambda.InitializationContext) throws { | |
| // HTTP Client Setup | |
| let timeout = HTTPClient.Configuration.Timeout( | |
| connect: .seconds(30), | |
| read: .seconds(30) | |
| ) |