This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| // MIT License | |
| // | |
| // Copyright (c) 2023 Lee Kah Seng | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
| func scaleTransform(for view: UIView, scaledBy scale: CGPoint, aroundAnchorPoint relativeAnchorPoint: CGPoint) -> CGAffineTransform { | |
| let bounds = view.bounds | |
| let anchorPoint = CGPoint(x: bounds.width * relativeAnchorPoint.x, y: bounds.height * relativeAnchorPoint.y) | |
| return CGAffineTransform.identity | |
| .translatedBy(x: anchorPoint.x, y: anchorPoint.y) | |
| .scaledBy(x: scale.x, y: scale.y) | |
| .translatedBy(x: -anchorPoint.x, y: -anchorPoint.y) | |
| } |
| // These window.navigator contain language information | |
| // 1. languages -> Array of preferred languages (eg ["en-US", "zh-CN", "ja-JP"]) Firefox^32, Chrome^32 | |
| // 2. language -> Preferred language as String (eg "en-US") Firefox^5, IE^11, Safari, | |
| // Chrome sends Browser UI language | |
| // 3. browserLanguage -> UI Language of IE | |
| // 4. userLanguage -> Language of Windows Regional Options | |
| // 5. systemLanguage -> UI Language of Windows | |
| var browserLanguagePropertyKeys = ['languages', 'language', 'browserLanguage', 'userLanguage', 'systemLanguage']; |