Latest 1.0.0
Homepage https://github.com/oooneFolder/KWFillBlankViewController
License MIT
Platforms ios 9.3, requires ARC
Frameworks Foundation, UIKit
Authors

Platform
Language

A view controller can fill blank in text view.

Components

KWFillBlankViewController

  • Remember to press for a while when you click blanks with Xcode Simulator.
  • The default blank is "_".
  • Using by code beneath.
let text = "your _____ text _____ here "
let blankViewController = KWFillBlankViewController(contentText: text)
self.navigationController?.pushViewController(blankViewController, animated: true)
  • If you want to do something when clicking the blank ,just using code beneath ,
blankViewController.delegate = self
  • And complete this delegate
func fillBlankView(fillBlankView: UIView, didSelectedBlankRange range: NSRange)
  • If you want to get the text you select ,just
blankViewController.textView.selectedText()
  • If you want to get the array of texts of the blanks you fill
  • The text of the blank you have not fill is ""
  • You can use this function .
let arr:[String] = blankViewController.textView.contentTexts()

KWFillBlankTextView

  • KWFillBlankTextView is a subclass of UITextView
  • It can be used independently
  • You can set blank tag in the storyboard

  • If you want to do something when clicking the blank ,just follow the UITextViewDelegate and using code beneath
func textView(textView: UITextView, shouldInteractWithURL URL: NSURL, inRange characterRange: NSRange) -> Bool {
        if URL.absoluteString == "blank"{
            //type your code here
            return false
        }
        return true
    }

Installation

  • Install with CocoaPods

        pod 'KWFillBlankViewController'
  • Copy the KWFillBlankViewController folder to your project

License

KWFillBlankViewController is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "KWFillBlankViewController",
    "version": "1.0.0",
    "summary": "A view controller can fill blank in the text view written by Swift",
    "description": "It is a  view controller can fill blank in the text view ,written by Swift",
    "homepage": "https://github.com/oooneFolder/KWFillBlankViewController",
    "license": "MIT",
    "authors": {
        "oneFolder": "[email protected]"
    },
    "source": {
        "git": "https://github.com/oooneFolder/KWFillBlankViewController.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "9.3"
    },
    "requires_arc": true,
    "source_files": "KWFillBlankViewController/*",
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This