Giter Site home page Giter Site logo

mslabel's People

Contributors

ankitgangal avatar gertig avatar jarrold avatar jbrennan avatar mlawrie avatar orarbel avatar rex-remind101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mslabel's Issues

Doesn't apply the UILabel's shadow properties

The drawing ignores any shadow settings applied to the UILabel. This can easily be fixed by inserting the following after line 33 in MSLabel.m:

CGContextSetShadowWithColor(UIGraphicsGetCurrentContext(), self.shadowOffset, 0, self.shadowColor.CGColor);

Vertical alignement ?

I'm trying to figure out how to bring back the middle vertical alignement from the standard UILabel. Any idea how to start ?

Thanks,

Flawed text wrapping algorithm

If all you want is a label with the ability to change the line spacing there is very little to choose from on github. The example you mentioned, MTLabel, says there's a known issue in drawing in table cell due to the fact he uses performSelector:withObject:afterDelay:. Any code using this method instantly rings alarm bells in my head.

Anyway your solution seemed ideally as although it only supports one lineBreakMode it was the one I needed but alias your text wrapping code gets stuck in an infinite loop and after inspection I can see if needs some serious optimisation.

Hope you get the time to fix it as this is useful little class

Ignores newline characters

In the standard UILabel, a newline character \n causes a line break. In this component, the newline characters gets trimmed out and are not respected.

Regaring iOS line specing

Hello,

I am implementing MSLabel Class for line spacing in vertical formate label but its not working in iOS 8 Xcode 6.1 with Autolayout. please check. Help much Appreciate...

Thanks,

You should use this loop for you stringsFromText Method

NSArray *splitString = [string componentsSeparatedByString:@" "];
NSMutableArray *allLines = [NSMutableArray array];    
NSMutableString *line = [NSMutableString string];
for (int i = 0; i < splitString.count; i++) {

    NSString *word = [splitString objectAtIndex:i];
    NSString *fakeLine =  [NSString stringWithFormat:@"%@%@ ",line, word];

    CGSize lineSize = [fakeLine sizeWithFont:self.font];

    if (lineSize.width <= self.frame.size.width) {
        [line appendFormat:@"%@ ", word];
    } else {
        [allLines addObject:[line stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]];
        line = [NSMutableString string];
        [line appendFormat:@"%@ ", word];            
    }
}
[allLines addObject:[line stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]];

its only one loop and you don't need a set to "Remove words" you just need to know where your at. Its probably faster, plus the other one with the weird double loop was giving me an EXC_BAD_ACCESS when I used that same method to create a inner shadow rendering engine.

Podspec outdated

Podspec for cocoa pods is pointing to an old commit, please update!

License?

What license is this distributed under? Thanks!

No space between words when using word wrapping.

Sometimes when I'm using 'NSLineBreakByWordWrapping' and having more than 1 line text (2 or more) and using 'lineHeight' property, there is no space between some words. Also, I only came across this in 'Hebrew' text UTF8 from right to left, so maybe there is the problem. Why is that?

Warnings related to Deprecated property in IOS6.

There are certain warnings related to properties deprecated in IOS6. and rather we should use functions that are given for IOS6 ex. for breaklinemode OR textalignment.

If possible pls, update it so that it supports and goes well with IOS 6.

Sumit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.