A triangle shaped corner label view for iOS written in Swift.

Overview

A triangle shaped corner label view for iOS written in Swift.

  • This view is a subclass of UIView.
  • It can be created and customized from the Storyboard or from the code.


TriLabelView TriLabelView

Setup with CocoaPods

If you are using CocoaPods add this text to your Podfile and run pod install.

use_frameworks!
target 'Your target name'
pod 'TriLabelView'

Or Add source

Simply add TriLabelView.swift file to you project.

Usage

Creating a view from the code

let triLabelView = TriLabelView(frame:CGRect)
view.addSubview(triLabelView)

Customization

// Change Text
triLabelView.labelText = "NEW"

// Adjust Length Percentage
// You can update this to set percentage value of this
// view to that of the superview.
// Default value is 50.0
triLabelView.lengthPercentage = 60.0

You can set the position of view with .TopLeft being the default. The following positions are available

public enum Position:String {
    case TopLeft
    case TopRight
    case BottomRight
    case BottomLeft
}

You can update text color, font and background color

triLabelView.textColor = UIColor.yellowColor()

triLabelView.labelFont = UIFont.systemFont(ofSize: 15)

triLabelView.viewColor = UIColor.brownColor()

Creating a view from the storyboard

  • If you already have a view where you want to use then set it's class to TriLabelView in identity inspector.

  • Or drag a View from object library and then change it's class to TriLabelView in identity inspector.

  • Set the module property to TriLabelView.

Add TriLabelView to storyboard

  • Customize the view properties in the attributes inspector.

Attributes inspector

Requirements

  • Swift 3 / Xcode 8
  • iOS 9.3

Author

Mukesh Thawani

Contributing

Feature requests, bug reports, and pull requests are all welcome.

License

Copyright (c) 2016 Mukesh Thawani. Release under the MIT License.

Comments
  • Logo Proposal

    Logo Proposal

    Hi @mukeshthawani I am a graphic designer and I would like to contribute to your good project by designing a logo for it as i have noticed it doesn't have one yet..I will be doing it as a gift for free, I just need your permission first before I begin..Hoping for your positive feedback. Thanks and best regards!

    • Tobaloidee
    opened by Tobaloidee 10
  • Needs to specify Swift Language Version

    Needs to specify Swift Language Version

    When building for Objective-C in Xcode 9, I receive an error due to an unspecified/unsupported Swift version. The fix is just to go into Build Settings > Swift Compiler - Language > Swift Language Version and then set it there.

    opened by imryan 5
  • Logo upload and Readme update

    Logo upload and Readme update

    Thanks for accepting my contribution Sir @mukeshthawani . Im glad to have provided the project its own logo. If you need me in the future just notify me. You can download all the other file formats and versions of the logo on the link below:

    SVG-PNG-Ai

    Best regards!

    -Tobaloidee

    opened by Tobaloidee 1
  • set lengthPercentage is not work in swift, is ok in storyboard

    set lengthPercentage is not work in swift, is ok in storyboard

    // Initialize
            let triLabel = TriLabelView(frame: cell.bounds)
    
            // Length Percentage
            triLabel.lengthPercentage = 50
    
    

    wrong order init->setup->updateFrameValue->set lengthPercentage

    bug 
    opened by fengdianxun 1
  • Correct the spelling of CocoaPods in README

    Correct the spelling of CocoaPods in README

    This pull request corrects the spelling of CocoaPods 🤓 https://github.com/CocoaPods/shared_resources/tree/master/media

    Created with cocoapods-readme.

    opened by ReadmeCritic 0
Owner
Mukesh Thawani
Software Engineer. Interested in machine learning.
Mukesh Thawani
A faster and more flexible label view for iOS

STULabel is an open source iOS framework for Swift and Objective-C that provides a label view (STULabel), a label layer (STULabelLayer) and a flexible

Stephan Tolksdorf 96 Dec 22, 2022
NumberMorphView a view like label for displaying numbers which animate with transition using a technique called number tweening or number morphing.

NumberMorphView a view like label for displaying numbers which animate with transition using a technique called number tweening or num

Abhinav Chauhan 1.6k Dec 21, 2022
Configurable morphing transitions between text values of a label.

