Code Monkey home page Code Monkey logo

singleton-category's Introduction

Practice

  • 熟悉Objective-CSingleton以及Category的實作
  • 熟悉MediaPlayerLibrary的運用

心得

  • 這次的練習是做一個應用程式可以讀取iPod裡的音樂,並且做一個歌曲列表、歌手列表,和一個可自訂義播放列表,需要使用本地端資料庫。這次練習本地端資練庫使用了第三方套件Realm,由於自己也是第一次使用,所以也是先花了些時間研究。

實作時大約主意兩個重點

  • 把一直重複用到的地方抽成Singleton
  • Singleton太複雜時可以使用Category

實作

  • 一開始建立MediaManager是一個Singleton物件,主要負責所有歌曲的操作,所以我幫他分了三個類別MediaManager+SongMediaManager+ArtistMediaManager+PlayList。每次App開啟在歌曲列表那頁都會同步iPod的資料。歌曲列表和歌手列表目前都只是列出資料,播放清單列表則可以新增、修改及刪除。

singleton-category's People

Contributors

muqq avatar

Watchers

James Cloos avatar  avatar

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.