xiaol / EveryoneNews

0 stars 0 forks source link

BorderView #2

Open 0x30 opened 8 years ago

0x30 commented 8 years ago
//
//  BorderView.swift
//  Ceshi
//
//  Created by 荆文征 on 16/7/20.
//  Copyright © 2016年 timer. All rights reserved.
//

import UIKit

@IBDesignable
class InspectView:UIView{

    /// 是否展示上边框
    @IBInspectable var TB:Bool = false
    /// 上边框显示颜色
    @IBInspectable var TBWidth:CGFloat = 1
    /// 上边框显示颜色
    @IBInspectable var TBColor:UIColor = UIColor.blackColor()
    /// 上边框距离上方的距离
    @IBInspectable var TBTopSpace:CGFloat = 0
    /// 上边框距离右边的距离
    @IBInspectable var TBRightSpace:CGFloat = 0
    /// 上边框距离左边的距离
    @IBInspectable var TBLeftSpace:CGFloat = 0

    /// 是否展示下边框
    @IBInspectable var BB:Bool = false
    /// 下边框显示颜色
    @IBInspectable var BBWidth:CGFloat = 1
    /// 下边框显示颜色
    @IBInspectable var BBColor:UIColor = UIColor.blackColor()
    /// 下边框距离上方的距离
    @IBInspectable var BBBottomSpace:CGFloat = 0
    /// 下边框距离右边的距离
    @IBInspectable var BBRightSpace:CGFloat = 0
    /// 下边框距离左边的距离
    @IBInspectable var BBLeftSpace:CGFloat = 0

    /// 是否展示右边框
    @IBInspectable var RB:Bool = false
    /// 右边框显示宽度
    @IBInspectable var RBWidth:CGFloat = 1
    /// 右边框显示颜色
    @IBInspectable var RBColor:UIColor = UIColor.blackColor()
    /// 右边框距离上边的距离
    @IBInspectable var RBTopSpace:CGFloat = 0
    /// 右边框距离上方的距离
    @IBInspectable var RBBottomSpace:CGFloat = 0
    /// 右边框距离右边的距离
    @IBInspectable var RBRightSpace:CGFloat = 0

    /// 是否展示左边框
    @IBInspectable var LB:Bool = false
    /// 左边框显示宽度
    @IBInspectable var LBWidth:CGFloat = 1
    /// 左边框显示颜色
    @IBInspectable var LBColor:UIColor = UIColor.blackColor()
    /// 左边框距离上边的距离
    @IBInspectable var LBTopSpace:CGFloat = 0
    /// 左边框距离下方的距离
    @IBInspectable var LBBottomSpace:CGFloat = 0
    /// 左边框距离左边的距离
    @IBInspectable var LBLeftSpace:CGFloat = 0

    override func drawRect(rect: CGRect) {

        super.drawRect(rect)

        self.layer.cornerRadius = 10

        let context = UIGraphicsGetCurrentContext() // 获取绘画板

        if self.TB {

            CGContextSetFillColorWithColor(context, self.TBColor.CGColor)
            CGContextFillRect(context, CGRectMake(self.TBLeftSpace, self.TBTopSpace, rect.width-self.TBLeftSpace-self.TBRightSpace, self.TBWidth))
        }

        if self.BB {

            CGContextSetFillColorWithColor(context, self.BBColor.CGColor)
            CGContextFillRect(context, CGRectMake(self.BBLeftSpace, rect.height-self.BBBottomSpace-self.BBWidth, rect.width-self.BBLeftSpace-self.BBRightSpace, self.BBWidth))
        }

        if self.RB {

            CGContextSetFillColorWithColor(context, self.RBColor.CGColor)
            CGContextFillRect(context, CGRectMake(rect.width-self.RBRightSpace-self.RBWidth, self.RBTopSpace, self.RBWidth,rect.height-self.RBBottomSpace-self.RBTopSpace))
        }

        if self.LB {

            CGContextSetFillColorWithColor(context, self.LBColor.CGColor)
            CGContextFillRect(context, CGRectMake(self.LBLeftSpace, self.LBTopSpace, self.LBWidth,rect.height-self.LBBottomSpace-self.LBTopSpace))
        }
    }
}
0x30 commented 8 years ago

