Skip to content

Commit

Permalink
v2 - Modernizing API (#100)
Browse files Browse the repository at this point in the history
* ⚡ WIP

* 🌲 Update

* 🌲 Update

* 🌲 Update

* 🌲 Update

* Update Package.swift

* Update README.md

* Update ci.yml

* Remove gif

* Resolve packages

* 🌲 Update

* 🌲 Update

* 🌲 Update
  • Loading branch information
muukii authored Mar 2, 2022
1 parent f324e9b commit b00da01
Show file tree
Hide file tree
Showing 28 changed files with 1,271 additions and 932 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ jobs:
test:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- run: set -o pipefail && xcodebuild build -project NextGrowingTextView.xcodeproj -scheme NextGrowingTextView -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty
- run: pod lib lint
- uses: maxim-lobanov/[email protected]
with:
xcode-version: "13.2"
- uses: actions/checkout@v2
# - run: set -o pipefail && xcodebuild build -project NextGrowingTextView.xcodeproj -scheme NextGrowingTextView -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty
- run: pod lib lint --allow-warnings
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Xcode
build/
.build
*.pbxuser
!default.pbxuser
*.mode1v3
Expand Down
17 changes: 0 additions & 17 deletions Demo/AppDelegate.swift

This file was deleted.

48 changes: 0 additions & 48 deletions Demo/Assets.xcassets/AppIcon.appiconset/Contents.json

This file was deleted.

213 changes: 0 additions & 213 deletions Demo/Base.lproj/Main.storyboard

This file was deleted.

40 changes: 0 additions & 40 deletions Demo/Info.plist

This file was deleted.

31 changes: 0 additions & 31 deletions Demo/ScrollViewViewController.swift

This file was deleted.

85 changes: 0 additions & 85 deletions Demo/ViewController.swift

This file was deleted.

22 changes: 22 additions & 0 deletions NextGrowingTextView-Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import UIKit

import MondrianLayout
import CompositionKit
import NextGrowingTextView
import TypedTextAttributes

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

let newWindow = UIWindow()
newWindow.rootViewController = RootContainerViewController()
newWindow.makeKeyAndVisible()
self.window = newWindow
return true
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
60 changes: 60 additions & 0 deletions NextGrowingTextView-Demo/Book.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

import StorybookKit
import NextGrowingTextView
import UIKit
import MondrianLayout

let book = Book(title: "NextGrowingTextView") {

BookPush(title: "Flexible Width") {
FlexibleWidthCenteringViewController()
}

BookPush(title: "Fixed Width") {
FixedWidthViewController()
}

}


func makeControlPanel(for growingTextView: NextGrowingTextView) -> UIView {

let view = UIView()

Mondrian.buildSubviews(on: view) {

VGridBlock(columns: [
.init(.flexible(), spacing: 10),
.init(.flexible(), spacing: 10),
]) {

UIButton.make(title: "Set text") {
growingTextView.textView.text = BookGenerator.loremIpsum(length: 300)
}

UIButton.make(title: "Clear text") {
growingTextView.textView.text = ""
}

UIButton.make(title: "Max = 3") {
growingTextView.configuration.maxLines = 3
}

UIButton.make(title: "Max = 10") {
growingTextView.configuration.maxLines = 10
}

UIButton.make(title: "Min = 1") {
growingTextView.configuration.minLines = 1
}

UIButton.make(title: "Min = 5") {
growingTextView.configuration.minLines = 5
}
}

}

return view

}
Loading

0 comments on commit b00da01

Please sign in to comment.