Coder Social home page Coder Social logo

swiftexamples's Introduction

SwiftExamples

A collection of Swift samples to experiment with different topics.

  • AtomicVariables - Attempt to create atomic variables and thread-safe collections by leveraging a queue.
  • AutolayoutScrollView - A short example on how to work with Auto Layout and UIScrollView.
  • CoreDataCodable - A sample app to experiment with:
    • Core Data and Codable.
    • Core Data unit testing.
  • DataPassing - A sample workspace to experiment with Data Passing between View Controllers.
  • GenericDataSource - A simple framework to experiment with Swift Generics and Data Sources Abstractions.
  • ParallaxAndScale - A sample project to experiment with Programmatic Views and Parallax and Scaling effects.
  • RegionMonitor - A sample app to experiment with Region Monitoring, Local Notifications and MapKit.
  • SmoothScrolling - A sample app to experiment with MVVM and scrolling optimizations.
  • SQLiteConnectionPool - An exploration of how to implement a DB Connection Pool for SQLite.
  • TaskList - A short example on how to handle sections in a UICollectionView.
  • TypeWrapping - Finding a way around some of the limitations of generic protocols in Swift.

swiftexamples's People

Contributors

andrea-prearo avatar noais avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftexamples's Issues

Only a question!

I saw better your code and I don't understand why you did the alteration on "fix-image-scrambling" commit?

Can you explain me why you simple put the avatar as a strong var?

@IBOutlet var avatar: UIImageView!

SmoothScrolling

When I tried to build SmoothScrolling project I got errors below.

Screen Shot 2019-10-28 at 4 56 39 pm

Screen Shot 2019-10-28 at 4 58 27 pm

The actual file names in Target Suport Files folder are different from the names Xcode is looking for.
Screen Shot 2019-10-28 at 4 57 10 pm

I managed to build this project by changing filenames in Target Suport Files folder from info.plist to WatchdogInspector-Info.plist and Pods-TableView-Info.plist, but I'm reporting this because I wasn't sure it was right approach to resolve this issue this way and it would be nice it could be fixed.

Thank you very much for this helpful project and post!

Support pagination for SmoothScrolling

In order to optimize data fetching and loading, the webservice to showcase SmoothScrolling should support pagination. This will be done in two steps:

  1. Support pagination with the current data format
  2. Update the webservice (v2) to return pagination information with each page

There is a flicker.

There is a flicker.

If you scroll up and down, there is a blinking.
How do you handle it?

SmoothScrolling: Images not loading or taking too long while scrolling fast

Hi,

I have read your tutorial so I decided to check the full sample code, also to port it to tvOS (but I get the same exact issues in iOS). I have run many tests, also trying to fix it myself (fat chance!) and when fast scrolling in a way or another something goes wrong. Either few images do not get loaded at all or they may take even 10 seconds to show.

I have put some extra logging and it seems like the old operations get executed even if the current cell is much far away. (I mean, something like #311 and following are loading, with many other is the middle, while #663 is showing) That would increase the time to load, I suppose. Then there is the issue of some avatars not showing at all, but they show later scrolling aways and then back.

Then I noticed that just after launch the first page gets loaded twice. But if I define the page size as the number of visible elements:

userViewModelController.retrieveUsers(pageSize: collectionView.visibleCells.count)
where in retrieveUsers() I added the parameter "pageSize" it seems to be fixed.

Last but not least... Any idea why I get this warning? It spams everywhere!

2018-08-06 11:28:15.665341+0200 CollectionView-tvOS[976:181832] prepareGeometry:1604: *** kCGColorSpaceModelRGB: bad numberOfChannels '3' for alphaInfo 'kCGImageAlphaNoneSkipFirst'
2018-08-06 11:28:15.670490+0200 CollectionView-tvOS[976:179840] prepareGeometry:1604: *** kCGColorSpaceModelRGB: bad numberOfChannels '3' for alphaInfo 'kCGImageAlphaNoneSkipFirst'

Actually i see that a big slowdown is caused by those messages, so they may be the root of the problem. I know it is just a tutorial, but it would help me greatly to understand why sometime it goes banana. Thanks!

PS: I forgot to mention that I am using Xcode 10 beta, iOS 12 beta and tvOS beta. Although with other programs I made using collection views the last issue doesn't present itself. Still if it works just fine for you it might be something with my environment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.