Commit 5355ec41 authored by domenicw's avatar domenicw
Browse files

Added proper big button background, now animates again

parent 230780ef
......@@ -47,6 +47,7 @@
B07A8A0621523B96003CC2D8 /* InfoViewControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B07A8A0521523B96003CC2D8 /* InfoViewControllerDelegate.swift */; };
B07A8A0921524384003CC2D8 /* OnboardingNavigatorDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B07A8A0821524384003CC2D8 /* OnboardingNavigatorDelegate.swift */; };
B07A8A0B21524474003CC2D8 /* LoginModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B07A8A0A21524474003CC2D8 /* LoginModel.swift */; };
B0D3F92B21552E8E005209FF /* UIButton+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0D3F92A21552E8E005209FF /* UIButton+Extension.swift */; };
B0FE2EFC2154179600F3D073 /* JobsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FE2EFB2154179600F3D073 /* JobsViewController.swift */; };
B0FE2EFF21541A2B00F3D073 /* EventsNavigator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FE2EFE21541A2B00F3D073 /* EventsNavigator.swift */; };
B0FE2F0221541A6300F3D073 /* EventsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FE2F0121541A6300F3D073 /* EventsViewController.swift */; };
......@@ -120,6 +121,7 @@
B07A8A0521523B96003CC2D8 /* InfoViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoViewControllerDelegate.swift; sourceTree = "<group>"; };
B07A8A0821524384003CC2D8 /* OnboardingNavigatorDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingNavigatorDelegate.swift; sourceTree = "<group>"; };
B07A8A0A21524474003CC2D8 /* LoginModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginModel.swift; sourceTree = "<group>"; };
B0D3F92A21552E8E005209FF /* UIButton+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+Extension.swift"; sourceTree = "<group>"; };
B0FE2EFB2154179600F3D073 /* JobsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JobsViewController.swift; sourceTree = "<group>"; };
B0FE2EFE21541A2B00F3D073 /* EventsNavigator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventsNavigator.swift; sourceTree = "<group>"; };
B0FE2F0121541A6300F3D073 /* EventsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventsViewController.swift; sourceTree = "<group>"; };
......@@ -322,6 +324,7 @@
B050E15E2151735A0090CB79 /* UIColor+Extension.swift */,
B050E17E215195B50090CB79 /* UIFont+Extension.swift */,
B050E1932151A9750090CB79 /* Bundle+Extension.swift */,
B0D3F92A21552E8E005209FF /* UIButton+Extension.swift */,
);
path = Extension;
sourceTree = "<group>";
......@@ -659,6 +662,7 @@
B050E15621516D4D0090CB79 /* HomeViewController.swift in Sources */,
B050E1922151A61F0090CB79 /* SettingsSectionModel.swift in Sources */,
B050E15921516E230090CB79 /* EventModel.swift in Sources */,
B0D3F92B21552E8E005209FF /* UIButton+Extension.swift in Sources */,
B050E168215176D50090CB79 /* AmivApplicationActionDelegate.swift in Sources */,
B050E144215169950090CB79 /* Navigator.swift in Sources */,
B050E17A215180D20090CB79 /* AmivApplicationCell.swift in Sources */,
......
//
// UIButton+Extension.swift
// Amiv
//
// Created by Domenic Wüthrich on 21.09.18.
// Copyright © 2018 Amiv an der ETH. All rights reserved.
//
import Foundation
import UIKit
public extension UIButton {
public func setBackgroundColor(_ color: UIColor, for state: UIButton.State) {
UIGraphicsBeginImageContextWithOptions(CGSize(width: 1, height: 1), true, 0.0)
color.setFill()
UIRectFill(CGRect(x: 0, y: 0, width: 1, height: 1))
let image = UIGraphicsGetImageFromCurrentImageContext()
self.setBackgroundImage(image, for: state)
}
}
......@@ -164,9 +164,9 @@ public class GenericInfoViewController: UIViewController {
let button = UIButton()
button.setTitle(title, for: .normal)
button.setTitleColor(.white, for: .normal)
button.setTitleColor(.lightGray, for: .highlighted)
button.backgroundColor = .amivRed
button.setBackgroundColor(.amivRed, for: .normal)
button.layer.cornerRadius = 12
button.layer.masksToBounds = true
button.addTarget(self, action: #selector(self.buttonTapped), for: .touchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false
......
......@@ -114,9 +114,9 @@ public class LoginViewController: UIViewController {
let button = UIButton()
button.setTitle(title, for: .normal)
button.setTitleColor(.white, for: .normal)
button.setTitleColor(.lightGray, for: .highlighted)
button.backgroundColor = .amivRed
button.setBackgroundColor(.amivRed, for: .normal)
button.layer.cornerRadius = 12
button.layer.masksToBounds = true
button.addTarget(self, action: #selector(self.login), for: .touchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false
......
......@@ -106,9 +106,9 @@ public class InfoViewController: UIViewController {
let button = UIButton()
button.setTitle(title, for: .normal)
button.setTitleColor(.white, for: .normal)
button.setTitleColor(.lightGray, for: .highlighted)
button.backgroundColor = .amivRed
button.setBackgroundColor(.amivRed, for: .normal)
button.layer.cornerRadius = 12
button.layer.masksToBounds = true
button.addTarget(self, action: #selector(self.buttonAction), for: .touchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment