Latest 0.1.0
Homepage https://github.com/FelixJoseph/QBSubscriberField
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Overview

QBSubscriberField is a subclass of UITextField, written in Swift, that enables the UITextField to accept the E-mail of a subscriber along with submit button.

QBSubscriberField

Highlights

  • [x] Text color and background color of the text field is customizable.
  • [x] Button color is customizable
  • [x] The floating label will have the same color as the text color.
  • [x] User can handle success and error condition.
  • [x] Supports Swift and Objective-C.

Installation

CocoaPods:

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

QBSubscriberField is available through CocoaPods. To install it, specify it in your Podfile:


source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
pod "QBSubscriberField"
end

Then, run the following command:

$ pod install

Manually:

  • Download QBSubscriberField.
  • Drag and drop QBSubscriberField directory to your project

Usage

import QBSubscriberField

let sampleTextField = QBSubscriberField(frame: CGRect(x: x.origin, y: y.origin, width: widthOfField , height: 40.00));
self.view.addSubview(sampleTextField)

Example Project

An example project is included with this repo. To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode 7.3+
  • iOS 8.0+

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Usage

Here is how you can use QBSubscriberField.

Import QBSubscriberField to your viewcontroller,

import QBSubscriberField
  • Drag and drop a UITextField in the storyboard and set its constraints and attributes like background color and title color.
  • Set the text field class and module to QBSubscriberField.
  • Set delegate of the button.
  • In the didFinishTask delegate method do the task with the entered emailId.
  • After completing the task with the entered emailId call complete function with .success or .failure argument.
import UIKit
import QBSubscriberField

class ViewController: UIViewController, SubscriberFieldDelegate {

    @IBOutlet weak var subscriberField: QBSubscriberField!

    override func viewDidLoad() {

        super.viewDidLoad()
        subscriberField.callbackDelegate = self
    }

    func didFinishTask(sender: String, field button: QBSubscriberField) {
        // do task using the email
        button.completion(result: .success)
    }
}

Author

Felix Joseph, [email protected]

License

QBSubscriberField is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "QBSubscriberField",
    "version": "0.1.0",
    "summary": "A Subscribe field which is a subclass of UITextField.",
    "description": "This CocoaPod provides the ability to use a UITextField that may be used as a subscribe field with textfield for entering the email address and a button along with it.",
    "homepage": "https://github.com/FelixJoseph/QBSubscriberField",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Felix": "[email protected]"
    },
    "source": {
        "git": "https://github.com/FelixJoseph/QBSubscriberField.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "QBSubscriberField/Classes/**/*",
    "pushed_with_swift_version": "3"
}

Pin It on Pinterest

Share This