Skip to content

Instantly share code, notes, and snippets.

View bernardonigbinde's full-sized avatar

Bernard Onigbinde bernardonigbinde

View GitHub Profile
@bernardonigbinde
bernardonigbinde / cal.swift
Last active March 22, 2022 08:16 — forked from mchirico/cal.swift
Example of creating and removing calendar entries in Swift. Also, shows how to list reminders
/*
You need to import EventKit
import EventKit
*/
@IBAction func buttonCalendar(sender: AnyObject) {
var eventStore : EKEventStore = EKEventStore()
// 'EKEntityTypeReminder' or 'EKEntityTypeEvent'
@bernardonigbinde
bernardonigbinde / README.md
Created August 30, 2021 12:22 — forked from lopspower/README.md
What's difference between -nodpi and -anydpi?

Difference between -nodpi and -anydpi

Android Studio exposes developers to -nodpi and -anydpi in various places. For example, if you use the New Resource Directory wizard thing, and you choose to add a density qualifier to the directory, you will see "No Density" (-nodpi) and "Any Density" (-anydpi) options.

Some of you might expect these to be well-documented.

In a word, no.

However, courtesy of a fair amount of experimentation (largely done as part of work on this Stack Overflow question and this answer), their use becomes at least a bit clearer. Many thanks to Stack Overflow user rds for the help!

@bernardonigbinde
bernardonigbinde / UIView.swift
Created May 30, 2021 12:07
UIView extension - Auto Layout Helper
import UIKit
extension UIView {
func bottom(to view: UIView, offset: CGFloat = 0.0, usingSafeArea: Bool = false) {
constrain(bottomAnchor, to: usingSafeArea ? view.safeAreaLayoutGuide.bottomAnchor : view.bottomAnchor, of: view, offset: offset)
}
func topToBottom(of view: UIView, offset: CGFloat = 0.0, usingSafeArea: Bool = false) {
constrain(topAnchor, to: usingSafeArea ? view.safeAreaLayoutGuide.bottomAnchor : view.bottomAnchor, of: view, offset: offset)
}
@bernardonigbinde
bernardonigbinde / GradientLayer.md
Created March 16, 2021 20:51 — forked from hcn1519/GradientLayer.md
UITableViewCell with GradientLayer in swift

Create GradientLayer on your tableViewCell(collectionViewCell)

1. Create CAGradientLayer Instance on your tableViewCell

class MyCell: UITableViewCell {
    let gradientLayer = CAGradientLayer()
}