Skip to content

πŸ“ STTextView is a light-weight library that adds a placeholder to the UITextView.

License

Notifications You must be signed in to change notification settings

onl1ner/STTextView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

STTextView

STTextView – easy and clean library written in Swift. The framework adds a custom UITextView subclass with a needed placeholder property.

Requirements

  • iOS 10.0 or above.

Framework is compatible with Swift 5.

Installation

STTextView is available through CocoaPods, Carthage and Swift Package Manager

CocoaPods

  • Add the following line into your Podfile:

    pod 'STTextView'
  • Then run this command in your terminal:

    $ pod install

Carthage

  • Add the following line into your Cartfile:

    github "onl1ner/STTextView"
    
  • And run the next command in terminal:

    $ carthage update

Swift Package Manager

  • In Xcode select:

    File > Swift Packages > Add Package Dependency...
    
  • Then paste this URL:

    https://github.com/onl1ner/STTextView.git
    

Manually

You could also install it manually. Just drag and drop the STTextView.swift file into your Xcode project.

Usage

Interface Builder

Simply attach STTextView class to your UITextView object and you will be able to change the values through the Interface Builder.

Swift

import STTextView

let textView = STTextView()
textView.placeholder = "Some placeholder text"
textView.placeholderColor = .secondaryLabel

You can also have an attributed placeholder. Use attributedPlaceholder property.

Example

Open example project STTextViewExample/STTextViewExample.xcworkspace to see a simple demonstrations of framework usage.

Contributing

Have some troubles? Feel free to open an issue.

License

STTextView is under the terms and conditions of the MIT license.

MIT License

Copyright (c) 2020 Tamerlan Satualdypov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.