extension NSURL {
var prt_URLItems: [String: String]? {
let components = NSURLComponents(URL: self, resolvingAgainstBaseURL: false)
guard let items = components?.queryItems else {
return nil
假设服务器返回以上的JSON,客户端需要根据文章类型来作不同的布局。
enum Occupation: String {
case AppSo = "app"
case Number = "number"
}
let typeString = "mindStore"
switch Occupation(rawValue: typeString) {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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}" |
import AVFoundation.AVMediaFormat
enum MediaFormat {
case MOV
case MP4
case M4V
var filenameExtension: String {
switch self {
case .MOV:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Segment.swift | |
// MED | |
// | |
// Created by Limon on 6/28/16. | |
// Copyright © 2016 MED. All rights reserved. | |
// | |
import AVFoundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AVFoundation | |
public typealias AOIBaseType = AOIBaseProtocol | |
public protocol AOIBaseProtocol { | |
associatedtype T | |
var aoi: T { get } | |
static var aoi: T.Type { get } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Disables ATS in debug builds. | |
INFOPLIST="${TARGET_BUILD_DIR}"/"${INFOPLIST_PATH}" | |
case "${CONFIGURATION}" in | |
"Release"|"Adhoc") | |
/usr/libexec/PlistBuddy -c "Set :NSAppTransportSecurity:NSAllowsArbitraryLoads NO" "${INFOPLIST}" | |
;; | |
"Debug") | |
/usr/libexec/PlistBuddy -c "Set :NSAppTransportSecurity:NSAllowsArbitraryLoads YES" "${INFOPLIST}" | |
;; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -*- tab-width: 2; encoding: utf-8 -*- | |
## @file version_compare | |
## Compare [semantic] versions in Bash, comparable to PHP's version_compare function. | |
# ------------------------------------------------------------------ | |
## @author Mark Carver <mark.carver@me.com> | |
## @copyright MIT | |
## @version 1.0.0 | |
## @see http://php.net/manual/en/function.version-compare.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BGreen='\033[1;32m' | |
Default='\033[0;m' | |
podName="" | |
version="" | |
podspecFilePath="" | |
homepage="" | |
httpsRepo="" |
OlderNewer