swift swift中的“NSURL == String url”扩展名

swift中的“NSURL == String url”扩展名

isEquivalent.swift
extension NSURL {
	
	/**
	Check if the url:String is equivalent to NSURL
	:param: url to compare me
	:returns: true if is the same false otherwise
	*/
	func isEquivalent(url: String) -> Bool {
		
		if let myUrl = absoluteString {
			let urlComponents = url.componentsSeparatedByString("?")
			let myUrlComponents = myUrl.componentsSeparatedByString("?")
				return urlComponents.first == myUrlComponents.first
		}
		
		return true
	}
	
}

swift swift中的“NSURL == String url”扩展名

swift中的“NSURL == String url”扩展名

isEquivalent.swift
extension NSURL {
	
	/**
	Check if the url:String is equivalent to NSURL
	:param: url to compare me
	:returns: true if is the same false otherwise
	*/
	func isEquivalent(url: String) -> Bool {
		
		if let myUrl = absoluteString {
			let urlComponents = url.componentsSeparatedByString("?")
			let myUrlComponents = myUrl.componentsSeparatedByString("?")
				return urlComponents.first == myUrlComponents.first
		}
		
		return true
	}
	
}

swift swift中的“NSURL == String url”扩展名

swift中的“NSURL == String url”扩展名

isEquivalent.swift
extension NSURL {
	
	/**
	Check if the url:String is equivalent to NSURL
	:param: url to compare me
	:returns: true if is the same false otherwise
	*/
	func isEquivalent(url: String) -> Bool {
		
		if let myUrl = absoluteString {
			let urlComponents = url.componentsSeparatedByString("?")
			let myUrlComponents = myUrl.componentsSeparatedByString("?")
				return urlComponents.first == myUrlComponents.first
		}
		
		return true
	}
	
}

swift swift中的“NSURL == String url”扩展名

swift中的“NSURL == String url”扩展名

isEquivalent.swift
extension NSURL {
	
	/**
	Check if the url:String is equivalent to NSURL
	:param: url to compare me
	:returns: true if is the same false otherwise
	*/
	func isEquivalent(url: String) -> Bool {
		
		if let myUrl = absoluteString {
			let urlComponents = url.componentsSeparatedByString("?")
			let myUrlComponents = myUrl.componentsSeparatedByString("?")
				return urlComponents.first == myUrlComponents.first
		}
		
		return true
	}
	
}

swift swift中的“NSURL == String url”扩展名

swift中的“NSURL == String url”扩展名

isEquivalent.swift
extension NSURL {
	
	/**
	Check if the url:String is equivalent to NSURL
	:param: url to compare me
	:returns: true if is the same false otherwise
	*/
	func isEquivalent(url: String) -> Bool {
		
		if let myUrl = absoluteString {
			let urlComponents = url.componentsSeparatedByString("?")
			let myUrlComponents = myUrl.componentsSeparatedByString("?")
				return urlComponents.first == myUrlComponents.first
		}
		
		return true
	}
	
}

swift swift中的“NSURL == String url”扩展名

swift中的“NSURL == String url”扩展名

isEquivalent.swift
extension NSURL {
	
	/**
	Check if the url:String is equivalent to NSURL
	:param: url to compare me
	:returns: true if is the same false otherwise
	*/
	func isEquivalent(url: String) -> Bool {
		
		if let myUrl = absoluteString {
			let urlComponents = url.componentsSeparatedByString("?")
			let myUrlComponents = myUrl.componentsSeparatedByString("?")
				return urlComponents.first == myUrlComponents.first
		}
		
		return true
	}
	
}

swift swift中的“NSURL == String url”扩展名

swift中的“NSURL == String url”扩展名

isEquivalent.swift
extension NSURL {
	
	/**
	Check if the url:String is equivalent to NSURL
	:param: url to compare me
	:returns: true if is the same false otherwise
	*/
	func isEquivalent(url: String) -> Bool {
		
		if let myUrl = absoluteString {
			let urlComponents = url.componentsSeparatedByString("?")
			let myUrlComponents = myUrl.componentsSeparatedByString("?")
				return urlComponents.first == myUrlComponents.first
		}
		
		return true
	}
	
}

swift swift中的“NSURL == String url”扩展名

swift中的“NSURL == String url”扩展名

isEquivalent.swift
extension NSURL {
	
	/**
	Check if the url:String is equivalent to NSURL
	:param: url to compare me
	:returns: true if is the same false otherwise
	*/
	func isEquivalent(url: String) -> Bool {
		
		if let myUrl = absoluteString {
			let urlComponents = url.componentsSeparatedByString("?")
			let myUrlComponents = myUrl.componentsSeparatedByString("?")
				return urlComponents.first == myUrlComponents.first
		}
		
		return true
	}
	
}

swift swift中的“NSURL == String url”扩展名

swift中的“NSURL == String url”扩展名

isEquivalent.swift
extension NSURL {
	
	/**
	Check if the url:String is equivalent to NSURL
	:param: url to compare me
	:returns: true if is the same false otherwise
	*/
	func isEquivalent(url: String) -> Bool {
		
		if let myUrl = absoluteString {
			let urlComponents = url.componentsSeparatedByString("?")
			let myUrlComponents = myUrl.componentsSeparatedByString("?")
				return urlComponents.first == myUrlComponents.first
		}
		
		return true
	}
	
}

swift swift中的“NSURL == String url”扩展名

swift中的“NSURL == String url”扩展名

isEquivalent.swift
extension NSURL {
	
	/**
	Check if the url:String is equivalent to NSURL
	:param: url to compare me
	:returns: true if is the same false otherwise
	*/
	func isEquivalent(url: String) -> Bool {
		
		if let myUrl = absoluteString {
			let urlComponents = url.componentsSeparatedByString("?")
			let myUrlComponents = myUrl.componentsSeparatedByString("?")
				return urlComponents.first == myUrlComponents.first
		}
		
		return true
	}
	
}