Skip to content

Instantly share code, notes, and snippets.

View dilumdesilva's full-sized avatar
👨‍💻
Mastering iOS and Flutter

Dilum De Silva dilumdesilva

👨‍💻
Mastering iOS and Flutter
View GitHub Profile

Understanding UIViewController Rotation

Problem

To enable the rotation of a single view controller used to display the preview of Images/Videos. It is intuitive to allow user to rotate there device and screen changes accordingly, so it feels pleasant. But to achieve this, we need to enable the (almost) all Supported Device orientations.

Ex: `Portrait`, `LandscapeLeft`, `LandscapeRight`.
@dilumdesilva
dilumdesilva / CheckDeviceMotion.swift
Created November 23, 2022 03:37 — forked from garymansted/CheckDeviceMotion.swift
Check devices motions -> pitch, roll and yaw SWIFT
import CoreMotion // Import CoreMotion (header)
// Class vars
var pitch = 0.0
var attitude: CMAttitude?
var roll = 0.0
var yaw = 0.0
let motionManager = CMMotionManager() // Create motionManager instance
@dilumdesilva
dilumdesilva / CheckDeviceMotion.swift
Created November 23, 2022 03:37 — forked from garymansted/CheckDeviceMotion.swift
Check devices motions -> pitch, roll and yaw SWIFT
import CoreMotion // Import CoreMotion (header)
// Class vars
var pitch = 0.0
var attitude: CMAttitude?
var roll = 0.0
var yaw = 0.0
let motionManager = CMMotionManager() // Create motionManager instance
@dilumdesilva
dilumdesilva / HOWTODMG.md
Created February 22, 2022 05:43 — forked from jadeatucker/HOWTODMG.md
How to create a "DMG Installer" for Mac OS X

Creating a "DMG installer" for OS X

A DMG Installer is convenient way to provide end-users a simple way to install an application bundle. They are basically a folder with a shortcut to the Applications directory but they can be customized with icons, backgrounds, and layout properties. A DMG file (.dmg) is a Mac OS X Disk Image file and it is used to package files or folders providing compression, encryption, and read-only to the package.

##Creating the DMG file #Disk Utility

@dilumdesilva
dilumdesilva / Activate Office 2019 for macOS VoL.md
Created January 30, 2022 20:09 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref