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
// force blinking the cursor | |
self!.inputTextField.inputView = UIView() | |
self!.inputTextField.becomeFirstResponder() | |
//re-enable for when user actually clicks | |
inputTextField.rx.controlEvent(.touchDown).subscribe(onNext: { [weak self] _ in | |
guard let _ = self else { return } | |
self!.inputTextField.inputView = nil | |
self!.inputTextField.reloadInputViews() | |
}).addDisposableTo(rx_disposeBag) |
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
func collectionView(_ collectionView: UICollectionView, heightForAnnotationAtIndexPath indexPath: IndexPath, withWidth width: CGFloat) -> CGFloat { | |
let x = dataSource?[indexPath] | |
let font = UIFont(name: "OpenSans", size: 11)! | |
let rect = NSString(string: x?.brief ?? "").boundingRect(with: CGSize(width: width, height: CGFloat(MAXFLOAT)), options: .usesLineFragmentOrigin, attributes: [NSFontAttributeName: font], context: nil) | |
// if multiple types | |
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
//this takes a list of items in an array, then runs an observable on each of them, finally it combines | |
//all of the outputs into one observable which returns all of the media items at once | |
Observable.combineLatest(mediaItems.map({ $0.getMediaMetadataObservable() })).subscribe(onNext: { a in | |
for item in a { | |
print (item.type) | |
} | |
}) |
OlderNewer