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 UIKit | |
final class HomeScene: UIViewController { | |
var collectionView: UICollectionView! | |
var dataSource: UICollectionViewDiffableDataSource<HomePresentation, HomeSection>? | |
var vm: HomeVMProtocol! { | |
didSet { | |
vm.delegate = self |
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
@IBAction func billTextFieldAction(_ sender: Any) { | |
let tip = Double(tipTextField.text ?? "") ?? 0 | |
let bill = Double(billTextField.text ?? "") ?? 0 | |
calculateTip(tipAmount: tip, billAmount: bill) | |
} |
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
exports.sendMail = functions.database.ref('/Reports/{uid}').onCreate((snapshot, context) => { | |
const val = snapshot.val(); | |
// getting dest email by query string | |
const mailOptions = { | |
from: 'Sample Report <[email protected]>', // You can write any mail Adress you want this doesn't effect anything | |
to: '[email protected]', // This mail adress should be filled with any mail you want to read it | |
tile: val.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
admin.initializeApp(); | |
let transporter = nodemailer.createTransport({ | |
service: 'gmail', | |
auth: { | |
user: 'yourGmailAdress', | |
pass: 'yourGmailPassword' | |
} | |
}); |
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
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
const nodemailer = require('nodemailer'); | |
const cors = require('cors')({ origin: true }); |
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
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
const nodemailer = require('nodemailer'); | |
const cors = require('cors')({ origin: true }); |
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
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
const nodemailer = require('nodemailer'); | |
const cors = require('cors')({ origin: true }); |
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
npm install -g firebase-tools |
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
tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellId) |
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
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
// Override point for customization after application launch. | |
window = UIWindow() | |
window?.makeKeyAndVisible() | |
let rootControoler = ViewController() | |
window?.rootViewController = rootControoler | |
return true | |
} |
NewerOlder