Skip to content

Instantly share code, notes, and snippets.

View pmatanyc's full-sized avatar

Paola Mata Herbert pmatanyc

View GitHub Profile
- (void)setupNavBar {
self.dismissButton = [UIButton buttonWithType:UIButtonTypeSystem];
UIImage *dismissButtonImage = [UIImage imageNamed:@"close-large"];
[self.dismissButton setImage:dismissButtonImage forState:UIControlStateNormal];
self.dismissButton.tintColor = [UIColor cookingBlack];
[self.dismissButton mas_remakeConstraints:^(MASConstraintMaker *make) {
make.height.equalTo(@44);
make.width.equalTo(@44);
}];
[self.dismissButton addTarget:self action:@selector(dismissButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
@pmatanyc
pmatanyc / StickyHeaderScrollToSection
Created October 22, 2018 14:06
Scrolling to a section with a sticky header in UICollectionView
func scrollToSection(_ section: Int) {
if let collectionView = collectionView {
let indexPath = IndexPath(item: 0, section: section)
if
let attributes = collectionView.layoutAttributesForItem(at: indexPath),
let flowLayout = collectionView.collectionViewLayout as? FlowLayout
{
let headerHeight = flowLayout.headerReferenceSize
let topSectionInset = flowLayout.sectionInset.top
@pmatanyc
pmatanyc / PMMainViewController.h
Created December 14, 2013 22:22
Day of Week App - displays day of week for user specified date (UIDatePicker)
// PMMainViewController.h
// SampleProject
//
// Created by Paola Mata on 12/6/13.
//
//
#import <UIKit/UIKit.h>
@interface PMMainViewController : UIViewController