Skip to content

Commit

Permalink
Changes tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonni Lundy committed Mar 6, 2018
1 parent 6375149 commit 6ee8e83
Show file tree
Hide file tree
Showing 9 changed files with 718 additions and 718 deletions.
846 changes: 423 additions & 423 deletions Boilerplate-email.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions Boilerplate-email/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}
Expand Down
98 changes: 49 additions & 49 deletions Boilerplate-email/EmailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,55 @@ import WeDeploy

class EmailViewController: UIViewController {

@IBOutlet weak var toTextField: BorderLessTextField!
@IBOutlet weak var fromTextField: BorderLessTextField!
@IBOutlet weak var subjectTextField: BorderLessTextField!
override func viewDidLoad() {
super.viewDidLoad()
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleScreenTap))
view.addGestureRecognizer(tapGesture)
}
@IBAction func submitButtonClick() {
guard let to = toTextField.text,
let from = fromTextField.text,
let subject = subjectTextField.text else {
print("You have to fill all the fields")
return
}
let auth = TokenAuth(token: "073e93d6-7dcc-4df5-9a18-9dd121b92f50")
WeDeploy.email("https://email-boilerplateemail.wedeploy.io", authorization: auth)
.to(to)
.from(from)
.subject(subject)
.message(subject)
.send()
.toCallback { emailId, error in
if let emailId = emailId {
self.showAlert(with: "Success", message: "Email sent! Wait a little bit until it arrives :)")
print("Email id: \(emailId)")
}
else {
self.showAlert(with: "Error", message: "Error sending the email")
print(String(describing: error))
}
}
}
@objc func handleScreenTap() {
view.endEditing(true)
}
func showAlert(with title: String, message: String) {
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
let action = UIAlertAction(title: "Ok", style: .cancel, handler: nil)
alert.addAction(action)
present(alert, animated: true, completion: nil)
}
@IBOutlet weak var toTextField: BorderLessTextField!
@IBOutlet weak var fromTextField: BorderLessTextField!
@IBOutlet weak var subjectTextField: BorderLessTextField!
override func viewDidLoad() {
super.viewDidLoad()
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleScreenTap))
view.addGestureRecognizer(tapGesture)
}
@IBAction func submitButtonClick() {
guard let to = toTextField.text,
let from = fromTextField.text,
let subject = subjectTextField.text else {
print("You have to fill all the fields")
return
}
let auth = TokenAuth(token: "073e93d6-7dcc-4df5-9a18-9dd121b92f50")
WeDeploy.email("https://email-boilerplateemail.wedeploy.io", authorization: auth)
.to(to)
.from(from)
.subject(subject)
.message(subject)
.send()
.toCallback { emailId, error in
if let emailId = emailId {
self.showAlert(with: "Success", message: "Email sent! Wait a little bit until it arrives :)")
print("Email id: \(emailId)")
}
else {
self.showAlert(with: "Error", message: "Error sending the email")
print(String(describing: error))
}
}
}
@objc func handleScreenTap() {
view.endEditing(true)
}
func showAlert(with title: String, message: String) {
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
let action = UIAlertAction(title: "Ok", style: .cancel, handler: nil)
alert.addAction(action)
present(alert, animated: true, completion: nil)
}

}

90 changes: 45 additions & 45 deletions Boilerplate-email/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,50 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIAppFonts</key>
<array>
<string>loop_icons_16px.ttf</string>
<string>rene_bieder_galano_grotesque_bold.otf</string>
<string>rene_bieder_galano_grotesque_medium.otf</string>
<string>rene_bieder_galano_grotesque_semibold.otf</string>
<string>loop_icons_12px.ttf</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIAppFonts</key>
<array>
<string>loop_icons_16px.ttf</string>
<string>rene_bieder_galano_grotesque_bold.otf</string>
<string>rene_bieder_galano_grotesque_medium.otf</string>
<string>rene_bieder_galano_grotesque_semibold.otf</string>
<string>loop_icons_12px.ttf</string>
</array>
</dict>
</plist>
84 changes: 42 additions & 42 deletions Boilerplate-email/WeColorButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,47 @@ import UIKit

class WeColorButton: UIButton {

@IBInspectable open var darkButton: Bool = false
@IBInspectable open var textSize: Int = 16
@IBInspectable open var cornerRadius: Int = 4

override var isEnabled: Bool {
didSet {
alpha = isEnabled ? 1 : 0.6
}
}

override init(frame: CGRect) {
super.init(frame: frame)
initialize()
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}

override func awakeFromNib() {
super.awakeFromNib()

initialize()
}

func initialize() {

layer.cornerRadius = CGFloat(cornerRadius)
setTitleColor(.white, for: .disabled)
alpha = isEnabled ? 1 : 0.6

titleLabel?.font = UIFont.boldWeFont(ofSize: CGFloat(textSize))

if darkButton {
setTitleColor(.white, for: .normal)
backgroundColor = .mainColor
}
else {
setTitleColor(.mainColor, for: .normal)
backgroundColor = .white
}
}
@IBInspectable open var darkButton: Bool = false
@IBInspectable open var textSize: Int = 16
@IBInspectable open var cornerRadius: Int = 4

override var isEnabled: Bool {
didSet {
alpha = isEnabled ? 1 : 0.6
}
}

override init(frame: CGRect) {
super.init(frame: frame)
initialize()
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}

override func awakeFromNib() {
super.awakeFromNib()

initialize()
}

func initialize() {

layer.cornerRadius = CGFloat(cornerRadius)
setTitleColor(.white, for: .disabled)
alpha = isEnabled ? 1 : 0.6

titleLabel?.font = UIFont.boldWeFont(ofSize: CGFloat(textSize))

if darkButton {
setTitleColor(.white, for: .normal)
backgroundColor = .mainColor
}
else {
setTitleColor(.mainColor, for: .normal)
backgroundColor = .white
}
}

}
Loading

0 comments on commit 6ee8e83

Please sign in to comment.