From d7a93cca8289ad997af9ad2c1540877d5bd50879 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 24 Jun 2020 22:49:00 +0300 Subject: WIP --- Juick/Helpers/JJJAuthorizationField.h | 19 +++++++++++++++ Juick/Helpers/JJJAuthorizationField.m | 38 +++++++++++++++++++++++++++++ Juick/Juick.entitlements | 4 +++ Juick/Main.storyboard | 19 ++++++++++----- Juick/Model/Message.m | 4 +-- Juick/ViewControllers/LoginViewController.h | 6 +++-- Juick/ViewControllers/LoginViewController.m | 23 +++++++++++++++++ 7 files changed, 103 insertions(+), 10 deletions(-) create mode 100644 Juick/Helpers/JJJAuthorizationField.h create mode 100644 Juick/Helpers/JJJAuthorizationField.m (limited to 'Juick') diff --git a/Juick/Helpers/JJJAuthorizationField.h b/Juick/Helpers/JJJAuthorizationField.h new file mode 100644 index 0000000..d5118e0 --- /dev/null +++ b/Juick/Helpers/JJJAuthorizationField.h @@ -0,0 +1,19 @@ +// +// JJJAuthorizationField.h +// Juick +// +// Created by Vitaly Takmazov on 15.05.2020. +// Copyright © 2020 com.juick. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN +IB_DESIGNABLE +API_AVAILABLE(ios(13.0)) +@interface JJJAuthorizationField : UIView +@property (nonatomic, strong) IBInspectable ASAuthorizationAppleIDButton *button; +@end + +NS_ASSUME_NONNULL_END diff --git a/Juick/Helpers/JJJAuthorizationField.m b/Juick/Helpers/JJJAuthorizationField.m new file mode 100644 index 0000000..1173d8b --- /dev/null +++ b/Juick/Helpers/JJJAuthorizationField.m @@ -0,0 +1,38 @@ +// +// JJJAuthorizationField.m +// Juick +// +// Created by Vitaly Takmazov on 15.05.2020. +// Copyright © 2020 com.juick. All rights reserved. +// + +#import "JJJAuthorizationField.h" + +@implementation JJJAuthorizationField + +- (instancetype)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) { + [self setup]; + } + return self; +} + +- (void)setup +{ + self.button = [ASAuthorizationAppleIDButton new]; + [self addSubview:self.button]; + self.translatesAutoresizingMaskIntoConstraints = NO; + self.button.translatesAutoresizingMaskIntoConstraints = NO; + [NSLayoutConstraint activateConstraints:@[ + [self.widthAnchor constraintEqualToConstant:250.0], + [self.heightAnchor constraintEqualToConstant:46.0], + [self.button.topAnchor constraintEqualToAnchor:self.button.superview.topAnchor constant:0.0], + [self.button.bottomAnchor constraintEqualToAnchor:self.self.button.superview.bottomAnchor constant:0.0], + [self.button.trailingAnchor constraintEqualToAnchor:self.self.button.superview.trailingAnchor constant:0.0], + [self.button.leadingAnchor constraintEqualToAnchor:self.self.button.superview.leadingAnchor constant:0.0] + ]]; +} + +@end diff --git a/Juick/Juick.entitlements b/Juick/Juick.entitlements index d8c59dc..0a01181 100644 --- a/Juick/Juick.entitlements +++ b/Juick/Juick.entitlements @@ -4,6 +4,10 @@ aps-environment development + com.apple.developer.applesignin + + Default + com.apple.developer.associated-domains webcredentials:juick.com diff --git a/Juick/Main.storyboard b/Juick/Main.storyboard index 5d99c97..eba0978 100644 --- a/Juick/Main.storyboard +++ b/Juick/Main.storyboard @@ -100,19 +100,23 @@ - + + + + + - + @@ -120,15 +124,15 @@ - + -