需要修复


    /**
     设置关注cell的视图
     */
    private func SetFCell(cell:NewBaseTableViewCell,new:New){

        if channel?.id == 1994 {

            cell.pubLabel.layer.cornerRadius = 2
            cell.pubLabel.clipsToBounds = true
            cell.pubLabel.textColor = UIColor.whiteColor()
            cell.pubLabel.font = UIFont.a_font6
            cell.pubLabel.text = " \(cell.pubLabel.text ?? " ") "
            cell.pubLabel.backgroundColor = Focus.gColor(new.pname)
            cell.commentCountLabel.hidden = true
            cell.noLikeButton.hidden = true
        }
    }
func fouceCell(vc:UIViewController,focusResults:Results<Focus>){

//        if finish { return }

        if let view = view1 {
            view.removeFromSuperview()
        }

        if let view = view2 {
            view.removeFromSuperview()
        }

        if let view = view3 {
            view.removeFromSuperview()
        }

        if let view = view4 {
            view.removeFromSuperview()
        }

        self.vc = vc

        self.finish = true

        title.font = UIFont.a_font2
        title.textColor = UIColor.a_color3
0x30 commented 8 years ago

自定义 UMeng 分享 cocoapods 组建 所需配置文件

{
  "name": "UMengSocialCOM",
  "version": "5.2.1",
  "summary": "UMeng's official Social SDK for iOS.",
  "description": "UMeng Social SDK,You can easily share any content to Sina Weibo, Tencent Weibo, Renren, Qzone, Doubban, Wechat and so on using our unified APIs.",
  "requires_arc": false,
  "homepage": "http://dev.umeng.com/social/ios/quick-integration",
  "license": {
    "type": "Copyright",
    "text": "    Copyright 2011 - 2016 UMeng.com. All rights reserved.\n"
  },
  "authors": {
    "UMeng": "support@umeng.com"
  },
  "source": {
    "http": "http://dev.umeng.com/files/download/Umeng_SDK_Social_iOS_ARM64_5.2.1.zip"
  },
  "source_files": [
    "Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_5.2.1/Header/*.h",
    "Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_Extra_Frameworks/Wechat/*.h",
    "Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_Extra_Frameworks/TencentOpenAPI/*.h"
  ],
  "preserve_paths": [
    "Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_5.2.1/libUMSocial_Sdk_5.2.1.a",
    "Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_5.2.1/libUMSocial_Sdk_Comment_5.2.1.a",
    "Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_Extra_Frameworks/Wechat/libSocialWechat.a",
    "Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_Extra_Frameworks/Wechat/libWeChatSDK.a",
    "Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_Extra_Frameworks/TencentOpenAPI/libSocialQQ.a",
    "Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_Extra_Frameworks/TencentOpenAPI/TencentOpenAPI.framework"
  ],
  "libraries": [
    "UMSocial_Sdk_5.2.1",
    "UMSocial_Sdk_Comment_5.2.1",
    "SocialQQ",
    "SocialWechat",
    "z",
    "sqlite3",
    "stdc++",
    "iconv",
    "WeChatSDK"
  ],
  "xcconfig": {
    "LIBRARY_SEARCH_PATHS": "$(SRCROOT)/UMengSocial/Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_5.2.1/** $(SRCROOT)/UMengSocial/Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_Extra_Frameworks/TencentOpenAPI/ $(SRCROOT)/UMengSocial/Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_Extra_Frameworks/Wechat/**",
    "FRAMEWORK_SEARCH_PATHS": "$(SRCROOT)/UMengSocial/Umeng_SDK_Social_iOS_ARM64_5.2.1/UMSocial_Sdk_Extra_Frameworks/TencentOpenAPI/"
  },
  "frameworks": [
    "SystemConfiguration",
    "MobileCoreServices",
    "TencentOpenAPI",
    "Accounts",
    "Social",
    "CoreData",
    "ImageIO"
  ],
  "platforms": {
    "ios": "5.0"
  }
}