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
// | |
// main.c | |
// jkasdfj | |
// | |
// Created by kemchenj on 2018/7/13. | |
// Copyright © 2018 kemchenj. All rights reserved. | |
// | |
#include <stdio.h> |
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
extension UITextView { | |
func correctSelection() { | |
let currentSelectedRange = selectedRange | |
let wholeRange = attributedText.wholeRange | |
let emptyRange = NSRange() | |
var lowerAttributeEffectiveRange = NSRange() | |
var upperAttributeEffectiveRange = NSRange() |
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 | |
final class Sample: NSObject { | |
@objc dynamic var name: String = "" | |
} | |
class MyObj: NSObject { | |
@objc dynamic var test: String = "" | |
} |
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 | |
extension Sequence where Element: Hashable { | |
var frequencies: [Element: Int] { | |
return Dictionary(lazy.map { ($0: 1) }, uniquingKeysWith: +) | |
} | |
} |
NewerOlder