Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HBFav実装のこだわり #confwd

Naoya Ito
February 01, 2014

HBFav実装のこだわり #confwd

#confwd での LT の資料です

Naoya Ito

February 01, 2014
Tweet

More Decks by Naoya Ito

Other Decks in Technology

Transcript

  1. %JSFDU%SBXJOH class  CustomCellContentView  <  UIView      def  drawRect(rect)  

           self.superview.superview.drawRectContent(rect)      end   end     class  BookmarkCell  <  UITableViewCell     def  initWithStyle(style,  reuseIdentifier:reuseIdentifier)      if  super          @contentView  =  CustomCellContentView.alloc.initWithFrame(CGRectZero)          ...   end     def  drawRectContent(rect)      ...      font  =  UIFront.boldSystemFontOfSize(16)      size  =  @text.sizeWithFont(font)      @text.drawInRect([[x,  y],  size],  withFont:font)   end   DPOUFOU7JFXͷ ESBX3FDU಺Ͱ ESBX*O3FDUͰඳը
  2. DPOUFOU0GGTFUΛҡ࣋͢Δ offset  =  tableView.contentOffset   tableView.reloadData     for  i

     in  (0..prependedRowSize  -­‐  1)  do      offset.y  +=  self.tableView(          tableView,          heightForRowAtIndexPath:NSIndexPath.indexPathForRow(i,  inSection:0)      )   end     if  offset.y  >  tableView.contentSize.height      offset.y  =  0   end     tableView.setContentOffset(offset)   SFMPBEલͷ DPOUFOU0⒎TFU Λऔಘ ௥Ճͨ͠ηϧͷ ߴ͞Λܭࢉ ࠶ܭࢉͨ͠ P⒎TFUΛηοτ ͜ΕΛϞσϧߋ৽ͷΠϕϯτΛड͚औͬͨ࣌ʹ࣮ߦ͢Δ ΋͏ͪΐͬͱ଎͍࣮૷͕͋Γͦ͏ͳ͖΋͢Δ͚Ͳ 
  3. BQQMJDBUJPOEJE3FDFJWF3FNPUF/PUJpDB UJPOGFUDI$PNQMFUJPO)BOEMFS def  application(application,  didReceiveRemoteNotification:userInfo,   fetchCompletionHandler:completionHandler)      self.timelineViewController.performBackgroundFetchWithCompletion(

             completionHandler      )      self.handlePush(application,  userInfo:userInfo)   end   J04͔Βɺ#BDLHSPVOE.PEFTͷ SFNPUFOPUJpDBUJPOTΛ༗ޮʹ͢Δ ͱɺQVTIܖػͰ͜ͷϋϯυϥ͕ݺ͹ ΕΔ