Skip to content

Benny: Les 1 + Google drive test project + Restructure#2

Open
Periteus wants to merge 46 commits intomasterfrom
benny
Open

Benny: Les 1 + Google drive test project + Restructure#2
Periteus wants to merge 46 commits intomasterfrom
benny

Conversation

@Periteus
Copy link

No description provided.

@Periteus Periteus changed the base branch from master to stino March 23, 2017 12:04
@Periteus Periteus changed the title Les 1 Loading data in tableView with Faro + Start Objective-C vs Swift differences Benny: Les 1 Loading data in tableView with Faro + Start Objective-C vs Swift differences Mar 23, 2017
@Periteus Periteus requested a review from doozMen March 24, 2017 12:45
@Periteus Periteus changed the title Benny: Les 1 Loading data in tableView with Faro + Start Objective-C vs Swift differences Benny: Les 1 + Google drive test project + Restructure Mar 29, 2017
@doozMen doozMen changed the base branch from stino to master April 3, 2017 09:35
@@ -0,0 +1,26 @@
# Xcode
Copy link
Contributor

Choose a reason for hiding this comment

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

Het lijkt me nogal onnodig om een extra git met eigen git ignore toe te voegen. Dit moet er dus uit vrees ik


## SideNote

1. When having to react to delegates, like for example UITextFieldDidEndEditing(), it seems unlikely that you're not going to retain your viewModel inside the collectionViewCell. Isn't "never" a bit harsh?
Copy link
Contributor

Choose a reason for hiding this comment

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

As debated this is not the way to go. I know we do it but it brakes design pattern.

Always delegate changes to the ViewController so he can handle the changes:

  1. Deside if screen needs to be updated
  2. Save changes if needed
  3. Update the ViewModel from the detail changes.


1. When having to react to delegates, like for example UITextFieldDidEndEditing(), it seems unlikely that you're not going to retain your viewModel inside the collectionViewCell. Isn't "never" a bit harsh?

2. So when only displaying a certain amount of data ,structs are the way to go, but as soon as we need to display more or edit data , viewModel?
Copy link
Contributor

Choose a reason for hiding this comment

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

Struct or class do not mather. A ViewModel is used to display the content to the user. This can come from a model that is a class, struct or evan a single string of json.

@@ -6,8 +6,16 @@

2. Why is using Introspection important when we already imported and conformed the ViewController to the "DropboxLoginable" protocol?
Copy link
Contributor

Choose a reason for hiding this comment

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

Because some functions can be imptionally implemented in Objective-c


3. If modules are theoretically the better option over #import for things like UIKit, why do we still use #import <UIKit/UIKit.h>
?
3. Can't you just cast the nav.topViewController to the desired class instead?
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes you can.


4. If performSelector has no target given, will it use the target it is being called from? e.g.
```Objective-C
[aClass performSelector: @selector(aSelector)];
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case aClass is the target. Yes so it is implicit.

[aClass performSelector: @selector(aSelector)];
```

5. If modules are theoretically the better option over #import for things like UIKit, why do we still use #import <UIKit/UIKit.h>?
Copy link
Contributor

Choose a reason for hiding this comment

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

Compiler translates this to @import UIKit; So it is just legacy reason. Btw you can also use @import UIKit.UIKit.h; If you really want to.

}];
```

3. Explain the difference between NSOperation and GDC please.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a different set of API. GCD (Grand Central Dispatch) (not GDC). Is the lower level. NSOperation is a layer above this. It's main difference is:

  1. Easier to add interdependencies between operations
  2. You can stop an ongoing operation
  3. Object oriented api instead of a procedural api
  4. Used for inter operation communication. Operations can communicate from a different queue to another queue while still in process. This is more advanced usage.


3. Explain the difference between NSOperation and GDC please.

4. NSDictionary 'bindings' argument in NSPredicate filtering?
Copy link
Contributor

Choose a reason for hiding this comment

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

If you still need answer to this question please ask it again. I don't quite get the question now.

@@ -13,7 +13,7 @@

1. What's the importance of 'arrayWithCapacity' when mapping an array. Is this required?
Copy link
Contributor

Choose a reason for hiding this comment

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

The main difference performance. ArrayWithCapcity reserves memmory where the mapped array will go into. If you do not do this code will work but with every added element the processor will have to go look for more memory for the next elements. This is more processor intensive the reserve the memory up front if you know the expected length of the array before you calculated the data.

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.

2 participants