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

iOSDC_LT.pdf

aboy
September 01, 2018

 iOSDC_LT.pdf

iOSDC 2018 9/1(土)のルーキーズLT枠で発表した内容です

aboy

September 01, 2018
Tweet

More Decks by aboy

Other Decks in Programming

Transcript

  1. ˏcosmeΞϓϦͷͭ͘Γ • MVVM/Clean Architecture + RxSwift • جຊ 1view <=>

    1view model • xib/storyboardʹΑΔview؅ཧ • جຊ 1view <=> 1xib/storyboard • AutoLayout/UIStackViewΰϦΰϦ࢖ͬͯΔ
  2. Textureͱ͸ • Pinterest͕࡞ͬͯΔඇಉظUIϑϨʔϜϫʔΫ • ϨΠΞ΢τܭࢉ͸όοΫάϥ΢ϯυεϨουͰඇಉظతʹߦ ΘΕΔ • ϨΠΞ΢τ͸શͯίʔυͰߦ͏ • CSS

    FlexboxϥΠΫͳಠࣗͷϨΠΞ΢τAPI • UIKitͰ͍͏View͸TextureͰ͸NodeͱݺͿ • UIKitͷओཁͳView͸˓˓NodeʹϦϓϨΠε͞ΕͯΔ https://github.com/TextureGroup/Texture
  3. UIKit͔ΒTexture΁ͷஔ͖׵͑ • UITableViewCell -> ASCellNode • UIView -> ASDisplayNode •

    ViewModel͸ͦͷ··ར༻Մೳ • attributed string΍isHiddenܥͷ஋͸ ViewModelͰ؅ཧ͠View΁όΠϯσΟϯά
  4. • ଞͷը໘Ͱ΋࢖͍ͬͯΔڞ௨ύʔπ͸࠷ѱ UIViewͷϥοϓͰରԠ • ͨͩ͠ϝΠϯεϨου͕࢖ΘΕΔ UIKit͔ΒTexture΁ͷஔ͖׵͑ node = ASDisplayNode {

    () -> UIView in let view = StarView(frame: CGRect.zero) view.configure(component.displayScore) //configure return view }
  5. ϨΠΞ΢τ override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { let

    baseStack = ASStackLayoutSpec.vertical() baseStack.spacing = 4.0 // UIStackView.Spacing var verticalElements: [ASLayoutElement] = [] if let messageNode = messageNode { verticalElements.append(messageNode) } verticalElements.append(contentNode) verticalElements.append(footerNode) baseStack.children = verticalElements return ASInsetLayoutSpec( insets: UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0), child: baseStack ) }