cemolcay / MaterialCardView

Create material design cards quick and easy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swift 2.0

TayfunAslan opened this issue · comments

Hello,

I'm using Xcode 7.0 Beta 2, your library and triggers many errors.
You're currently creating a branch to solve this problem?

Thanks.

Hi, I am using xcode 6.3.2 and your code triggers many errors.

commented

+1

Are you fixing the problem. It is the good work done by you.

thanks, i will, i'm sorry, i'm just too busy nowadays, will try to update it untill weekend

commented

The changes don't see to be too much. After using the migrator tool, this is what I did to fix it. Whenever you see:
return me.visibleViewController.bottom
change it to
return me.visibleViewController!.bottom

In the NSAttributedStringStyle enum change func attribute to:

    func attribute () -> [String: AnyObject] {
        switch self {

        case .plain:
            return [:]

        case .underline(let styleName, let color):
            return [NSUnderlineStyleAttributeName: styleName.rawValue, NSUnderlineColorAttributeName: color]

        case .strike(let color, let width):
            return [NSStrikethroughColorAttributeName: color, NSStrikethroughStyleAttributeName: width]
        }
    }

And in the first convenience init of NSAttributedString extension:

convenience init (
    text: String,
    color: UIColor,
    font: UIFont,
    style: NSAttributedStringStyle = .plain) {

        var atts: [String: AnyObject] = [NSFontAttributeName as String: font, NSForegroundColorAttributeName as String: color]
        atts += style.attribute()

        self.init (string: text, attributes: atts)
}

Hey!
Please to see https://github.com/TayfunAslan/MaterialCardView.git
I have created swift 2.0 branch named "swift2_0"
Please to merge pull request ;)

Güle Güle.