import UIKit
class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {
@IBOutlet weak var collectionView: UICollectionView!
override func viewDidLoad() {
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
| /* | |
| |-------------------------------------------------------------------------- | |
| | PurgeOldEmails | |
| |-------------------------------------------------------------------------- | |
| | https://gist.github.com/benbjurstrom/00cdfdb24e39c59c124e812d5effa39a | |
| | | |
| */ | |
| // Purge messages automatically after how many days? | |
| var DELETE_AFTER_DAYS = 7 |
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
| // | |
| // ScanerVC.swift | |
| // DokumenAsli | |
| // | |
| // Created by asharijuang on 3/18/18. | |
| // Copyright © 2018 kodejs. All rights reserved. | |
| // | |
| import UIKit | |
| import AVFoundation |
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
| - (void)viewDidLoad { | |
| [super viewDidLoad]; | |
| self.title = @"Literature"; | |
| if (searchText.length > 0) { | |
| [searchBar setShowsCancelButton:YES]; | |
| searchBar.text = searchText; | |
| [self searchLiteraturesWithName:searchText]; | |
| } | |
| [self.navigationController.navigationBar setTintColor:[UIColor primaryBarColor]]; |
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
| class AwesomeViewController: UICollectionViewController { | |
| func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize | |
| { | |
| let cellSpacing = CGFloat(1) //Define the space between each cell | |
| let leftRightMargin = CGFloat(0) //If defined in Interface Builder for "Section Insets" | |
| let numColumns = CGFloat(3) //The total number of columns you want | |
| let totalCellSpace = cellSpacing * (numColumns - 1) | |
| let screenWidth = UIScreen.mainScreen().bounds.width // Get the width of the screen. |
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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| import PlaygroundSupport | |
| var str = "Hello, playground" | |
| class MainViewController: UIViewController { | |
| let button: UIButton = { |
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
| // | |
| // RPMultipleImagePickerViewController.m | |
| // | |
| // Created by Renato Peterman on 17/08/14. | |
| // Copyright (c) 2014 Renato Peterman. All rights reserved. | |
| // | |
| #import "RPMultipleImagePickerViewController.h" | |
| @interface RPMultipleImagePickerViewController () |
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
| // | |
| // LibraryViewController.swift | |
| // WIMB | |
| // | |
| // Created by Gil Felot on 16/03/16. | |
| // Copyright © 2016 gfelot. All rights reserved. | |
| // | |
| import UIKit | |
| import Parse |
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 | |
| class EditingComponentsContainer: ComponentView { | |
| let collectionView: UICollectionView | |
| let layout = UICollectionViewFlowLayout() | |
| let components: [ComponentView] | |
| init(components: [ComponentView]) { |
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 addSubviewAndFill(subview: UIView, edgeInsets: UIEdgeInsets = UIEdgeInsets.zero) { | |
| self.addSubview(subview) | |
| subview.translatesAutoresizingMaskIntoConstraints = false | |
| self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|-(\(edgeInsets.left))-[view]-(\(edgeInsets.right))-|", metrics: nil, views: ["view": subview])) | |
| self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|-(\(edgeInsets.top))-[view]-(\(edgeInsets.bottom))-|", metrics: nil, views: ["view": subview])) | |
| } |
NewerOlder