All Projects → dasdom → Storyboard2codeapp

dasdom / Storyboard2codeapp

Licence: mit
Mac app that converts an iOS storyboard into code. Work in progress.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Storyboard2codeapp

Ambtableviewcontroller
Storyboard and Prototype Cells-centric block-based UITableView controller to manage complex layouts.
Stars: ✭ 372 (+389.47%)
Mutual labels:  storyboard
Kydrawercontroller
Side Drawer Navigation Controller similar to Android
Stars: ✭ 632 (+731.58%)
Mutual labels:  storyboard
Bartycrouch
Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
Stars: ✭ 1,032 (+1257.89%)
Mutual labels:  storyboard
Zlaunchad
快速集成启动广告,支持LaunchImage和LaunchScreen,支持GIF,支持本地图片,支持视图过渡动画
Stars: ✭ 412 (+442.11%)
Mutual labels:  storyboard
Sidemenu
An interactive iOS side menu with rich features.
Stars: ✭ 442 (+481.58%)
Mutual labels:  storyboard
Forceblur
ForceBlur Animation for iOS Messaging Apps
Stars: ✭ 666 (+776.32%)
Mutual labels:  storyboard
Stevia
🍃 Concise Autolayout code
Stars: ✭ 3,182 (+4086.84%)
Mutual labels:  storyboard
Storyline.js
Storyline - generic sequencer for JavaScript projects
Stars: ✭ 70 (-7.89%)
Mutual labels:  storyboard
Sidemenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Stars: ✭ 5,267 (+6830.26%)
Mutual labels:  storyboard
Tangramkit
TangramKit is a powerful iOS UI framework implemented by Swift. It integrates the functions with Android layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,LayoutSizeClass to build your App 自动布局 UIView UITableView UICollectionView
Stars: ✭ 984 (+1194.74%)
Mutual labels:  storyboard
Cards
Awesome iOS 11 appstore cards in swift 5.
Stars: ✭ 4,017 (+5185.53%)
Mutual labels:  storyboard
Uitextfield Navigation
🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews
Stars: ✭ 436 (+473.68%)
Mutual labels:  storyboard
Cyltabbarcontroller
[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
Stars: ✭ 6,605 (+8590.79%)
Mutual labels:  storyboard
Autoinch
优雅的iPhone全尺寸/等比例精准适配工具
Stars: ✭ 395 (+419.74%)
Mutual labels:  storyboard
Keyboardhidemanager
Codeless manager to hide keyboard by tapping on views for iOS written in Swift
Stars: ✭ 57 (-25%)
Mutual labels:  storyboard
Swiftymenu
Simple and Elegant Drop down menu for iOS 🔥💥
Stars: ✭ 356 (+368.42%)
Mutual labels:  storyboard
Pmsuperbutton
🔥 PMSuperButton is a powerful UIButton coming from the countryside, but with super powers! 😎
Stars: ✭ 653 (+759.21%)
Mutual labels:  storyboard
Natalie
Natalie - Storyboard Code Generator (for Swift)
Stars: ✭ 1,183 (+1456.58%)
Mutual labels:  storyboard
Capsuleview
An easy to use drop-in view to create a beautiful card style effect with a title placeholder and body content.
Stars: ✭ 68 (-10.53%)
Mutual labels:  storyboard
Iblinter
A linter tool for Interface Builder
Stars: ✭ 915 (+1103.95%)
Mutual labels:  storyboard

This repository is not active anymore. I keep it up for reference.

Storybard2CodeApp

Build Status

Mac app that converts an iOS storyboard into code. Work in progress.

Goal

The ultimate goal is to be able to convert any iOS storyboard and convert it to code that is usable as a replacement of that storyboard without modification.

Progress

The project is in pre-alpha status. If I had to give a number of the progress, I would say it's about 50% done. But keep in mind, the last 20% of any project consume 80% of the total time. ;)

Supported (== most properties supported)

  • [x] UIView
  • [x] UIButton
  • [x] UILabel
  • [x] UISlider
  • [x] UITextField
  • [x] UISegmentedControl (images not supported yet)
  • [x] UIScrollView
  • [x] UITableView
  • [x] UIImageView
  • [x] UITableViewCell
  • [x] UIStackView
  • [x] SafeAreaGuides
  • [ ] IBActions
  • [ ] Segues
  • [ ] Size Classes
  • [ ] UICollectionView
  • [ ] UICollectionViewCell

Examples

The following gifs show examples. The presentation switches between the view created from a storyboard and the view created from the generated code. You can see the switch because right now the colours aren't not perfect. So further down the road those gifs will become images. :)

Generated Code

The storyboard scene

results in this code:

//
//  Created by Dominik Hauser on 17.02.19.
//  Copyright (c) 2019 dasdom. All rights reserved.
//
//  Generated by Storyboard2Code

import UIKit

class LoginView: UIView {
  let label: UILabel
  let usernameTextfield: UITextField
  let textInputStackView: UIStackView
  let passwordTextfield: UITextField
  let mainStackView: UIStackView
  let loginButton: UIButton

  override init(frame: CGRect) {
    label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.textAlignment = .center
label.lineBreakMode = .byTruncatingTail
label.text = "Please log in"

    usernameTextfield = UITextField()
usernameTextfield.translatesAutoresizingMaskIntoConstraints = false
usernameTextfield.borderStyle = .roundedRect
usernameTextfield.placeholder = "Username"
usernameTextfield.textAlignment = .natural
usernameTextfield.minimumFontSize = 17
    usernameTextfield.font = UIFont.systemFont(ofSize: 14)

    textInputStackView = UIStackView()
textInputStackView.isOpaque = false
textInputStackView.translatesAutoresizingMaskIntoConstraints = false
textInputStackView.axis = .vertical
textInputStackView.spacing = 3

    passwordTextfield = UITextField()
passwordTextfield.translatesAutoresizingMaskIntoConstraints = false
passwordTextfield.borderStyle = .roundedRect
passwordTextfield.placeholder = "Password"
passwordTextfield.textAlignment = .natural
passwordTextfield.minimumFontSize = 17
    passwordTextfield.font = UIFont.systemFont(ofSize: 14)

    mainStackView = UIStackView()
mainStackView.isOpaque = false
mainStackView.translatesAutoresizingMaskIntoConstraints = false
mainStackView.axis = .vertical
mainStackView.spacing = 10

loginButton = UIButton(type: .system)
loginButton.isOpaque = false
loginButton.translatesAutoresizingMaskIntoConstraints = false
loginButton.contentHorizontalAlignment = .center
loginButton.contentVerticalAlignment = .center
loginButton.titleLabel?.lineBreakMode = .byTruncatingMiddle
loginButton.setTitle("Login", for: .normal)

    super.init(frame: frame)

    backgroundColor = UIColor(red: 1.000, green: 0.800, blue: 0.400, alpha: 1.000)

    textInputStackView.addArrangedSubview(usernameTextfield)
    textInputStackView.addArrangedSubview(passwordTextfield)
    mainStackView.addArrangedSubview(label)
    mainStackView.addArrangedSubview(textInputStackView)
    mainStackView.addArrangedSubview(loginButton)

    addSubview(mainStackView)

    NSLayoutConstraint.activate([
      mainStackView.topAnchor.constraint(equalTo:safeAreaLayoutGuide.topAnchor, constant:20),
      mainStackView.leadingAnchor.constraint(equalTo:safeAreaLayoutGuide.leadingAnchor, constant:20),
      safeAreaLayoutGuide.trailingAnchor.constraint(equalTo:mainStackView.trailingAnchor, constant:20),
      ])
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}

extension ViewController {
override func loadView() {
view = LoginView()
}
}

Note: The indentation is not completely implemented yet.

Usage

The generated code looks best if all the elements in the storyboard have a label because this is used for the name of the element. You can set the label in the identity inspector:

If the label is missing, the internal id in the storyboard of that element is used.

Author

@dasdom

Licence

MIT

See LICENCE.md

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].