下面是内存溢出 jb51.cc 通过网络收集整理的代码片段。
内存溢出小编现在分享给大家,也给大家做个参考。
//// VIEwController.swift// easySwift//// Created by zhuchao on 14-7-15.// copyright (c) 2014 year zhuchao. All rights reserved.//import UIKitclass AwesomeScene: Scene { @IBOutlet strong var collectionVIEw: SceneCollectionVIEw! var dict:NSDictionary! var showFont:String! overrIDe func vIEwDIDLoad() { super.vIEwDIDLoad() showFont = FontAwesome self.collectionVIEw.registerClass(IconCell.classForCoder(),forCellWithReuseIDentifIEr: "IconCell") self.collectionVIEw.backgroundcolor = UIcolor(string: "#E9E9E9"); var FontDict:NSDictionary = NSDictionary.objectFromData(NSData.fromresource("FontIconConfig.Json")) as NSDictionary var Json:Nsstring = FontDict.objectForKey(showFont).objectForKey("Json") as Nsstring dict = NSDictionary.objectFromData(NSData.fromresource(Json)) as NSDictionary self.collectionVIEw.dataArray = NSMutableArray(array: dict.allKeys) } overrIDe func dIDReceiveMemoryWarning() { super.dIDReceiveMemoryWarning() // dispose of any resources that can be recreated. } func collectionVIEw(collectionVIEw: UICollectionVIEw!,numberOfItemsInSection section: Int) -> Int{ return self.collectionVIEw.dataArray.count } func numberOfSectionsInCollectionVIEw(collectionVIEw: UICollectionVIEw!) -> Int{ return 1 } func collectionVIEw(collectionVIEw: UICollectionVIEw!,cellForItemAtIndexPath indexPath: NSIndexPath!) -> UICollectionVIEwCell!{ var cell:IconCell = collectionVIEw.dequeueReusableCellWithReuseIDentifIEr("IconCell",forIndexPath: indexPath) as IconCell var key = self.collectionVIEw.dataArray.objectAtIndex(indexPath.row) as String var icon = dict.objectForKey(key) as String IconFont.label(cell.iconMainVIEw,Fontname: showFont,setIcon: icon,size: 50.0,color: UIcolor.blackcolor(),sizetoFit:true) return cell } func collectionVIEw(collectionVIEw: UICollectionVIEw!,layout collectionVIEwLayout: UICollectionVIEwLayout!,sizeforItemAtIndexPath indexPath: NSIndexPath!) -> CGSize{ return CGSizeMake(50,65) } func collectionVIEw(collectionVIEw: UICollectionVIEw!,insetForSectionAtIndex section: Int) -> UIEdgeInsets{ return UIEdgeInsetsMake(10,10,10); } func collectionVIEw(collectionVIEw: UICollectionVIEw!,dIDSelectItemAtIndexPath indexPath: NSIndexPath!){ var key = self.collectionVIEw.dataArray.objectAtIndex(indexPath.row) as String DialogUtil.showDlgalert(key) }}
以上是内存溢出(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
总结以上是内存溢出为你收集整理的基于Swift与EasyIOS的UICollectionView演示代码全部内容,希望文章能够帮你解决基于Swift与EasyIOS的UICollectionView演示代码所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)