TOMSMorphingLabel Configurable morphing transitions between text values of a label. Triggering the animation is as easy as setting the labels text pro

Tom König 1.9k Nov 20, 2022
Custom Label to apply animations on whole text or letters.

Ophiuchus Custom Label to apply animations on whole text or letters. Check an article on our blog Inspired by this project on Dribble Installation Coc

Yalantis 885 Dec 2, 2022
Animate numeric value while setting new value to label

NumericAnimatedLabel Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installati

Javal Nanda 28 Oct 11, 2021
OdometerLabel - SwiftUI number label with odometer animation

Пример Simulator.Screen.Recording.-.L.iPhone.12.-.2022-01-30.at.16.26.53.mp4

Misnikov Roman 2 Jun 13, 2022
A morphing UILabel subclass written in Swift.

LTMorphingLabel A morphing UILabel subclass written in Swift. The .Scale effect mimicked Apple's QuickType animation of iOS 8 of WWDC 2014. New morphi

Lex Tang 7.9k Jan 4, 2023
Lightweight library to set an Image as text background. Written in swift.

Simple and light weight UIView that animate text with an image.

Lucas Ortis 552 Sep 9, 2022
MTLLinkLabel is linkable UILabel. Written in Swift.

# MTLLinkLabel is linkable UILabel. Written in Swift. Requirements iOS 8.0+ Xcode 7.3+ Installation Carthage You can install Carthage with Homebrew. $

Recruit Holdings. Media Technology Lab 74 Jul 1, 2022
Glitching UILabel for iOS 📺

Glitching UILabel for iOS ?? Created by Lee Sun-Hyoup. Try the sample $ pod try GlitchLabel Requirements iOS 8.0+ Swift 3 Xcode 8 Installation CocoaP

Lee Sun-Hyoup 1k Dec 14, 2022
Incrementable UILabel for iOS and tvOS

IncrementableLabel IncrementableLabel is the easiest way to have incrementable numbers in an UILabel! Usage let myIncrementableLabel = IncrementableLa

Tom Baranes 81 Feb 4, 2022
A handy class for iOS to use UILabel as a countdown timer or stopwatch just like in Apple Clock App.

MZTimerLabel Purpose MZTimerLabel is a UILabel subclass, which is a handy way to use UILabel as a countdown timer or stopwatch just like that in Apple

Mines Chan 1.6k Dec 14, 2022
Swift TTTAttributedLabel replacement

Nantes ?? This library is a Swift port/fork of the popular Objective-C library TTTAttributedLabel. Much ❤️ and credit goes to Mattt for creating such

Instacart 1k Dec 22, 2022
NSData Detector with swift

NSDataDetector This playground demonstrates a weird difference in behaviour between Xcodes 12.5.1 and 13.1 regarding NSDataDetector. Try to run it usi

Vinícius Rodrigues de Uzêda 0 Dec 7, 2021
Swift UIView for sliding text with page indicator

SlidingText for Swift Requirements Requires iOS 8 or later and Xcode 6.1+ Installation SlidingText is available through CocoaPods. To install it, simp

Dionysis Karatzas 53 Mar 1, 2022
Simple battery shaped UIView

BatteryView Simple battery shaped UIView. Usage let batteryView = BatteryView(frame: smallRect) batteryView.level = 42 // anywhere in 0...100 batteryV

Yonat Sharon 50 Sep 19, 2022
Trigonometry - A small package to calculate values in an right angled triangle

Trigonometry - A small package to calculate values in an right angled triangle

null 2 Sep 12, 2022
Animated Mask Label is a nice gradient animated label.

Animated Mask Label Demo Screen Screenshot Demo/Example For demo: $ pod try AnimatedMaskLabel To run the example project, clone the repo, and run pod

Jogendra 19 Dec 13, 2022
A faster and more flexible label view for iOS

STULabel is an open source iOS framework for Swift and Objective-C that provides a label view (STULabel), a label layer (STULabelLayer) and a flexible

Stephan Tolksdorf 96 Dec 22, 2022
A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift.

SkyFloatingLabelTextField SkyFloatingLabelTextField is a beautiful, flexible and customizable implementation of the space saving "Float Label Pattern"

Skyscanner 4k Jan 1, 2023