This file contains 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 { | |
//Manually create the application window | |
window = UIWindow(frame: UIScreen.main.bounds) | |
//Custom theming on the application | |
UIApplication.shared.statusBarStyle = .lightContent | |
application.isStatusBarHidden = false | |
UINavigationBar.appearance().isTranslucent = false |
This file contains 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 UIKit | |
extension UIView { | |
public func addConstraintsWithFormat(_ format: String, views: UIView...) { | |
var viewsDictionary = [String: UIView]() | |
for (index, view) in views.enumerated() { | |
let key = "v\(index)" | |
viewsDictionary[key] = view |
This file contains 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 | |
class UserCell: UICollectionViewCell { | |
//Creating the ImageView, assigning it an image from the assets folder | |
let userImage: UIImageView = { | |
let iv = UIImageView() | |
iv.contentMode = .scaleAspectFit | |
iv.image = #imageLiteral(resourceName: "user") | |
iv.translatesAutoresizingMaskIntoConstraints = false | |
return iv |
This file contains 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
class TodayViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, NCWidgetProviding { | |
//Creating the collectionview and giving it some properties | |
let userCollectionView: UICollectionView = { | |
//The collectionView flow layout | |
let layout = UICollectionViewFlowLayout() | |
layout.minimumInteritemSpacing = 1.0 | |
let cv = UICollectionView(frame: .zero, collectionViewLayout: layout) | |
cv.translatesAutoresizingMaskIntoConstraints = false | |
cv.backgroundColor = .clear |