import AVFoundation.AVMediaFormat
enum MediaFormat {
case MOV
case MP4
case M4V
var filenameExtension: String {
switch self {
case .MOV:
View AVCaptureDevice+FrameRate.swift
extension AVCaptureDevice { | |
/// http://stackoverflow.com/questions/21612191/set-a-custom-avframeraterange-for-an-avcapturesession#27566730 | |
func configureDesiredFrameRate(_ desiredFrameRate: Int) { | |
var isFPSSupported = false | |
do { | |
if let videoSupportedFrameRateRanges = activeFormat.videoSupportedFrameRateRanges as? [AVFrameRateRange] { |
View TransitionCompositionBuilder.swift
// | |
// TransitionComposition.swift | |
// MED | |
// | |
// Created by Limon on 7/26/16. | |
// Copyright © 2016 MED. All rights reserved. | |
// | |
import AVFoundation |
View CyanifyOperation.swift
// | |
// CyanifyOperation.swift | |
// MED | |
// | |
// Created by Limon on 2016/7/19. | |
// Copyright © 2016年 MED. All rights reserved. | |
// | |
import AVFoundation | |
import Dispatch |
View MergeAssets.swift
// | |
// Segment.swift | |
// MED | |
// | |
// Created by Limon on 6/28/16. | |
// Copyright © 2016 MED. All rights reserved. | |
// | |
import AVFoundation |
View movietransitions.swift
// | |
// main.swift | |
// mutablecomposition | |
// | |
// Created by Kevin Meaney on 24/08/2015. | |
// Copyright (c) 2015 Kevin Meaney. All rights reserved. | |
// | |
import Foundation |
View MediaFormat.md
View xcode-auto-version.sh
# Tips from: http://xcodehelp.blogspot.ie/2012/05/add-version-number-to-settings-screen.html | |
# Reference from: https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html | |
# Get the correct path for the git binary | |
git=`sh /etc/profile; which git` | |
# Save paths for the project and target Info.plist | |
projectPlistPath="${PROJECT_DIR}/${INFOPLIST_FILE}" | |
targetPlistPath="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |
View FCPrivateBatteryStatus.m
#import <Foundation/Foundation.h> | |
#include <dlfcn.h> | |
NSDictionary *FCPrivateBatteryStatus() | |
{ | |
static mach_port_t *s_kIOMasterPortDefault; | |
static kern_return_t (*s_IORegistryEntryCreateCFProperties)(mach_port_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, UInt32 options); | |
static mach_port_t (*s_IOServiceGetMatchingService)(mach_port_t masterPort, CFDictionaryRef matching CF_RELEASES_ARGUMENT); | |
static CFMutableDictionaryRef (*s_IOServiceMatching)(const char *name); |
View Matching Optional.md
假设服务器返回以上的JSON,客户端需要根据文章类型来作不同的布局。
enum Occupation: String {
case AppSo = "app"
case Number = "number"
}
let typeString = "mindStore"
switch Occupation(rawValue: typeString) {
View NSURL Parseer.md
extension NSURL {
var prt_URLItems: [String: String]? {
let components = NSURLComponents(URL: self, resolvingAgainstBaseURL: false)
guard let items = components?.queryItems else {
return nil
NewerOlder