Skip to content

Releases: MihaelIsaev/UIKitPlus

Improve root controller to support scenes

07 Nov 10:33

Choose a tag to compare

RootController: implement attach(to scene:)

now in SceneDelegate file you could attach RootController like this

@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        guard let _ = (scene as? UIWindowScene) else { return }
        RootViewController().attach(to: scene) // it returns Window and you could store it if you want to
    }
}

without SceneDelegate you could attach RootController in AppDelegate like this

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    var rootViewController: RootViewController { window!.rootViewController as! RootViewController }

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        window = UIWindow(frame: UIScreen.main.bounds)
        RootViewController().attach(to: window)
        return true
    }
}

Live preview! 🎉

30 Oct 18:42

Choose a tag to compare

Let's imagine that you already have MyViewController in your project

create e.g. Live.swift, paste this code, enable canvas Cmd+Opt+Enter and pin this canvas

#if canImport(SwiftUI) && DEBUG
import SwiftUI
import UIKitPlus
@available(iOS 13.0, *)
struct DemoView_Preview: PreviewProvider {
    static var previews: some SwiftUI.View {
        MyViewController()
            .liveView
            .previewDevice(PreviewDevice(rawValue: "iPhone X"))
            .edgesIgnoringSafeArea(.vertical)
    }
}
#endif

go to MyViewController and enjoy with live preview!

Then just replace MyViewController() to somethings else to switch to preview for another view controller or view.

Finally started working on v1.0

29 Sep 20:14

Choose a tag to compare

This release still support iOS9+ but it works with Swift 5.1+ only because of function builders and property wrappers 🚀
Readme will be updated soon! Stay tuned!
P.S. If you can't wait write me a message on discord or take a look at commits.

Localization feature

09 Aug 15:46

Choose a tag to compare

Now you're able to localize any string with any locale.

let myString = String(
    .en("Hello"), 
    .fr("Bonjour"), 
    .ru("Привет"), 
    .es("Hola"), 
    .zh_Hans("你好"), 
    .ja("こんにちは"))
print(myString) // it will print string relative to your current locale

If somehow current language will no be detected it will use default language which is located in Localization.default and you can change it in runtime to anything you want.

Also you are able to change current language to anything you want by setting Localization.current

New things

22 Jul 18:07

Choose a tag to compare

  • Implement declarative UIPickerView
  • Implement declarative UIDatePicker
  • Implement extension to set different numeric values for different device models
let width: CGFloat = 100 !! .iPhone5(60) !! .iPhone6(70) !! .iPhone6Plus(85)
  • Implement declarative BarButtonItem
  • Implement declarative TableViewCell
  • Implement declarative InputView
  • TextField: add ability to set inputView
  • TextField: add an ability to add multiple callbacks for methods like didBeginEditing, didEndEditing, editingChanged
  • TabViewController: mark as open
  • UIView+Add: add method with [UIView] in addition to variadic
  • Label: add ability to set attributed text after initialization
  • TableView: implement a lot of useful methods
  • TableView: fix initialization issues
  • ScrollView: add convenience initializers
  • ScrollView: add delegate method
  • WrapperView: fix issue when shadow doesn't work with custom rounded corners
  • WrappedViewControlelr: parent view is not generic anymore

Critical fixes and pleasant improvements

20 Jul 11:53

Choose a tag to compare

  • Fix crossconstraints issue when views are added out of order
  • NavigationController allow to set tint color
  • NavigationController allow to hide navigationBar
  • NavigationController allow to enable/disable swipeBack
  • ViewController improve keyboard appearance handlers logic
  • Fix corners + shadow issue
  • View add discardableResult to subviews method
  • View improve tapAction
  • ButtonView add mode method
  • Add subviews method to StackView
  • Improve VerificationCodeView
  • TextFieldView add simple shouldReturn method
  • TextFieldView add ability to add left and right views
  • TextFieldView replace TextField with Self in all returns
  • Improve SegmentedControl
  • Implement ContentInsetAdjustment enum for CollectionView
  • Extend DeclarativeProtocol by adding one more corners method
  • Add centerX to DeclarativeConstraintXSide
  • Extend DeclarativeProtocol with bounds methods
  • Extend NavigationController with animated push and pop methods
  • Implement concat operator for AttributedString
  • Extend UIImage with convenience blurred method
  • Extend UIImage with convenience resize method
  • Implement ImpactFeedback
  • Extend UIDevice with few convenience methods
  • Add ability to print all fonts
  • Fix constraint operators