Skip to content

[WIP] Live Event App #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

[WIP] Live Event App #11

wants to merge 1 commit into from

Conversation

jguz-pubnub
Copy link
Contributor

@jguz-pubnub jguz-pubnub commented Nov 29, 2022

No description provided.

@jguz-pubnub jguz-pubnub force-pushed the feature/live-event-app branch from 7e13593 to f03bb1a Compare December 6, 2022 10:14
@jguz-pubnub jguz-pubnub force-pushed the feature/live-event-app branch 3 times, most recently from a628be0 to d581074 Compare December 14, 2022 12:26
@jguz-pubnub jguz-pubnub force-pushed the feature/live-event-app branch 3 times, most recently from 689fe90 to e20e5d1 Compare January 11, 2023 18:17
streamViewController.didMove(toParent: self)

messageListContainerViewController.view.translatesAutoresizingMaskIntoConstraints = false
streamViewController.view.translatesAutoresizingMaskIntoConstraints = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think about making setup for streamViewController then for messageListContrainerViewController? In that way we can make separate functions and remove comments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed a comment. Both messageListContainerViewController and streamViewController depend on each other. For instance, messageListContainerViewController top anchor is bounded to the bottom anchor of the streamViewController in portrait mode, so there's always a dependency between them. I checked your suggestion and the attempt to split applying constraints into two separate functions produced more code than it was originally.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats true that they depends on each other but it is not obstacle to create one setup then another, when activating constraints only in one place we have dependency
streamViewController.view.bottomAnchor.constraint(equalTo: messageListContainerViewController.view.topAnchor)
and this line requires both views in the same views hierarchy. Sometimes more code is cleaner then too long function like this one.

streamViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
streamViewController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
streamViewController.view.topAnchor.constraint(equalTo: view.topAnchor),
streamViewController.view.bottomAnchor.constraint(equalTo: messageListContainerViewController.view.topAnchor)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it is good idea to have segregated arrays for message and stream constraints and concatenate them in this big ones for portrait and landscape.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to resolve it and described it in this comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

answer above


// Enables PubNub logging to the Console
// PubNub.log.levels = [.all]
// PubNub.log.writers = [ConsoleLogWriter()]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imho it should be enabled in final version

@jguz-pubnub jguz-pubnub force-pushed the feature/live-event-app branch 2 times, most recently from 54a5b27 to 189e0c0 Compare January 31, 2023 14:02
@jguz-pubnub jguz-pubnub force-pushed the feature/live-event-app branch from 189e0c0 to 11fdb81 Compare February 1, 2023 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants